Common APIs for WindowsPhone8.1 and WIN10

Source: Internet
Author: User

1. When the app is open, keep the screen awake and do not enter hibernation

Add in Onnavigatedto:

New displayrequest ();d isplayrequest.requestactive ();

2. App Fullscreen:

A. Hide Status Bar

await Windows.UI.ViewManagement.StatusBar.GetForCurrentView (). Hideasync ();

B. Hide the following virtual navigation keys

true;

3. Processing the back key message for Windows Phone

protected Override voidonnavigatedto (NavigationEventArgs e) {if(Windows.Foundation.Metadata.ApiInformation.IsTypePresent ("Windows.Phone.UI.Input.HardwareButtons")) hardwarebuttons.backpressed+=hardwarebuttons_backpressed; }protected Override voidOnnavigatedfrom (NavigationEventArgs e) {if(Windows.Foundation.Metadata.ApiInformation.IsTypePresent ("Windows.Phone.UI.Input.HardwareButtons")) hardwarebuttons.backpressed-=hardwarebuttons_backpressed; Base. Onnavigatedfrom (e);}Private voidHardwarebuttons_backpressed (Objectsender, Backpressedeventargs e) {e.handled=true;//Press Back No response
//Application.Current.Exit ();//Exit Program}

Common APIs for WindowsPhone8.1 and WIN10

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.