Thank you for using the RoutedEventTrigger implementation. I know this is a very old old post. I tried this solution with VS 2017 in WPF with MVVM Light 5.4.1. I didn’t even need to change the code, as @Viv answered. Here is my XAML:
<i:Interaction.Triggers> <local:RoutedEventTrigger RoutedEvent="ToggleButton.Checked"> <ml:EventToCommand Command="{Binding TestCommand}" PassEventArgsToCommand="True" /> </local:RoutedEventTrigger> </i:Interaction.Triggers>
I used the Grid to contain several CheckBox controls that comes from ToggleButton. The RoutedEvent property is of type "RoutedEvent". I have mirrored the type of RoutedEvent. There is an [TypeConverter] attribute that looks like
[TypeConverter("System.Windows.Markup.RoutedEventConverter, PresentationFramework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, Custom=null")]
Maybe this is a new .NET feature, I think :) Anyway THANKS AGAIN!
source share