diff --git a/SourceCode/SharedResources/Panuon.WPF.UI/Enums/InputLimits.cs b/SourceCode/SharedResources/Panuon.WPF.UI/Enums/InputLimits.cs index 8ea35723..a76c0052 100644 --- a/SourceCode/SharedResources/Panuon.WPF.UI/Enums/InputLimits.cs +++ b/SourceCode/SharedResources/Panuon.WPF.UI/Enums/InputLimits.cs @@ -19,5 +19,7 @@ public enum InputLimits MultipleSpaces = 512, Dash = 1024, Underline = 2048, + Comma = 4096, + MultipleCommas = 8192, } } diff --git a/SourceCode/SharedResources/Panuon.WPF.UI/Helpers/TextBoxHelper.cs b/SourceCode/SharedResources/Panuon.WPF.UI/Helpers/TextBoxHelper.cs index 5d921584..6971c40a 100644 --- a/SourceCode/SharedResources/Panuon.WPF.UI/Helpers/TextBoxHelper.cs +++ b/SourceCode/SharedResources/Panuon.WPF.UI/Helpers/TextBoxHelper.cs @@ -444,16 +444,20 @@ private static void TextBox_PreviewTextInput(object sender, TextCompositionEvent && inputChar >= 65 && inputChar <= 90) || (inputLimit.HasFlag(InputLimits.Point) && inputChar == '.' && !text.Contains(".")) || - (inputLimit.HasFlag(InputLimits.At) - && inputChar == '@' && !text.Contains("@")) || (inputLimit.HasFlag(InputLimits.MultiplePoints) && inputChar == '.') || + (inputLimit.HasFlag(InputLimits.At) + && inputChar == '@' && !text.Contains("@")) || (inputLimit.HasFlag(InputLimits.MultipleAts) && inputChar == '@') || - (inputLimit.HasFlag(InputLimits.Dash) + (inputLimit.HasFlag(InputLimits.Dash) && inputChar == '-') || - (inputLimit.HasFlag(InputLimits.Underline) - && inputChar == '_')) + (inputLimit.HasFlag(InputLimits.Underline) + && inputChar == '_') || + (inputLimit.HasFlag(InputLimits.Comma) + && inputChar == ',' && !text.Contains(",")) || + (inputLimit.HasFlag(InputLimits.MultipleCommas) + && inputChar == ',') ) { text += inputChar; }