Windows 8 utility tip series: 15. Four view statuses and screen lock notifications in Windows 8

Source: Internet
Author: User

In Windows 8, applications are enabled in full screen by default. If we need to check other applications, can we only go back to the Metro start page and select another program? In this way, the Windows 8 application has four view states (applicationviewstate ), similar to the minimization and maximization of common window programs, you can see that other applications allow the use of multiple applications at the same time.

View status switching method: click at the top of the screen and hold it down to the right or drag it to the left, move the Middle interval bar, and so on.

Applicationviewstate:

    

// Summary: // The current application view is landscape full screen fullscreenlandscape = 0, /// Summary: // The current application view becomes a large part.
Filled = 1, /// Summary: // The view of the current application becomes a small part of snapped = 2, /// summary: // The view of the current application is portrait full screen fullscreenportrait = 3,

Code for viewing view status:

Public mainpage () {This. initializecomponent (); this. sizechanged + = mainpage_sizechanged ;} /// <summary> /// display the current status according to the window size change /// </Summary> /// <Param name = "sender"> </param>/ // <Param name = "E"> </param> void mainpage_sizechanged (Object sender, sizechangedeventargs e) {This. tbshow. TEXT = applicationview. value. tostring ();}

As follows:

In Windows 8, the screen lock page notification is controlled from the background.

First, set "package. appxmanifest" --> "application UI" --> "lock screen notification ".

Next, set "package. appxmanifest" --> "Declaration" --> Add "background task", and check "push notification" and set mainpage of the entry point project.

The Code is as follows:

/// <Summary> /// update the notification button on the screen lock page /// </Summary> /// <Param name = "sender"> </param> /// <Param name = "E"> </param> private void btnupdatescreen_click (Object sender, routedeventargs e) {xmldocument badgedata = badgeupdatemanager. gettemplatecontent (badgetemplatetype. badgeglyph); xmlnodelist badgexml = badgedata. getelementsbytagname ("badge"); (xmlelement) badgexml [0]). setattribute ("value", "alert"); badgenotification badge = new badgenotification (badgedata); badgeupdatemanager. createbadgeupdaterforapplication (). update (badge );} /// <summary> /// specify the application's ability to execute Background Activities and display the block on the locked screen /// </Summary> /// <Param name = "E"> </param> protected async override void onnavigatedto (navigationeventargs E) {backgroundaccessstatus status = await backgroundexecutionmanager. requestaccessasync ();}

The final result is displayed by pressing win + L in Windows 8. This interface is difficult for everyone. If you want to be interested, download win8screen.rar source code.

Related Article

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.