I have a couple of questions about Avalon and XAML and if they aren't possible I'd like to suggest the concepts to the Avalon team.
1.) I've been looking for a way to set a property after an event in XAML but havn't been able to find anything about it (all EventTrigger examples use Actions which run timelines). I'd like to be able to do something like this:
<EventTrigger
RoutedEvent="Button.Click"
SourceName="collapser">
<Setter TargetName="mainView"
Property="Visibility" Value="Collapsed"/>
The reason why I cant just use some code-behind function is that it's inside the default ControlTemplate of the default Style for a custom control, so I can't call any functions, just XAML.
2.) Is there a way to use conditional values for Triggers? i.e.
<
Trigger Property="Expansion" Value=">.5">...
</Trigger>
I don't want Value=.5 because then the setters applied by the Trigger only last for as long as Expansion is exactly .5, i want it for greater than .5. This would be useful for anything being animated where you want Setters applied past a certain point in the animation, not just at one single instant.
Both suggestions seem obvious to me which is why I was wondering if there wasn't already a way to do it. Any ideas? Otherwise, why have they been omitted?