Good reference for Windows Phone 7 / Silverlight styles?

I am starting to work with WP7 / silverlight, and I understand that I want to have certain styles and not specify colors / fonts, etc. for each individual item.

Can someone point me to a good resource that explains how this works? Is there any equivalent to say .. css? .. that would allow me to define styles? I'm just not sure how this model works.

+3
source share
5 answers

I think the main way this works is in your element <Application>, you can define styles as resources:

<Application.Resources>
  <Style x:Name="MyStyledText" TargetType="TextBlock">
    <Setter Property="FontFamily" Value="Segoe WP"/>
    <Setter Property="FontSize" Value="24"/>
    <Setter Property="Foreground" Value="#123456"/>
  </Style>
  ...

And then, when you want to use it, you can just refer to it as a static resource:

<TextBlock Style="{StaticResource MyStyledText}" ... />

, , :

<phone:PhoneApplicationPage.Resources>
  <Style>
  ...
  </Style>
  ...

, , , , - , .

+2

, , ControlTemplate MSDN.

Framework MSDN Silverlight, .

C:\Program Files (x86)\Microsoft SDK\Windows Phone\v7.0\Design.

+4

, , Windows Phone 7 , .

.

+2

Source: https://habr.com/ru/post/1789940/


All Articles