WIN10 can be full-screen software or Windows, the window has a general, minimize, maximize. We have new API settings our software is fullscreen and is a window. We can use to ApplicationView
let our software fullscreen, cancel.
Here is a simple example of judging if our software is full screen, if it is, not fullscreen, code in a ToggleButton
ApplicationView view = ApplicationView.GetForCurrentView();bool isInFullScreenMode = view.IsFullScreenMode;if (isInFullScreenMode) { view.ExitFullScreenMode();}else { view.TryEnterFullScreenMode();}
IsFullScreenMode
True to apply full-screen now
ExitFullScreenMode
Exit Full Screen
TryEnterFullScreenMode
Go full screen, go to full screen success true
If the window changes need to know, you can registerWindow.Current.SizeChanged
public Class Isfullscreenmodetrigger:statetriggerbase {public isfullscreenmodetrigger () {Applicationview view = Applicationview.getforcurrentview (); SetActive (view. Isfullscreenmode); Window.Current.SizeChanged + = currentwindow_sizechanged; } private void Currentwindow_sizechanged (object sender, Windows.UI.Core.WindowSizeChangedEventArgs e) {Applicationview view = Applicationview.getforcurrentview (); SetActive (view. Isfullscreenmode); }}
<Grid Background="{ThemeResource Applicationpagebackgroundthemebrush}"> <visualstatemanager.visualstategroups> <visualstategroup> <visualstate x:name="Infullscreen"> <visualstate.statetriggers> <local:isfullscreenmodetrigger /> </visualstate.statetriggers> <visualstate.setters> <Setter Target="Isfullscreentext.text" Value= "in full screenmode" /> </visualstate.setters> </visualstate> </visualstategroup> </visualstatemanager.visualstategroups> <StackPanel horizontalalignment="Center"> <button click="Button_Click"Content="Togglefull Screen" > </Button> <TextBlock x:name="Isfullscreentext"FontSize=" the" textwrapping="Wrap"Text= "Not on full screenmode"/> </StackPanel></Grid>
When our application becomes full screen, TextBlock willIn full screen mode
We can set it up PreferredLaunchWindowingMode
in our app to open
ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.FullScreen;
Applicationviewwindowingmode can Auto
, PreferredLaunchViewSize
set the window and ApplicationView.PreferredLaunchViewSize
, if not set, ApplicationView.PreferredLaunchViewSize
use the last Close window,FullScreen
Win10 has a very simple API that can be applied fullscreen, in computers, we often use Windows, mobile phones are often used full screen.
http://igrali.com/2015/06/21/full-screen-mode-in-windows-10-universal-apps/
Win10 UWP fullscreen