Win10 UWP fullscreen

Source: Internet
Author: User

WIN10 can be full screen software or form. Forms are general, minimized, and maximized. We have new API settings our software is full screen, is the form.

We can use to ApplicationView let our software fullscreen, cancel.
Here is a simple sample that infers that our software is not fullscreen, assuming that it is not fullscreen, code in a ToggleButton

ApplicationView view = ApplicationView.GetForCurrentView();bool isInFullScreenMode = view.IsFullScreenMode;if (isInFullScreenMode)  {    view.ExitFullScreenMode();}else  {    view.TryEnterFullScreenMode();}

Isfullscreenmode is true. Apply full screen now
exitfullscreenmode exit full screen
tryenterfullscreenmode go full screen, go full screen success true
If you need to know the form changes, you can register Window.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 are able to set the PreferredLaunchWindowingMode open in our app

ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.FullScreen;

Applicationviewwindowingmode is able Auto to PreferredLaunchViewSize set the form and ApplicationView.PreferredLaunchViewSize , assuming that no settings ApplicationView.PreferredLaunchViewSize are used last close the form,FullScreen

Win10 has a very easy API to be able to apply fullscreen to the PC. We often use forms, and phones often use 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.