I’m trying to add event handler to a cell in DataTable by editing the cell style. Specifically, I’m setting
<EventSetter Event="TargetUpdated" Handler="TaskDescription_TextChanged1Event"/>
And here’s the error that I’m getting:
System.Windows.FrameworkElement.TargetUpdated="TaskDescription_TextChanged1Event"
is not valid. 'TargetUpdated' must be a RoutedEvent registered with a name that
ends with the keyword "Event".
Here’s the code for TaskDescription_TextChanged1Event:
public void TaskDescription_TextChanged1Event(object sender,
RoutedEventArgs e)
{
}
What should I do for this to work?
You cannot use
EventSettersfor events which are not routed, however according to the documentationFrameworkElement.TargetUpdatedis an alias event forBinding.TargetUpdated, which is routed, so subscribing to that might work out.