views:

305

answers:

1

I have a style defined in a resource dictionary that applies to all ComboBox controls. Within the ComboBox control, I reference the style like so:

Style="{DynamicResource MyComboBoxStyle}"

This works ok.

I want to be able to add some triggers to some of the ComboBox controls. What is a good way to use the style referenced as a dynamic resource yet still be able to add triggers to some of the ComboBox controls?

A: 

Create new styles for the ComboBox controls that you want to apply triggers to, and use the BasedOn property on the new style to set their base style.

Charlie
I get the following error when I attempt to do that: A 'DynamicResourceExtension' cannot be set on the 'BasedOn' property of type 'Style'.
Taylor
Why are you using DynamicResource, anyway? StaticResource should work for setting the Style.
Charlie
The Style is located in a separate module (using CAL), so I have to specify DynamicResource in order to use it.
Taylor