/// <summary> /// 全屏按钮点击事件 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void FullWindowButton_Click(object sender, RoutedEventArgs e) { ApplicationView view = ApplicationView.GetForCurrentView(); if (view.IsFullScreenMode) { view.ExitFullScreenMode(); //和下面都是反着的 FullWindowSymbol.Symbol = Symbol.FullScreen; //DisplayInformation.AutoRotationPreferences = DisplayOrientations.Portrait; //返回恢复原来的功能 SystemNavigationManager.GetForCurrentView().BackRequested -= MediaPlayer_OnBackRequested; //SystemNavigationManager.GetForCurrentView().BackRequested += Link.OnBackrequested; view.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseVisible); } else { view.TryEnterFullScreenMode(); //修改按钮图标 FullWindowSymbol.Symbol = Symbol.BackToWindow; //显示返回键 //横过来 //DisplayInformation.AutoRotationPreferences = DisplayOrientations.Landscape; //使得返回变成退出全屏 //SystemNavigationManager.GetForCurrentView().BackRequested -= Link.OnBackrequested; SystemNavigationManager.GetForCurrentView().BackRequested += MediaPlayer_OnBackRequested; //使得导航栏透明 view.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow); } }
private static void av_VisibleBoundsChanged(ApplicationView sender, object args) { if (IsFullScreen) { sender.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow); } else { sender.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseVisible); } #if !DEBUG_BOUNDS if (ApiInfo.StatusBarSupported) { if (sender.Orientation == ApplicationViewOrientation.Landscape) { await StatusBar.HideAsync(); } else { await StatusBar.ShowAsync(); } } #endif root.InvalidateMeasure(); }
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); } }
public PhotoPreviewPage() { this.InitializeComponent(); ApplicationView appView = ApplicationView.GetForCurrentView(); appView.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow); }
protected override void OnLaunched(LaunchActivatedEventArgs e) { Frame rootFrame = Window.Current.Content as Frame; ApplicationView view = ApplicationView.GetForCurrentView(); view.SetPreferredMinSize(new Size(450, 500)); view.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow); if (rootFrame == null) { rootFrame = new Frame(); rootFrame.NavigationFailed += OnNavigationFailed; if (e.PreviousExecutionState == ApplicationExecutionState.Terminated) { //TODO: Загрузить состояние из ранее приостановленного приложения } Window.Current.Content = rootFrame; } if (e.PrelaunchActivated == false) { if (rootFrame.Content == null) { rootFrame.Navigate(typeof(MainPage), e.Arguments); } Window.Current.Activate(); } }
private async void SymbolIcon_Tapped_1(object sender, TappedRoutedEventArgs e) { Employee employee = employeeView.DataContext as Employee; ApplicationView newView = null; await CoreApplication.CreateNewView().Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { var frame = new Frame(); frame.Navigate(typeof(EmployeePage), employee); Window.Current.Content = frame; Window.Current.Activate(); newView = ApplicationView.GetForCurrentView(); newView.SetPreferredMinSize(new Size(200, 200)); newView.Title = employee.Name; newView.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow); newView.TitleBar.BackgroundColor = Windows.UI.Colors.Transparent; }); var compactOptions = ViewModePreferences.CreateDefault(ApplicationViewMode.CompactOverlay); compactOptions.CustomSize = new Size(300, 200); compactOptions.ViewSizePreference = ViewSizePreference.Custom; await ApplicationViewSwitcher.TryShowAsViewModeAsync(newView.Id, ApplicationViewMode.CompactOverlay, compactOptions); employeeView.Visibility = Visibility.Collapsed; }
protected override void OnNavigatedFrom(NavigationEventArgs e) { if (capturePhotoManager != null) { capturePhotoManager.Dispose(); } ApplicationView appView = ApplicationView.GetForCurrentView(); appView.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseVisible); }
public MainPage() { App.IsActivationDone = true; rowCount = ROWCOUNT_DEFAULT; oldColCount = colCount = COLCOUNT_DEFAULT; if (App.IsHardwareBackButtonAvailable) { ApplicationView currentView = ApplicationView.GetForCurrentView(); currentView.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow); double heightIncludingSystemTray = currentView.VisibleBounds.Height + currentView.VisibleBounds.Top; steeringWheelHeight = Window.Current.Bounds.Height - heightIncludingSystemTray; currentView.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseVisible); } InitializeComponent(); versionString.Text = App.VersionString; PopulateMenu(); }
/// <summary> /// Invoked when this page is about to be displayed in a Frame. /// </summary> /// <param name="e">Event data that describes how this page was reached. /// This parameter is typically used to configure the page.</param> protected override void OnNavigatedTo(NavigationEventArgs e) { ApplicationView appView = ApplicationView.GetForCurrentView(); appView.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow); if (e.Parameter != null) { string imagePath = (string)e.Parameter; Debug.WriteLine("inside photo detail page" + imagePath); viewModel = new PhotoDetailViewModel(imagePath); this.DataContext = viewModel; } }
private void EnforceSafeArea() { ApplicationView view = ApplicationView.GetForCurrentView(); view.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseCoreWindow); }
protected override void OnNavigatedFrom(NavigationEventArgs e) { ApplicationView appView = ApplicationView.GetForCurrentView(); appView.SetDesiredBoundsMode(ApplicationViewBoundsMode.UseVisible); }