Windows phone7 Study Notes 05-themes, styles, and control templates

Source: Internet
Author: User

  Windows Phone

1. You can select your own theme. There are two backgrounds (black or white), and there are 10 accent colors );

2. The Silverlight control can automatically monitor the topic and select different styles based on the user's topic.


  Windows Phone Style

A style is basically a set of attributes allocated for a specific element type. In addition to keys, it also has a targettype attribute to set the type of the control to be applied.

    <phone:PhoneApplicationPage.Resources>
<Style x:Key="BtnStyle" TargetType="Button">
<Setter Property="BorderBrush" Value="Red" />
<Setter Property="Foreground" Value="Yellow" />
</Style>
</phone:PhoneApplicationPage.Resources>

2. bind to button

<Button Content="Button" Height="72" HorizontalAlignment="Left" Margin="134,137,0,0" Name="button1" VerticalAlignment="Top" Width="160" Style="{StaticResource BtnStyle}" />

The resource Dictionary of Silverlight for Windows Phone contains standard styles that allow programs to adapt to screens with different resolutions. File Location of the Style File: System Disk: \ Program Files \ microsoft sdks \ Windows Phone \ v7.1 \ design \ themeresources. xml.

 

  Windows Phone control Template

Another resource Dictionary defines templates for SL for WP standard controls. You can use these templates to define the UI of the new controls. Template File Location: System Disk: \ Program Files \ microsoft sdks \ Windows Phone \ v7.1 \ design \ System. Windows. XAML.

 

PS: in the 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.