Win10 UWP fullscreen

Source: Internet
Author: User

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();}

IsFullScreenModeTrue to apply full-screen now
ExitFullScreenModeExit Full Screen
TryEnterFullScreenModeGo 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.