Reputation: 2230
Without the use of third part DLLs, is it possible to bind the event of CellEditEnding to my command? Currently, I am using .NET 3.5, which has become an issue because it tells me that I cannot add an EventTrigger to the Trigger collection.
<i:Interaction.Triggers>
<i:EventTrigger EventName="CellEditEnding">
<i:InvokeCommandAction CommandName="EnterUserCountCommand" />
</i:EventTrigger>
</i:Interaction.Triggers>
Any help would be greatly appreciated!
Upvotes: 3
Views: 1174
Reputation: 26078
Not sure if this is the best solution, but when I'm in this situation I usually just do something like this.
private void CellEditEndingEvent(object sender, RoutedEventArgs e)
{
var viewModel = (MyViewModel)DataContext;
//Change params as needed
if (viewModel.MyCommand.CanExecute(null))
viewModel.MyCommand.Execute(null);
}
Upvotes: 1