mirror of
https://github.com/SourMesen/Mesen2.git
synced 2025-04-02 10:21:44 -04:00
18 lines
No EOL
479 B
C#
18 lines
No EOL
479 B
C#
using Avalonia.Controls;
|
|
using System;
|
|
|
|
namespace Mesen.Controls;
|
|
|
|
public class MesenNumericUpDown : NumericUpDown
|
|
{
|
|
protected override Type StyleKeyOverride => typeof(NumericUpDown);
|
|
|
|
protected override void OnTextChanged(string? oldValue, string? newValue)
|
|
{
|
|
if(newValue == null || newValue == "") {
|
|
//Prevent displaying invalid cast error/breaking the layout when user clears the content of the control
|
|
Text = "0";
|
|
}
|
|
base.OnTextChanged(oldValue, newValue);
|
|
}
|
|
} |