Код: Выделить всё
private void OnMileageKeyDown(object args)
{
if (_tripModel!.TripLength == 0 && args is KeyboardEventArgs)
{
string keyChar = ((KeyboardEventArgs)args).Key;
bool success = int.TryParse(keyChar, out int keyInt);
if (success)
{
_tripModel!.TripLength = keyInt;
// ((KeyboardEventArgs)args).StopPropagation = true; // Not working
StateHasChanged();
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/793 ... ropagation