0

When I using increment decrement with mouse, it works well. But when I am trying to write the value by keyboard, event handler reacts every keystroke. I triend to use UpdateValueOnEnterKey="True", but in this case increment decrement with mouse doesn`t react. How to make it work this way: when I click on increment/ decrement it should work instantaneously, but when I typing the value by keyboard it should work only after i press enter?

 <toolkit:IntegerUpDown x:Name="AnyName"  Grid.Column="0" Grid.Row="2" Margin="5, 2, 10, 2" 
                                       Grid.ColumnSpan="4"
                                       FormatString="N0" 
                                       ValueChanged="AnyName"
                                      />

private void AnyName_ValueChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
    {
        if (AnyName.IsLoaded)
        {
            string s = String.Format(CultureInfo.InvariantCulture, AnyName.Value.ToString());
            Console.WriteLine(s);
        }
    }
Daniel
  • 61
  • 6
  • Seems fairly logical to me. The user types, the value changes. What do you expect is going to happen as the user types? Why aren't you just binding the value? – Andy Oct 01 '21 at 16:03
  • The thing is I don't know how to use it properly. I tried to make it, but it didn’t work well – Daniel Oct 01 '21 at 16:53
  • Why is an integer anyname? Name suggests string to me. Other than James Bond or the Prisoner maybe. – Andy Oct 01 '21 at 18:52
  • Does it really matter? AnyName is also string. – Daniel Oct 02 '21 at 04:02

0 Answers0