Introduced
Re-imagine the Windows 8 Store Apps System UI
Get UI-related setup information for the system
Screen orientation
Snap
Increases animation effects for SNAP operations and screen orientation changes
Zoom to different screens
High Contrast
Example
1. Demonstrates how to obtain the system's UI-related setup Information
Ui/uisettingsinfo.xaml.cs
* * Demonstrates how to obtain the UI-related setup information for the system * * using systems;
Using Windows.UI.ViewManagement;
Using Windows.UI.Xaml.Controls;
Using Windows.UI.Xaml.Navigation;
Namespace Xamldemo.ui {public sealed partial class Uisettingsinfo:page {public Uisettingsinfo () {this.
InitializeComponent (); } protected override void Onnavigatedto (NavigationEventArgs e) {uisettings uisettings =
New Uisettings ();
Lblmsg.text = "animationsenabled:" + uisettings.animationsenabled;
Whether to enable animation lblmsg.text + = Environment.NewLine; Lblmsg.text + = "Caretblinkrate:" + uisettings.caretblinkrate;
The blink rate of the input cursor lblmsg.text + = Environment.NewLine; * * Cursor Browsing mode (caret browsing)-there is an input cursor in the page similar to Notepad, the user can use the keyboard (press SHIFT + direction key) to accurately select the page text * IE8 The above can use "F7" to turn on/off the cursor browsing mode * * Lblmsg.text + + + caretbrowsingenabled: "+ uisettings.caretbrowsingenabled;
Whether the current input cursor is available for cursor browsing mode lblmsg.text + = Environment.NewLine; Lblmsg.text + = "Caretwidth:" + uisettings.caretwidth;
Enter the width of the cursor lblmsg.text + = Environment.NewLine; Lblmsg.text + = "Cursorsize:" + uisettings.cursorsize;
The size of the pointer lblmsg.text + = Environment.NewLine; Lblmsg.text + = "Doubleclicktime:" + uisettings.doubleclicktime;
When capturing a double-click, the maximum time between two clicks Lblmsg.text + = Environment.NewLine; Lblmsg.text + = "Handpreference:" + uisettings.handpreference;
The direction of the user interface (lefthanded or righthanded) Lblmsg.text + = Environment.NewLine; Lblmsg.text + = "Messageduration:" + uisettings.messageduration;
Message display duration, in units: seconds Lblmsg.text + = Environment.NewLine; Lblmsg.text + = "Mousehovertime:" + uisettings.mousehovertime;
Before the hover event is triggered, the pointer can hover the time lblmsg.text + = Environment.NewLine; Lblmsg.text + = "Scrollbararrowsize:" + uiseTtings. Scrollbararrowsize;
The size of the arrow for the current window scroll bar lblmsg.text + = Environment.NewLine; Lblmsg.text + = "Scrollbarsize:" + uisettings.scrollbarsize;
The current window scroll bar size lblmsg.text + = Environment.NewLine; Lblmsg.text + = "Scrollbarthumbboxsize:" + uisettings.scrollbarthumbboxsize;
The current window scroll bar thumb the size lblmsg.text + = Environment.NewLine;
Gets the relevant color of the current system Lblmsg.text + = "Activecaption:" + uisettings.uielementcolor (uielementtype.activecaption);
Lblmsg.text + = Environment.NewLine;
Lblmsg.text + = "Background:" + uisettings.uielementcolor (uielementtype.background);
Lblmsg.text + = Environment.NewLine;
Lblmsg.text + = "ButtonFace:" + uisettings.uielementcolor (uielementtype.buttonface);
Lblmsg.text + = Environment.NewLine;
Lblmsg.text + = "ButtonText:" + uisettings.uielementcolor (uielementtype.buttontext); Lblmsg.text + + ENVIRONMENT.NEwline;
Lblmsg.text + = "CaptionText:" + uisettings.uielementcolor (uielementtype.captiontext);
Lblmsg.text + = Environment.NewLine;
Lblmsg.text + = "Graytext:" + uisettings.uielementcolor (uielementtype.graytext);
Lblmsg.text + = Environment.NewLine;
Lblmsg.text + = "Highlight:" + uisettings.uielementcolor (uielementtype.highlight);
Lblmsg.text + = Environment.NewLine;
Lblmsg.text + = "Highlighttext:" + uisettings.uielementcolor (uielementtype.highlighttext);
Lblmsg.text + = Environment.NewLine;
Lblmsg.text + = "Hotlight:" + uisettings.uielementcolor (uielementtype.hotlight);
Lblmsg.text + = Environment.NewLine;
Lblmsg.text + = "Inactivecaption:" + uisettings.uielementcolor (uielementtype.inactivecaption);
Lblmsg.text + = Environment.NewLine; Lblmsg.text + = "Inactivecaptiontext:" + uisettings.uielementcolor (uielementtype.inactivecaptiontext);
Lblmsg.text + = Environment.NewLine;
Lblmsg.text + = "window:" + uisettings.uielementcolor (Uielementtype.window);
Lblmsg.text + = Environment.NewLine;
Lblmsg.text + = "windowtext:" + uisettings.uielementcolor (uielementtype.windowtext);
Lblmsg.text + = Environment.NewLine;
Accessibilitysettings accessibilitysettings = new Accessibilitysettings (); Lblmsg.text + = "Whether high Contrast mode is enabled:" + accessibilitysettings.highcontrast; Whether high Contrast mode}} is enabled
2, Demo and "screen direction" related to knowledge points
Ui/screenorientation.xaml
<page
x:class= "XamlDemo.UI.ScreenOrientation"
xmlns= "http://schemas.microsoft.com/winfx/2006/xaml/ Presentation "
xmlns:x=" Http://schemas.microsoft.com/winfx/2006/xaml "
xmlns:local=" Using:XamlDemo.UI "
xmlns:d= "http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc= "http:// schemas.openxmlformats.org/markup-compatibility/2006 "
mc:ignorable=" D ">
<grid background=" Transparent ">
<stackpanel margin=" 0 0 0 "> <togglebutton name=" btnlock "content="
lock Current Direction "
ischecked= "False" checked= "Btnlock_checked_1" unchecked= "Btnlock_unchecked_1"/> <textblock, Name=
"Lblmsg" fontsize= "14.667" margin= "0 0 0"/>
</StackPanel>
</Grid>
</Page>