Hi,
in the case of Checkbox control you can use the Command property in your xaml template to using a binding to your command, for some controls where there is no way to capture events with commands binding you will need to add them using attached properties like when using "System.Windows.Interactivity"
lets take a look to the first example:
<CheckBox Content="CheckBox"
Command="{Binding WhenCheckedCommand}"
CommandParameter="{Binding IsChecked, RelativeSource={RelativeSource Self}}" />
here you bind the changing state of the checkbox to the WhenCheckedCommand which take the IsChecked state from self "the checkbox" as parameter.
for the second case, you should install System.Windows.Interactivity library and have its dll in the execution folder, in your xaml add a namespace declaration:
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity"
also you will need mvvmlight which will provide you an EventToCommand converter:
xmlns:cmd="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.WPF4"
and in you can use them in your templates like this:
<i:Interaction.Triggers>
<i:EventTrigger EventName="Checked">
<cmd:EventToCommand Command="{Binding Path=WhenCheckedCommand,Mode=OneWay}" CommandParameter="{Binding IsChecked, ElementName=YourCheckBox}"></cmd:EventToCommand>
</i:EventTrigger>
</i:Interaction.Triggers>
Note: some controls do not support adding behaviors, you can then use your own attached properties, here is a great article demonstrating how to bind a command to a specific event:
http://www.mobilemotion.eu/?p=1822
if you are not using MVVM pattern the simple way is to use event handlers adders methods, let say we need to add an event handler to SelectionChangedEvent for a listbox you should do something like this:
$listBox.add_SelectionChanged({
$textBox.Text = $listBox.SelectedItem
})
the example is from this article:
https://devblogs.microsoft.com/powershell/wpf-powershell-part-3-handling-events/
also share a part of your implementation that we can give a specific solution for it.
Hope it helps!