Feature (feature) mobile phone orientation, localization, application trial experience, system theme resources, encryption and decryption of local data
Introduced
Distinctive features of Windows Phone 7.5 (SDK 7.1)
Mobile direction
Localization
The trial experience of the application
System Theme Resources
Encrypted decryption of local data
Example
1, demonstrate how to respond to the mobile phone direction changes
Orientation.xaml
<phone:phoneapplicationpage x:class= "Demo.Feature.Orientation" xmlns= "http://schemas.microsoft.com/winfx/200 6/xaml/presentation "xmlns:x=" Http://schemas.microsoft.com/winfx/2006/xaml "xmlns:phone=" Clr-namespace:microsoft . Phone.controls;assembly=microsoft.phone "Xmlns:shell=" clr-namespace:microsoft.phone.shell;assembly= Microsoft.phone "xmlns:d=" http://schemas.microsoft.com/expression/blend/2008 "xmlns:mc=" http:// schemas.openxmlformats.org/markup-compatibility/2006 "fontfamily=" {StaticResource PhoneFontFamilyNormal} "FontSiz E= ' {StaticResource phonefontsizenormal} ' foreground= ' {StaticResource Phoneforegroundbrush} ' SupportedOrientations= "Portrait" orientation= "Portrait" mc:ignorable= "D" d:designheight= "768" d:designwidth= "The Shell:SystemTray.IsVis" ible= "True" > <grid x:name= "layoutroot" background= "Transparent" > <textblock text= "Change Mobile direction to view demo effect "/> </Grid> </phoNe:phoneapplicationpage>
Orientation.xaml.cs
* * Demonstrates how to capture the mobile phone direction Change Event * * phoneapplicationpage-page * supportedorientations-direction of support (Microsoft.Phone.Contro Ls. Supportedpageorientation enumeration) * Portrait (vertical), landscape (horizontal), Portraitorlandscape (anyway) * Orientation-current direction (Mi Crosoft.
Phone.Controls.PageOrientation enum) * None, Portrait, Landscape, Portraitup, Portraitdown (not currently supported), Landscapeleft (Portraitup counterclockwise to Landscape), Landscaperight (Portraitup clockwise to Landscape) * orientationchanged-event triggered after directional change (event parameter: Orie
Ntationchangedeventargs * * Orientationchangedeventargs * Orientation-current page orientation * * using System;
Using System.Collections.Generic;
Using System.Linq;
Using System.Net;
Using System.Windows;
Using System.Windows.Controls;
Using System.Windows.Documents;
Using System.Windows.Input;
Using System.Windows.Media;
Using System.Windows.Media.Animation;
Using System.Windows.Shapes;
Using Microsoft.Phone.Controls; namespace Demo.feature {public partial class OriEntation:phoneapplicationpage {public orientation () {InitializeComponent (); This.
Supportedorientations = Supportedpageorientation.portraitorlandscape; This.
Orientationchanged + = new eventhandler<orientationchangedeventargs> (orientation_orientationchanged); } void Orientation_orientationchanged (object sender, Orientationchangedeventargs e) {i F ((e.orientation & pageorientation.portrait) = = (pageorientation.portrait)) {Messagebo
X.show ("vertical");
else {MessageBox.Show ("sideways"); }
}
}
}