geraldbauer2005 | 12 Aug 22:43
Favicon

New CSS-like XAML Syntax for Styling Introduced In Windows Vista - Comments?

Hello,

   With the latest Windows Vista/WinFX release Microsoft has updated
its XAML styling syntax to use a CSS-like notation. 

   In the "A Hitchhiker's Guide to the Windows Presentation Foundation
Beta 1 Release" Tim Sneath writes:

    The styling model in Avalon has been refactored in this release.
Styles no longer contain instances of the controls inside them, but
instead include property setters and getters. The new format is
slightly more verbose but offers somewhat greater flexibility.

The following sample shows the new syntax for setting a style:

   <Page.Resources>
      <Style TargetType="{x:Type Paragraph}">
         <Setter Property="FontFamily" Value="Palatino Linotype" />
         <Setter Property="FontSize" Value="16pt" />
         <Setter Property="Margin" Value=".25in" />
      </Style>
   </Page.Resources>

   Source:
http://msdn.microsoft.com/library/en-us/dnlong/html/hgtobeta1.asp

   Any thoughts? Any comments?

   - Gerald

(Continue reading)


Gmane