Win10 UWP Applicationview

Source: Internet
Author: User

Original: Win10 UWP Applicationview

This article and the introduction of an important class, he can be used to set the window, such as setting the startup size, whether the setting is allowed, whether to enter the full screen, all and the window related, can be set here.

can use simple get ApplicationView applicationView = ApplicationView.GetForCurrentView(); , note that he is unable to construct create

Start with the property first

The first property is Adjacenttoleftdisplayedge, which is judged not to be near the left side of the screen, but only within 20 pixels of the screen, but other including the window is not outside the screen. And he has the same attribute Adjacenttorightdisplayedge to determine if it is near the right edge.

This property is used in conjunction with the Get window changes.

How do I get the window size change? Use Corewindow.getforcurrentthread (). SizeChanged can get the window size change and can get close to the left side of the screen.

The second is DesiredBoundsMode feeling useless, indicating that the framework is used to arrange window content boundary values

  • FullScreenSystemOverlayModeThe mode of full-screen response gestures, including gesture callable system overlay (title taskbar), the edge gesture can invoke the temporary UI, and this uielement in turn can invoke system overrides for that edge

  • Get the window ID, use Applicationview.id, you can use multiple windows for the UWP, because you need to distinguish which window, so you can use this.

  • How do I determine whether to go full screen? Use Applicationview.isfullscreenmode. Judging whether the full screen function, and his same applicationview.isfullscreen can also, but this is not recommended

  • How do I get the window in the lock screen? Applicationview.isonlockscreen I try to lock the screen myself but still can't get it, if you know what this is, please tell me.

  • How can I set it? Some applications need to have secrets that can not be used, and applicationView.IsScreenCaptureEnabled if set to False, all apps are difficult to program. If for the display password or other page, is required to open this setting, that is, when entering the password, it is necessary to set, if set, then is black, cannot be obtained. When the password is not displayed, it can be set to true.

    First do a simple button, click on it and set it to false, not. Before you click, use Q to find

    After clicking, see the

    If it is set up, you can see it, but it is not available and can be used for programs with high information security requirements, but the performance may not be as good as before.

    About No, code: https://code.msdn.microsoft.com/windowsapps/Disable-screen-capture-00efe630

    This is not in the application can also be used, I have not tried, if there is a great God did, you can, please tell.

  • How do I get the window to be displayed horizontally? Applicationview.orientation can get whether the window is wider than the height, that is, landscape, or vice versa.

    Not using the screen reverse, is the width of the software, etc., is not it looks like landscape

  • Preferredlaunchviewsize This property is to set the window size to use, in Settings preferredlaunchwindowingmode for preferredlaunchviewsize can be used, using the method:

           ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;            ApplicationView.PreferredLaunchViewSize = new Size(100100);            如果设置无效,那么在最前设置             applicationView.SetPreferredMinSize(new Size(100,100)); 

Preferredlaunchwindowingmode MS recommends using auto

    • If for a multi-window program, you can set terminateapponfinalviewclose in close all Windows Close Program

    • How do I set the window caption? Use Applicationview.title = "caption" Setting will show "title-Program" in title

    • Set the title bar color Applicationview.titlebar You can get the title bar, you can customize the title bar by setting properties

      • BackgroundColor

      • Buttonbackgroundcolor

    • Gets the window visible area applicationview.visiblebounds, through applicationview.visibleboundschanged can know how to hide or show the title bar will change the window visible size method

    • Exit full screen applicationview.exitfullscreenmode (); Can only be used on the desktop

    • Go to Full screen applicationview.tryenterfullscreenmode ()

    • Modify window Size Applicationview.tryresizeview () only the desktop can be used

    • Full Screen display title bar Applicationview.showstandardsystemoverlays ()

See also: Https://docs.microsoft.com/en-us/uwp/api/windows.ui.viewmanagement.applicationview


This work is licensed under the Creative Commons Attribution-NonCommercial use-Share 4.0 International license agreement in the same way. Welcome to reprint, use, republish, but be sure to keep the article Attribution Lindesi (including Link: http://blog.csdn.net/lindexi_gd), not for commercial purposes, based on the modified works of this article must be issued with the same license. If you have any questions, please contact me.

Win10 UWP Applicationview

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.