#93 – Specifying Markup Extensions Using Property Element Syntax

Markup extensions are typically expressed directly as property values using braces–{, }. (Property attribute syntax).

 <Button Name="btnOne" Background="{StaticResource aliceBrush}" Content="Dum" Height="23" Width="75" />

But a markup extension can also be expressed using property element syntax.  The XAML fragment below is equivalent to the one listed above.

 <Button Name="btnOne" Content="Dum" Height="23" Width="75">
     <Button.Background>
         <StaticResource ResourceKey="aliceBrush"/>
     </Button.Background>
 </Button>

About Sean
Software developer in the Twin Cities area, passionate about .NET technologies. Equally passionate about my own personal projects related to family history and preservation of family stories and photos.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 131 other followers