wpf 导航按钮
时间: 2023-07-18 15:20:09
浏览: 77
WPF中的导航按钮通常用于创建导航UI,它们通常位于[窗口](https://geek.csdn.net/educolumn/00d3d1b467be187bf63895f811603770?spm=1055.2569.3001.10083)的侧边栏或底部栏,并用于导航到应用程序的不同页面或[视图](https://geek.csdn.net/educolumn/16d64c826bce43361f2b0cb609152e67?spm=1055.2569.3001.10083)。以下是一个简单的示例,演示如何创建一个带有导航按钮的UI:
<DockPanel>
<!-- 导航按钮 -->
<StackPanel DockPanel.Dock="Left" Width="100">
<Button Content="[page](https://geek.csdn.net/educolumn/1c66455c37fe0c4b32e4414c4c6aeead?spm=1055.2569.3001.10083) 1" Click="NavigateTo[page](https://geek.csdn.net/educolumn/1c66455c37fe0c4b32e4414c4c6aeead?spm=1055.2569.3001.10083)1" />
<Button Content="[page](https://geek.csdn.net/educolumn/1c66455c37fe0c4b32e4414c4c6aeead?spm=1055.2569.3001.10083) 2" Click="NavigateToPage2" />
<Button Content="Page 3" Click="NavigateToPage3" />
</StackPanel>
<!-- 页面内容 -->
<Frame Source="Page1.xaml" />
</DockPanel>
```