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