I was trying to add some visual feed back for a list box that supports drag and drop. Seems like I should be able to add some setters to an EventSetter and be done. However, eventsetters don’t support setters. Do I really have to make a storyboard to implement this behavior?
What is Microsoft’s rational for this?
<Style TargetType="{x:Type ListBox}">
<Style.Triggers>
<EventTrigger RoutedEvent="DragEnter">
<!--WHy Can't i Add seters here? e.g.
<Setter Property="ForeColor" Value="Red">
-->
</EventTrigger>
</Style.Triggers>
</Style>
A setter doesn’t just set a property in response to state changing, it also restores the property to its previous value when the state changes back. There’s no “changes back” with event triggers, so using setters with them would be like pushing something onto a stack that never gets popped.
I think a much better question, under the circumstances, is “why isn’t there an
IsDragOverproperty?”