WPF events to commands

WPF

Here is an update on how to bind commands to events. Previously the library was System.Windows.Interactivity as described here: https://alexrait.blogspot.com/2022/01/creating-wpf-application-with.html, and now, instead, install this package: Microsoft.Xaml.Behaviors.Wpf

Then, instead of http://schemas.microsoft.com/expression/2010/interactivity and http://schemas.microsoft.com/expression/2010/interactions, use: http://schemas.microsoft.com/xaml/behaviors


<i:Interaction.Triggers>
    <i:EventTrigger EventName="Closing">
        <i:InvokeCommandAction Command=""/>
    </i:EventTrigger>
</i:Interaction.Triggers>

Post a Comment

Previous Post Next Post