Is it possible to set the Style
Property (of a Button
for example) from within a DataTrigger
on the same control?
I would like to define my Default-, MouseOver- and Selected-Styles as resources to reuse them later on. However handling MouseOver (and other) events seems to be usually done by setting the changed properties individually in a DataTrigger
instead of assigning a new Style
to the Control (which makes sense since the datatrigger would get removed by assigning another style).
You can accomplish something like this with DataTamplates:
Give it a try. You are basically using a
Style
which will change twoContentTemplates
according to theIsMouseOver
event.