示例#1
0
 private void PageLayout_KeyUp(object sender, Windows.UI.Xaml.Input.KeyRoutedEventArgs e)
 {
     if (e.Key == Windows.System.VirtualKey.Escape && ViewModel.CurrentPageName.Contains("DetailPage"))
     {
         FullScreenService.ChangeFullScreenMode();
     }
 }
 private void DisableFullScreenClick(object sender, RoutedEventArgs e)
 {
     try
     {
         FullScreenService.ChangeFullScreenMode();
     }
     catch (Exception)
     {
     }
 }
        private void UpdateTrigger(Windows.Graphics.Display.DisplayOrientations orientation)
        {
            var qualifiers = Windows.ApplicationModel.Resources.Core.ResourceContext.GetForCurrentView().QualifierValues;
            var isOnMobile = qualifiers.ContainsKey("DeviceFamily") && qualifiers["DeviceFamily"].ToLowerInvariant() == "Mobile".ToLowerInvariant();

            if (orientation == Windows.Graphics.Display.DisplayOrientations.Landscape ||
                orientation == Windows.Graphics.Display.DisplayOrientations.LandscapeFlipped)
            {
                if (isOnMobile)
                {
                    FullScreenService.ChangeFullScreenMode();
                }
            }
            else if (orientation == Windows.Graphics.Display.DisplayOrientations.Portrait ||
                     orientation == Windows.Graphics.Display.DisplayOrientations.PortraitFlipped)
            {
                if (isOnMobile)
                {
                    FullScreenService.ChangeFullScreenMode();
                }
            }
        }