I'm using the IntegerUpDown
control from WPFExtendedToolkit
However, I'm unable to assign the event my function so that when the value is changed it will call my function. I'm pretty new to both c# and wpf so help is greatly appreciated. I've been trying to get it to work as show in a similar example here.
private IntegerUpDown m_argumentUpDown;
public IntArgumentOption(ArgumentOptionDescription argumentDesc) : base(argumentDesc)
{
m_argumentUpDown = new IntegerUpDown
{
Watermark = argumentDesc.m_watermark,
Increment = (int)argumentDesc.m_interval,
Minimum = (int)argumentDesc.m_minimum,
Maximum = (int)argumentDesc.m_maximum,
FormatString = "G",
SelectAllOnGotFocus = true,
MinWidth = 50,
FontSize = 10,
Margin = new System.Windows.Thickness(5, 0, 0, 0),
};
// COMPILER ERROR:
m_argumentUpDown.ValueChanged += new RoutedPropertyChangedEventHandler<int>(ArgumentChanged);
}
void ArgumentChanged(object sender, RoutedPropertyChangedEventArgs<int> e)
{
}
Doing this results in the compiler error:
error CS0029: Cannot implicitly convert type 'System.Windows.RoutedPropertyChangedEventHandler< int >' to 'System.Windows.RoutedPropertyChangedEventHandler< object >'