【发布时间】:2014-07-29 09:22:13
【问题描述】:
我正在 Windows Phone 7 中开发一个应用程序。在该应用程序中,我已经完成了 30 多个屏幕。现在我想在所有页面中添加滑动菜单。
请告诉我在所有页面中添加滑动菜单的想法。
我已经尝试过 WindowsPhoneControl。我创建了一个带有列表框的菜单,并尝试添加所有页面。
用户控制页面:-
<UserControl x:Class="NewExample.SlidingMenu"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
FontSize="{StaticResource PhoneFontSizeNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
d:DesignHeight="768" d:DesignWidth="400">
<Grid x:Name="LayoutRoot" Background="#FFB4B4B4">
<Button Command="{Binding testButton1}" Content="Test Button 1" Height="72" HorizontalAlignment="Left" Margin="12,10,0,0" Name="button1" VerticalAlignment="Top" Width="376" />
<Button Command="{Binding testButton2}" Content="Test Button 2" Height="72" HorizontalAlignment="Left" Margin="12,72,0,0" Name="button2" VerticalAlignment="Top" Width="376" />
<Button Command="{Binding testButton3}" Content="Test Button 3" Height="72" HorizontalAlignment="Left" Margin="12,132,0,0" Name="button3" VerticalAlignment="Top" Width="376" />
<Button Command="{Binding testButton4}" Content="Test Button 4" Height="72" HorizontalAlignment="Left" Margin="12,196,0,0" Name="button4" VerticalAlignment="Top" Width="376" />
</Grid>
</UserControl>
页面:-
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!--ContentPanel - place additional content here-->
<Grid x:Name="ContentPanel" Grid.Row="1" Margin="{Binding gridMargin}">
<Button Command="{Binding slideButton}" Content="Slide" Height="70" Name="slideButton" Width="160" HorizontalAlignment="Left" VerticalAlignment="Top" />
<ScrollViewer Margin="0,80,0,100">
<StackPanel Orientation="Vertical">
<TextBlock Text="Index Page 3" FontSize="28" HorizontalAlignment="Center" VerticalAlignment="Stretch" />
<Button Width="476" Command="{Binding getPageStackButton}" Content="Get Pages From PageStack" Height="72" HorizontalAlignment="Left" Margin="5,0,0,0" Name="button12" VerticalAlignment="Bottom" />
<Button Command="{Binding messageBoxExampleButton}" Content="Message Box Example" Height="72" Name="button1" Width="476" />
<Button Command="{Binding orderDetailButton}" Content="Order Detail" Height="72" Name="button3" Width="476" />
<Button Command="{Binding customMessageButton}" Content="Custom Message Box" Height="72" Name="button2" Width="476" />
</StackPanel>
</ScrollViewer>
<local:BottomTabBar Margin="0,660,0,0"/>
<Grid x:Name="SettingsPane" Width="400"
Margin="{Binding slideMargin}"
Grid.Row="0">
<local:SlidingMenu Width="400" Margin="0,0,0,0" />
</Grid>
</Grid>
</Grid>
当我单击页面中的滑块按钮时,我只是更改了 slideMenu 和页面的边距。
但它不像滑动菜单那样工作。请让我有任何其他想法。
【问题讨论】:
标签: windows-phone-7 slidingmenu