I'm trying to detect when a numeric box value was changed by a user and handle it in my view model.
The numeric DoubleBox
is defined in XAML like this:
<numeric:DoubleBox Value="{Binding LeadR}" Grid.Column="1" MinValue="0" MaxValue="1000" IsEnabled="{Binding IsNotMeasuring}" ValueChanged="{Binding DoubleBox_ValueChanged}"/>
In my ViewModel.cs:
private void DoubleBox_ValueChanged(object sender, ValueChangedEventArgs<double?> e)
{
// Omitted Code: Insert code that does something whenever the text changes...
}
When I right click DoubleBox_ValueChanged
in XAML and "Go to definition", it will navigate to the method in WM. But when I run the code, Visual Studio shows this error:
System.Windows.Markup.XamlParseException: ''Provide value on 'System.Windows.Data.Binding' threw an exception.' Line number '123' and line position '162'.'
Can anyone tell me how to solve this?