コード例 #1
0
ファイル: MediaPlayerElement.cs プロジェクト: zzyzy/uno
        private void ToogleFullScreen(bool showFullscreen)
        {
            if (showFullscreen)
            {
                ApplicationView.GetForCurrentView().TryEnterFullScreenMode();

#if __ANDROID__
                this.RemoveView(_layoutRoot);
#elif __IOS__
                _layoutRoot.RemoveFromSuperview();
#endif

                Windows.UI.Xaml.Window.Current.DisplayFullscreen(_layoutRoot);
            }
            else
            {
                ApplicationView.GetForCurrentView().ExitFullScreenMode();

                Windows.UI.Xaml.Window.Current.DisplayFullscreen(null);

#if __ANDROID__
                this.AddView(_layoutRoot);
#elif __IOS__
                this.Add(_layoutRoot);
#endif
            }
        }
コード例 #2
0
        private void ToogleFullScreen(bool showFullscreen)
        {
            try
            {
                _mediaPlayerPresenter.IsTogglingFullscreen = true;

                if (showFullscreen)
                {
                    ApplicationView.GetForCurrentView().TryEnterFullScreenMode();

#if __ANDROID__
                    this.RemoveView(_layoutRoot);
#elif __IOS__ || __MACOS__
                    _layoutRoot.RemoveFromSuperview();
#endif

                    Windows.UI.Xaml.Window.Current.DisplayFullscreen(_layoutRoot);
                }
                else
                {
                    ApplicationView.GetForCurrentView().ExitFullScreenMode();

                    Windows.UI.Xaml.Window.Current.DisplayFullscreen(null);

#if __ANDROID__
                    this.AddView(_layoutRoot);
#elif __IOS__
                    this.Add(_layoutRoot);
#elif __MACOS__
                    this.AddSubview(_layoutRoot);
#endif
                }
            }
            finally
            {
                _mediaPlayerPresenter.IsTogglingFullscreen = false;
            }
        }