windows Store 当左边一列显示的首后,竖显示

< ![CDATA[

全屏的时候,全屏显示

原理就是:全屏的时候显示GridView

1列显示的时候,显示ListView

    public sealed partial class MainPage : Page
    {
        public MainPage()
        {
            this.InitializeComponent();

            //捕获 窗口大小变化
            Window.Current.SizeChanged += VisualStateChanged;
        }

       
        private void VisualStateChanged(object sender, Windows.UI.Core.WindowSizeChangedEventArgs e)
        {
            //the actual view size
            var visualState = ApplicationView.Value;

            if (visualState.ToString() == "Snapped")
            {
                MyListView.Visibility = Windows.UI.Xaml.Visibility.Visible;
                MyGridElements.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
            }
            else
            {
                MyListView.Visibility = Windows.UI.Xaml.Visibility.Collapsed;
                MyGridElements.Visibility = Windows.UI.Xaml.Visibility.Visible;
            }
        }

 就行了

参考 :

http://code.msdn.microsoft.com/Snapped-or-Full-Screen-f8ca48a0

]]>

你可能感兴趣的:(windows)