Different Windows Phone (28)

Source: Internet
Author: User
Tags xmlns

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"); } 
        } 
    } 
}

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.