#224 – Using Predefined System Colors in XAML

The System.Windows.SystemColors class contains a series of static properties that expose the current predefined system colors.  (Click here to see a list of these system colors).

You can use the x:Static markup extension in XAML to reference one of the predefined static properties in the SystemColors class.  Here we use a property that represents a predefined SolidColorBrush.

	<StackPanel>
		<Ellipse Height="100" Width="200" Fill="{x:Static SystemColors.HighlightBrush}" Margin="30"/>
	</StackPanel>

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