I have two WPF IntegerUpDown toolkit and I would like to set to one of the toolkit a restriction , the maximum of the second IntegerUpDown toolkit should be equals to the value of the first IntegerUpDown toolkit.
I choose Value_changed event to do this , but I got this exception
System.NullReferenceException: 'Object reference not set to an instance of an object.'
This my code :
private void minimumatt_ValueChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
{
maximumatt.Maximum = minimumatt.Value;
}
Xaml code:
<wpfToolkit:IntegerUpDown ValueChanged="minimumatt_ValueChanged" Value="0" Minimum="0" x:Name="minimumatt" MinWidth="100" />
<wpfToolkit:IntegerUpDown Value="0" Minimum="0" x:Name="maximumatt" MinWidth="100" />
How can I add a restriction to the IntgerUpDown WPF toolkit control?
Is there any reason you cannot bind the
Maximumdirectly to theValueof the other control?