Transfer and download in Windows 8 Background

Source: Internet
Author: User
Background transfer download example this example demonstrates the transfer API of power-friendly, cost-aware and flexible behavior background for Windows runtime applications Program Void Mainpage_loaded ( Object Sender, routedeventargs E)
{
// Figure out what resolution and orientation we are in and respond appropriately
Checkresolutionandviewstate ();

//Load the scenariolist page into the proper frame
Scenariolist. navigate (type. GetType (_ rootnamespace +". Scenariolist"),This);
}

# RegionResolution and orientation code

VoidDisplayproperties_logicaldpichanged (ObjectSender)
{
Checkresolutionandviewstate ();
}

VoidCheckresolutionandviewstate ()
{
Visualstatemanager. gotostate (This, Applicationview. value. tostring () + displayproperties. resolutionscale. tostring (),False);
}

VoidMainpage_viewstatechanged (applicationview sender, applicationviewstatechangedeventargs ARGs)
{
Checkresolutionandviewstate ();
}

# Endregion

Private VoidSetfeaturename (StringStr)
{
Featurename. Text = STR;
}

AsyncVoidFooter_click (ObjectSender, routedeventargs E)
{
Await windows. system. launcher. launchiliasync (NewUri (hyperlinkbutton) sender). Tag. tostring ()));
}

Public Void Notifyuser ( String Strmessage, policytype type)
{
Switch (Type)
{
Case Yytype. statusmessage:
Statusblock. Style = resources [ " Statusstyle " ] As Style;
Break ;
Case Policytype. errormessage:
Statusblock. Style = resources [ " Errorstyle " ] As Style;
Break ;
}
Statusblock. Text = strmessage;
}

Public Void Donavigation (type pagetype, frame)
{
Frame. navigate (pagetype, This );
If (Pagetype. Name. Contains ( " Input " ))
{
// Raise inputframeloaded so downstream pages know that the input frame content has been loaded.
If (Inputframeloaded! = Null )
{
Inputframeloaded ( This , New Eventargs ());
}
}
Else
{
// Raise outputframeloaded so downstream pages know that the output frame content has been loaded.
If (Outputframeloaded! = Null )
{
Outputframeloaded ( This , New Eventargs ());
}
}

}

Complete example/files/risk/windows8/background transmission download sample.rar

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.