Windows 8 account image settings

Source: Internet
Author: User
Account image name example this example shows the user name obtained by different methods, currently logged on. It also demonstrates how to obtain and apply the image to the user's tile. Windows. system check. USERPROFILE is an information class and method applied to this sample.

 Partial ClassMainpage: Page

{
# Region Properties

PrivateFrame _ scenariosframe;

PublicFrame scenariosframe
{
Get{Return_ Scenariosframe ;}
Set{_ Scenariosframe = value ;}
}

PrivateFrame _ inputframe;

PublicFrame inputframe
{
Get{Return_ Inputframe ;}
Set{_ Inputframe = value ;}
}

PrivateFrame _ outputframe;

PublicFrame outputframe
{
Get{Return_ Outputframe ;}
Set{_ Outputframe = value ;}
}

Private String_ Rootnamespace;

Public StringRootnamespace
{
Get{Return_ Rootnamespace ;}
Set{_ Rootnamespace = value ;}
}

# Endregion

# RegionEvents

Public EventSystem. eventhandler inputframeloaded;
Public EventSystem. eventhandler outputframeloaded;

# Endregion

PublicMainpage ()
{
Initializecomponent ();

_ Scenariosframe = scenariolist;
_ Inputframe = scenarioinput;
_ Outputframe = scenariooutput;

Setfeaturename (feature_name );

loaded + = New routedeventhandler (mainpage_loaded);
Windows. UI. viewmanagement. applicationview. getforcurrentview (). viewstatechanged + = New typedeventhandler (mainpage_viewstatechanged);
displayproperties. logicaldpichanged + = New displaypropertieseventhandler (displayproperties_logicaldpichanged);

Navigationcachemode = windows. UI. XAML. Navigation. navigationcachemode. required;
}

VoidMainpage_loaded (ObjectSender, 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 VoidDonavigation (type inpagetype, frame inframe, type outpagetype, frame outframe)
{
Inframe. navigate (inpagetype,This);
Outframe. navigate (outpagetype,This);

// Raise inputframeloaded so downstream pages know that the input frame content has been loaded.
If (Inputframeloaded! = Null )
{
Inputframeloaded ( This , New Eventargs ());
}
// Raise outputframeloaded so downstream pages know that the output frame content has been loaded.
If (Outputframeloaded! = Null )
{
Outputframeloaded ( This , New Eventargs ());
}
}
}

Public EnumPolicytype
{
Statusmessage,
Errormessage
};

Complete demo

/Files/risk/windows8/account image 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.