Getting error : 'Could not find method named 'LostFocus' on object of type 'MyType' that matches the expected signature.'
<DataGridTemplateColumn MinWidth="80" Width="1.25*" Header="6">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<customControlls:NumericTextBox x:Name="cc"
Style="{StaticResource NumericTextboxStyle}"
Text="{Binding AccountsReceivable.OverdueAtTheEndOfTheReportingPeriod, UpdateSourceTrigger=LostFocus}">
<interactivity:Interaction.Triggers>
<interactivity:EventTrigger EventName="LostFocus" SourceName="cc">
<interactions:CallMethodAction TargetObject="{Binding}" MethodName="LostFocus"/>
</interactivity:EventTrigger>
</interactivity:Interaction.Triggers>
</customControlls:NumericTextBox>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
And the method in ViewModel which I'm trying to call. I also tried to remove parameters from method, still same error.
public void LostFocus(object sender, EventArgs e){}
I got it working. You need to bind TargetObject to DataGrid's DataContext.
And the method signature which will be called should be: