Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Writing a custom WPF trigger

$
0
0

In a Style, I want to be able to write something like following:

<Trigger Property="TextStyle" Value="Main,Disabled,Secondary">
...</Trigger>

which should mean, that the setters inside this Trigger would fire if TextStyle property is either "Main", "Disabled" or "Secondary". How can I do that?

I do not want to repeat the setters (they are rather large), nor add additional properties to the control (it's large enough as is).

I tried to set a TypeConverter, but even if I manage to attach it to the property (which didn't seem to work anyway), I can't change the comparison algorithm (in essence, from Equals to Contains).

I'm trying to extend a Trigger class, but the documentation here is virtually unexisting.

Any help?


Mikhail


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>