예제 #1
0
파일: Video.xaml.cs 프로젝트: Liu-YT/MOSAD
        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
파일: MainPage.xaml.cs 프로젝트: liuwd8/uwp
        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;
            }
        }