【发布时间】:2016-04-28 07:04:09
【问题描述】:
如何在 XAML - UWP 中在顶部和底部制作汉堡菜单?
这是我的SplitView.Pane
<SplitView.Pane>
<Grid>
<Border Background="{StaticResource PanelBackground}"/>
<ListView x:Name="navMenuList"
SelectionMode="Single"
IsItemClickEnabled="True"
Margin="0,0,0,0" ItemsSource="{Binding Menus}">
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Width="240" HorizontalAlignment="Left" Height="48">
<SymbolIcon Margin="2,0,0,0" Symbol="{Binding Symbol}" Foreground="White"/>
<TextBlock Margin="24,0,0,0" Text="{Binding Text}" VerticalAlignment="Center" Foreground="White"/>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
<interactivity:Interaction.Behaviors>
<core:EventTriggerBehavior EventName="ItemClick">
<core:InvokeCommandAction Command="{Binding Path=MenuCommand}" CommandParameter="{Binding Target}"/>
</core:EventTriggerBehavior>
</interactivity:Interaction.Behaviors>
</ListView>
</Grid>
</SplitView.Pane>
用另一个绑定复制整个ListView 是一种好方法吗?
// 编辑
我需要这样的东西(但菜单项更多:)):
【问题讨论】:
-
您想要两个菜单窗格吗?因为我不确定你想要实现什么。
-
@danny 我编辑了我的 Q
-
也许你会发现AppShell template很有用。