mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 11:56:30 +00:00
Display conditions - Loosened up type rules for dynamic comparisons
Display conditions - Improved static value input and added support for int and double
This commit is contained in:
1 parent
68b9a4b933
commit
f617a6461a
21 files changed
+197
-172
No files matched your search
@@ -0,0 +1,20 @@
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Windows.Input;
|
||||
using Artemis.Core.Plugins.Abstract.DataModels.Attributes;
|
||||
using Artemis.UI.Shared.DataModelVisualization;
|
||||
|
||||
namespace Artemis.UI.DataModelVisualization.Input
|
||||
{
|
||||
public class DoubleDataModelInputViewModel : DataModelInputViewModel<double>
|
||||
{
|
||||
public DoubleDataModelInputViewModel(DataModelPropertyAttribute description, double initialValue) : base(description, initialValue)
|
||||
{
|
||||
}
|
||||
|
||||
public void NumberValidationTextBox(object sender, TextCompositionEventArgs e)
|
||||
{
|
||||
var regex = new Regex("^[.|,][0-9]+$|^[0-9]*[.|,]{0,1}[0-9]*$");
|
||||
e.Handled = !regex.IsMatch(e.Text);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user