Condition in an EventTrigger
问题 Can I check condition inside an event trigger? how can I do something like that using only XAML? <EventTrigger RoutedEvent="MouseDown"> <Trigger Property="IsPressed" Value="true"> <Setter Property = "Foreground" Value="Green"/> 回答1: Buttons and menu items have an IsPressed property that would work for you but other controls does. It is however easy to add an IsPressed property using some attached behavior. This will let you write XAML like this: <TextBlock Text="Hello" TriggerTest