Question

I am not interested in animations and I am trying to make simple setter action to be set without key frames.

I wanted to inherit TriggerAction; make properties that set the new value on target, any additional optional properties so I can use:

<EventTrigger SourceName="btn" RoutedEvent="Click">
    <BooleanActionTrigger TargetName="cb" Property="IsChecked" Value="False"/>
</EventTrigger>
Was it helpful?

Solution

If Expression Blend is installed, there is a DLL System.Windows.Interactivity.dll in C:\Program Files (x86)\Microsoft SDKs\Expression\Blend 3\Interactivity\Libraries\WPF\System.Windows.Interactivity.dll.

Then it's possible to inherit

System.Windows.Interactivity.TriggerAction<T> where T : DependencyObject    
System.Windows.Interactivity.TriggerBase<T> where T : DependencyObject    
System.Windows.Interactivity.Behavior<T> where T : DependencyObject

OTHER TIPS

You do not need to have Expression Blend installed. System.Windows.Interactivity for WPF is now available on NuGet. Simply add that NuGet package to your project and write your custom TriggerAction:

using System.Windows;
using System.Windows.Interactivity;

public class MyCustomAction : TriggerAction<DependencyObject>
{
    ...
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top