Пример #1
0
        private void FullButton_Click(object sender, RoutedEventArgs e)
        {
            ApplicationView view = ApplicationView.GetForCurrentView();

            if (view.IsFullScreenMode)
            {
                view.ExitFullScreenMode();
            }
            else
            {
                view.TryEnterFullScreenMode();
            }
            //mediaPlayerElement.IsFullWindow = !mediaPlayerElement.IsFullWindow;
        }
Пример #2
0
        void SetFill(PrimaryPlayerDisplayMode currentMode)
        {
            if (_view.ViewMode == ApplicationViewMode.CompactOverlay)
            {
                _ = _view.TryEnterViewModeAsync(ApplicationViewMode.Default);
            }

            if (_view.IsFullScreenMode &&
                ApplicationView.PreferredLaunchWindowingMode != ApplicationViewWindowingMode.FullScreen
                )
            {
                _view.ExitFullScreenMode();
            }
        }
Пример #3
0
        public void FullScreenButton_Click(object sender, RoutedEventArgs e)
        {
            ApplicationView view = ApplicationView.GetForCurrentView();
            bool            isInFullScreenMode = view.IsFullScreenMode;

            if (isInFullScreenMode)
            {
                view.ExitFullScreenMode();
            }
            else
            {
                view.TryEnterFullScreenMode();
            }
        }
        private void ToggleFullscreenMode()
        {
            ApplicationView view = ApplicationView.GetForCurrentView();

            if (view.IsFullScreenMode)
            {
                view.ExitFullScreenMode();
                mpe.IsFullWindow = false;
            }
            else
            {
                view.TryEnterFullScreenMode();
                TryRemoveUI();
            }
        }
Пример #5
0
        public void ShowFullScreen()
        {
            ApplicationView appView = ApplicationView.GetForCurrentView();

            bool isInFullScreenMode = appView.IsFullScreenMode;

            if (isInFullScreenMode)
            {
                appView.ExitFullScreenMode();
            }
            else
            {
                appView.TryEnterFullScreenMode();
            }
        }
Пример #6
0
 private async void SetWindowState(WindowState value)
 {
     await _swp.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         ApplicationView av = ApplicationView.GetForCurrentView();
         if (value == WindowState.FullScreen)
         {
             av.TryEnterFullScreenMode();
         }
         else
         {
             av.ExitFullScreenMode();
         }
     });
 }
Пример #7
0
        // public bool IsReady { get; set; }
        public MainPage()
        {
            this.InitializeComponent();
            ApplicationView view = ApplicationView.GetForCurrentView();
            bool            IsInFullScreenMode = view.IsFullScreenMode;

            if (IsInFullScreenMode)
            {
                view.ExitFullScreenMode();
            }
            else
            {
                view.TryEnterFullScreenMode();
            }
        }
Пример #8
0
        public void setFullScreen()
        {
            ApplicationView current_window = ApplicationView.GetForCurrentView();

            app_data.ISFULLSCREEN = current_window.IsFullScreenMode;
            if (app_data.ISFULLSCREEN)
            {
                current_window.ExitFullScreenMode();
            }
            else
            {
                current_window.TryEnterFullScreenMode();
            }
            app_data.ISFULLSCREEN = current_window.IsFullScreenMode;
        }
Пример #9
0
        private void toggleSwitchFullScreen_Toggled(object sender, RoutedEventArgs e)
        {
            view          = ApplicationView.GetForCurrentView();
            localSettings = ApplicationData.Current.LocalSettings;

            if (toggleSwitchFullScreen.IsOn == true)
            {
                localSettings.Values["isFullScreenMode"] = "true";
                view.TryEnterFullScreenMode();
            }
            else
            {
                localSettings.Values["isFullScreenMode"] = "false";
                view.ExitFullScreenMode();
            }
        }
Пример #10
0
 public static void SetFullScreen(bool fullScreen)
 {
     if (fullScreen)
     {
         if (ApplicationView.TryEnterFullScreenMode())
         {
             ApplicationView.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow);
             Microsoft.AppCenter.Analytics.Analytics.TrackEvent("Full screen entered");
         }
     }
     else
     {
         ApplicationView.ExitFullScreenMode();
         ApplicationView.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseVisible);
     }
 }
Пример #11
0
        // WebView 中的内容进入全屏或退出全屏时触发的事件
        private void WebView1_ContainsFullScreenElementChanged(WebView sender, object args)
        {
            ApplicationView applicationView = ApplicationView.GetForCurrentView();

            // WebView 中的内容处于全屏状体
            if (sender.ContainsFullScreenElement)
            {
                // 将 app 设置为全屏模式
                applicationView.TryEnterFullScreenMode();
            }
            else
            {
                // 将 app 退出全屏模式
                applicationView.ExitFullScreenMode();
            }
        }
        private void MyFullButton_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            ApplicationView view   = ApplicationView.GetForCurrentView();
            bool            isFull = view.IsFullScreenMode;

            if (!isFull)
            {
                view.TryEnterFullScreenMode();
                view.FullScreenSystemOverlayMode = FullScreenSystemOverlayMode.Standard;
            }
            else
            {
                view.ExitFullScreenMode();
            }
            Fulled?.Invoke(this, EventArgs.Empty);
        }
Пример #13
0
        private void btnMode_Tapped(object sender, TappedRoutedEventArgs e)
        {
            ApplicationView view = ApplicationView.GetForCurrentView();

            bool isInFullScreenMode = view.IsFullScreenMode;

            if (isInFullScreenMode)
            {
                view.ExitFullScreenMode();
                btnMode.Content = "View Full Screen Mode";
            }
            else
            {
                view.TryEnterFullScreenMode();
                btnMode.Content = "Exit Full Screen Mode";
            }
        }
Пример #14
0
        private void JellyfinWebView_ContainsFullScreenElementChanged(Windows.UI.Xaml.Controls.WebView sender, object args)
        {
            ApplicationView appView = ApplicationView.GetForCurrentView();

            if (sender.ContainsFullScreenElement)
            {
                appView.TryEnterFullScreenMode();
                return;
            }

            if (!appView.IsFullScreenMode)
            {
                return;
            }

            appView.ExitFullScreenMode();
        }
Пример #15
0
        private void fullScreen_Click(object sender, RoutedEventArgs e)
        {
            if (picture.Visibility != Visibility.Visible)
            {
                mediaPlayer.IsFullWindow = !mediaPlayer.IsFullWindow;
            }
            ApplicationView view = ApplicationView.GetForCurrentView();

            if (view.IsFullScreenMode == true)
            {
                view.ExitFullScreenMode();
            }
            else
            {
                view.TryEnterFullScreenMode();
            }
        }
Пример #16
0
        private void display_button_Click(object sender, RoutedEventArgs e)
        {
            ApplicationView view = ApplicationView.GetForCurrentView();
            bool            isInFullScreenMode = view.IsFullScreenMode;

            if (isInFullScreenMode)
            {
                view.ExitFullScreenMode();
                display_button.FontFamily = new FontFamily("Segoe MDL2 Assets");
                display_button.Content    = "\uE740";
            }
            else
            {
                view.TryEnterFullScreenMode();
                display_button.FontFamily = new FontFamily("Segoe MDL2 Assets");
                display_button.Content    = "\uE73F";
            }
        }
Пример #17
0
        private void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            view          = ApplicationView.GetForCurrentView();
            localSettings = ApplicationData.Current.LocalSettings;
            object value = localSettings.Values["isFullScreenMode"];

            if (value != null)
            {
                if (value.ToString() == "true")
                {
                    view.TryEnterFullScreenMode();
                }
                else if (value.ToString() == "false")
                {
                    view.ExitFullScreenMode();
                }
            }
        }
Пример #18
0
        private async void OnKeyDown(object sender, KeyRoutedEventArgs e)
        {
            ApplicationView applicationView = ApplicationView.GetForCurrentView();

            if (e.Key == Windows.System.VirtualKey.Escape && applicationView.IsFullScreenMode)
            {
                applicationView.ExitFullScreenMode();
            }
            else if (e.Key == Windows.System.VirtualKey.Escape && applicationView.ViewMode == ApplicationViewMode.CompactOverlay)
            {
                MyCanvas.Margin = new Thickness(-16, -8, -16, -8);
                await applicationView.TryEnterViewModeAsync(ApplicationViewMode.Default);
            }
            else if (e.Key == Windows.System.VirtualKey.Space)
            {
                TogglePlaying();
            }
        }
Пример #19
0
        private void FullScreen_Toggled(object sender, RoutedEventArgs e)
        {
            ApplicationView view = ApplicationView.GetForCurrentView();
            bool            isInFullScreenMode = view.IsFullScreenMode;

            if (isInFullScreenMode)
            {
                BtnCloseApp.Visibility = Visibility.Collapsed;
                view.ExitFullScreenMode();
                localSettings.Values["FullScrenn"] = 0;
            }
            else
            {
                BtnCloseApp.Visibility = Visibility.Visible;
                view.TryEnterFullScreenMode();
                localSettings.Values["FullScrenn"] = 1;
            }
        }
Пример #20
0
        private void Button_FullScreenMode_Click(object sender, RoutedEventArgs e)
        {
            ApplicationView view = ApplicationView.GetForCurrentView();
            bool            isInFullScreenMode = view.IsFullScreenMode;

            if (isInFullScreenMode)
            {
                view.ExitFullScreenMode();
                TextBlock_FullScreenModeTip.Text = "全屏";
                FontIcon_FullScreenMode.Glyph    = "\xE740";
            }
            else
            {
                view.TryEnterFullScreenMode();
                TextBlock_FullScreenModeTip.Text = "退出全屏";
                FontIcon_FullScreenMode.Glyph    = "\xE73F";
            }
        }
Пример #21
0
        private void display_Click(object sender, RoutedEventArgs e)
        {
            ApplicationView view = ApplicationView.GetForCurrentView();
            bool            isInFullScreenMode = view.IsFullScreenMode;

            if (isInFullScreenMode)
            {
                ImageBrush imageBrush = new ImageBrush();
                imageBrush.ImageSource    = new BitmapImage(new Uri("ms-appx:///Assets/3.jpg", UriKind.Absolute));
                MyGrid.Background         = imageBrush;
                MyGrid.Background.Opacity = 0.5;
                view.ExitFullScreenMode();
            }
            else
            {
                MyGrid.Background = new SolidColorBrush(Colors.Black);// Windows.UI.Xaml.Media.Brush
                view.TryEnterFullScreenMode();
            }
        }
Пример #22
0
        private void menu_fullscreen(object sender, RoutedEventArgs e)
        {
            linha     = false;
            circulo   = false;
            quadrado  = false;
            retangulo = false;
            color     = false;
            texto     = false;
            ApplicationView view = ApplicationView.GetForCurrentView();

            if (view.IsFullScreenMode)
            {
                view.ExitFullScreenMode();
            }
            else
            {
                view.TryEnterFullScreenMode();
            }
        }
Пример #23
0
        private void fullScreen_Click(object sender, RoutedEventArgs e)
        {
            ApplicationView view = ApplicationView.GetForCurrentView();

            if (!flag)
            {
                return;
            }
            if (view.IsFullScreenMode)
            {
                mediaElement.IsFullWindow = false;
                view.ExitFullScreenMode();
            }
            else
            {
                mediaElement.IsFullWindow = true;

                view.TryEnterFullScreenMode();
            }
        }
Пример #24
0
 private void txt_Nombre_KeyDown(object sender, KeyRoutedEventArgs e)
 {
     if (e.Key == Windows.System.VirtualKey.Escape)
     {
         ApplicationView view = ApplicationView.GetForCurrentView();
         bool            isInFullScreenMode = view.IsFullScreenMode;
         if (isInFullScreenMode)
         {
             view.ExitFullScreenMode();
             display_button.FontFamily = new FontFamily("Segoe MDL2 Assets");
             display_button.Content    = "\uE740";
         }
         //else
         //{
         //    view.TryEnterFullScreenMode();
         //    display_button.FontFamily = new FontFamily("Segoe MDL2 Assets");
         //    display_button.Content = "\uE73F";
         //}
     }
 }
Пример #25
0
        //全屏/退出全屏操作
        private void scale_Click(object sender, RoutedEventArgs e)
        {
            SymbolIcon      icon = (SymbolIcon)scale.Icon;
            ApplicationView view = ApplicationView.GetForCurrentView();

            if (icon.Symbol == Symbol.FullScreen)
            {
                view.TryEnterFullScreenMode();
                icon.Symbol            = Symbol.BackToWindow;
                scale.Label            = "退出全屏";
                mediaSlider.Visibility = Visibility.Collapsed;  //进入全屏时,隐藏进度条
                showSlider.Label       = "显示进度条";
            }
            else
            {
                view.ExitFullScreenMode();
                icon.Symbol            = Symbol.FullScreen;
                scale.Label            = "全屏";
                mediaSlider.Visibility = Visibility.Visible;    //退出全屏时,显示进度条
                showSlider.Label       = "隐藏进度条";
            }
        }
Пример #26
0
 private void AdjustScreenMode()
 {
     try
     {
         bool            isPhone = ApiInformation.IsApiContractPresent("Windows.Phone.PhoneContract", 1);
         ApplicationView view    = ApplicationView.GetForCurrentView();
         if (!isPhone)
         {
             if (view.IsFullScreenMode)
             {
                 view.ExitFullScreenMode();
             }
         }
         else
         {
             ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.FullScreen;
         }
     }
     catch (Exception)
     {
     }
 }
Пример #27
0
        static void FullScreen(object sender, RoutedEventArgs e)
        {
            var             button             = sender as Button;
            ApplicationView view               = ApplicationView.GetForCurrentView();
            bool            isInFullScreenMode = view.IsFullScreenMode;


            if (isInFullScreenMode)
            {
                view.ExitFullScreenMode();
                button.Content = "FullScr";
                view.ShowStandardSystemOverlays();
            }
            else
            {
                view.FullScreenSystemOverlayMode = FullScreenSystemOverlayMode.Minimal;
                view.TryEnterFullScreenMode();
                var bar = view.TitleBar;
                bar.BackgroundColor = Color.FromArgb(0, 0, 0, 0);
                button.Content      = "Windowed";
            }
        }
Пример #28
0
 private void ChangeFullScreen(object sender, ManipulationCompletedRoutedEventArgs e)
 {
     //await new MessageDialog("getgetget!\n", "getgetget").ShowAsync();
     if (e.Cumulative.Expansion > 50)
     {
         ApplicationView view = ApplicationView.GetForCurrentView();
         if (!view.IsFullScreenMode)
         {
             if (view.TryEnterFullScreenMode())
             {
                 ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.FullScreen;
             }
         }
     }
     else if (e.Cumulative.Expansion < -50)
     {
         ApplicationView view = ApplicationView.GetForCurrentView();
         if (view.IsFullScreenMode)
         {
             view.ExitFullScreenMode();
             ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.Auto;
         }
     }
 }
Пример #29
0
        private void display_Click(object sender, RoutedEventArgs e)
        {
            ApplicationView view = ApplicationView.GetForCurrentView();

            if (view.IsFullScreenMode)
            {
                ImageBrush imageBrush = new ImageBrush
                {
                    ImageSource = new BitmapImage(new Uri("ms-appx:///Assets/music.jpg", UriKind.Absolute))
                };
                grid.Background = imageBrush;
                view.ExitFullScreenMode();
            }
            else
            {
                if (!IsAudio())
                {
                    grid.Background      = new SolidColorBrush(Colors.Black);
                    rotatePic.Visibility = Visibility.Collapsed;
                    EllStoryboard.Stop();
                }
                view.TryEnterFullScreenMode();
            }
        }
Пример #30
0
        /// <summary>
        /// Touche pressée
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void OnKeyDown(Windows.UI.Core.CoreWindow sender, Windows.UI.Core.KeyEventArgs e)
        //private void OnKeyDown(object sender, KeyRoutedEventArgs e)
        {
            if (haveFocus == false)
            {
                return;
            }

            //if (e.VirtualKey != VirtualKey.GamepadRightShoulder)
            //{
            //    Debug.WriteLine(e.VirtualKey + " " + e.KeyStatus.ScanCode);
            //}

            //var virtualKey = e.VirtualKey;

            //switch(e.KeyStatus.ScanCode)
            //{
            //    case 44: // W en français, Z en anglais, ..
            //        virtualKey = VirtualKey.W;
            //        break;
            //    case 45: // X en français, ? en anglais, ..
            //        virtualKey = VirtualKey.X;
            //        break;
            //}

            switch (e.VirtualKey)
            {
            case VirtualKey.Up:
                keyboardGamepad.Press(GamepadKeys.Up);
                break;

            case VirtualKey.Down:
                keyboardGamepad.Press(GamepadKeys.Down);
                break;

            case VirtualKey.Right:
                keyboardGamepad.Press(GamepadKeys.Right);
                break;

            case VirtualKey.Left:
                keyboardGamepad.Press(GamepadKeys.Left);
                break;

            case VirtualKey.Z:
            case VirtualKey.W:
            case VirtualKey.Y:
                keyboardGamepad.Press(GamepadKeys.ButtonA);
                break;

            case VirtualKey.X:
                keyboardGamepad.Press(GamepadKeys.ButtonB);
                break;

            case VirtualKey.Space:
                keyboardGamepad.Press(GamepadKeys.ButtonStart);
                break;

            // pleine écran
            case VirtualKey.F11:

                try
                {
                    // alt (pour alt+entrée) est compliqué à trouver, on verra plus tard...
                    ApplicationView view = ApplicationView.GetForCurrentView();

                    if (view.IsFullScreenMode)
                    {
                        view.ExitFullScreenMode();
                    }
                    else
                    {
                        view.TryEnterFullScreenMode();
                    }
                }
                catch
                {
                }

                break;
            }
        }