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


FLASHBACK WITH SIRASA FM AT GALGAMUWA 2022


Mp3 Download: Mdu - Mazola


Imitation gun was fired at motorist in Leicester road-rage incident


Ndebele names


MCKINNEY EMALINE “EMMA” OF WES...


Okra & Motia — The Workshop (Prod by Hammer)


Skint TV teen to be sentenced


Moondru Mudichu 19-09-2017 – Polimer tv Serial


YOSVANI JAMES Arrested by Miami-Dade County Corrections on Jan 10, 2017


Stories • Goddess Stepmom