#142 – Dependency Property Value Sources: #8 – Theme Style Triggers

The eighth source in the list of sources for the base value of a dependency property is a theme style trigger.  A theme style trigger is a trigger defined in the default style for a control.  Every control that ships with WPF has a default style that dictates its appearance, also known as a theme style.

As an example, notice that when you set the IsEditable property of a ComboBox to true, it’s appearance changes.

IsEditable false:  

IsEditable true:  

The change in appearance is caused by a trigger in the default style.  If you right-click on a ComboBox in Blend and pick Edit a Template | Edit a Copy, you can see the default style for a ComboBox, including the following trigger on IsEditable.

				<Trigger Property="IsEditable" Value="true">
					<Setter Property="BorderBrush" Value="{StaticResource TextBoxBorder}"/>
					<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
					<Setter Property="IsTabStop" Value="false"/>
					<Setter Property="Padding" Value="3"/>
					<Setter Property="Template" Value="{StaticResource ComboBoxEditableTemplate}"/>
				</Trigger>
About these ads

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.

2 Responses to #142 – Dependency Property Value Sources: #8 – Theme Style Triggers

  1. Pingback: Tweets that mention #142 – Dependency Property Value Sources: #8 – Theme Style Triggers « 2,000 Things You Should Know About WPF -- Topsy.com

  2. Pingback: #133 – Where a Dependency Property Gets Its Value « 2,000 Things You Should Know About WPF

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 233 other followers

%d bloggers like this: