33 lines
830 B
C#
33 lines
830 B
C#
using System.Text.RegularExpressions;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Input;
|
|
|
|
namespace Common
|
|
{
|
|
/// <summary>
|
|
/// Interaktionslogik für AnalogValue.xaml
|
|
/// </summary>
|
|
public partial class ParamControlFloat : UserControl
|
|
{
|
|
public bool IsReadonly { get; set; }
|
|
|
|
public ParamControlFloat()
|
|
{
|
|
InitializeComponent();
|
|
// Unloaded += OnUnloaded;
|
|
}
|
|
|
|
private void OnUnloaded(object? sender, EventArgs e)
|
|
{
|
|
var disposable = DataContext as IDisposable;
|
|
disposable?.Dispose();
|
|
}
|
|
|
|
private void NumberValidation(object sender, TextCompositionEventArgs e)
|
|
{
|
|
Regex regex = new("^[-+]?[0-9]*,?[0-9]+$");
|
|
e.Handled = regex.IsMatch(e.Text);
|
|
}
|
|
}
|
|
}
|