Office 2016 Theme MaskedInputControl. IsReadOnly="True" IsClearButtonVisible="False" Space for clear button is reserved which is unexpected. Button should be hidden and no space should be reserved like in, for example Office_Black Theme.
For example the following culture: this.currency.Culture = new System.Globalization.CultureInfo("prs-AF"); has this.currency.Culture.NumberFormat {System.Globalization.NumberFormatInfo} CurrencyDecimalDigits: 2 ===> CurrencyDecimalSeparator: "." ===> CurrencyGroupSeparator: "," CurrencyGroupSizes: {int[1]} CurrencyNegativePattern: 3 CurrencyPositivePattern: 0 CurrencySymbol: "؋" DigitSubstitution: NativeNational IsReadOnly: false NaNSymbol: "ناعدد" NativeDigits: {string[10]} NegativeInfinitySymbol: "-∞" NegativeSign: "-" NumberDecimalDigits: 2 ===> NumberDecimalSeparator: "," ===> NumberGroupSeparator: "." NumberGroupSizes: {int[1]} NumberNegativePattern: 3 PerMilleSymbol: "‰" PercentDecimalDigits: 2 PercentDecimalSeparator: "," PercentGroupSeparator: "." PercentGroupSizes: {int[1]} PercentNegativePattern: 1 PercentPositivePattern: 1 PercentSymbol: "%" PositiveInfinitySymbol: "∞" PositiveSign: "+" Typing 12345 in the control produces Value 123 which is wrong. Parsing becomes wrong after the group separator kicks in.
For example, the Mask "hh:mm:ss.ff" will render the value properly. But if you change the value at runtime (by pressing a key on the keyboard), the milliseconds will be re-parsed and will be displayed wrongly. For example, if you have the value "12:13:14.50" and you go to the ".50" part (between the decimal separator and the number 5). And then press 3, the milliseconds will change to ".03". To work this around you can create a custom masked input control and override its CoerceTextOverride() method. There you can implement some logic that replaces the wrong milliseconds text. Here is an example in code: public class CustomMaskedDateTimeInput : RadMaskedDateTimeInput { protected override string CoerceTextOverride(ref int selectionStart) { var text = base.CoerceTextOverride(ref selectionStart); if (this.Value.HasValue && this.Mask != null && this.Mask.Contains("hh:mm:ss.f")) { int millisecondsAllowedLength = GetAllowedMillisecondsLength(this.Mask); // example: .ff means that there are 2 allowed millisecond chars int millisecondsMaxLength = 3; // max = 999 var milliseconds = this.Value.Value.Millisecond.ToString(); // the original milliseconds give from the value var zeroesCount = millisecondsMaxLength - milliseconds.Length; // how many zeroes should be append before the millseconds string value milliseconds = new string('0', zeroesCount) + milliseconds; // append the zeroes // apply the milliseconds restriction given by the Mask (.ff - two symbols) if (milliseconds.Length > millisecondsAllowedLength) { int charsToRemoveCount = milliseconds.Length - millisecondsAllowedLength; for (int i = 0; i < charsToRemoveCount; i++) { milliseconds = milliseconds.Remove(milliseconds.Length - 1, 1); } } // replace the default parsed millseconds part of the string with the custom milliseconds var millisecondsIndex = text.LastIndexOf(".") + 1; text = text.Remove(millisecondsIndex, millisecondsMaxLength - millisecondsAllowedLength); text = text.Insert(millisecondsIndex, milliseconds); } return text; } private int GetAllowedMillisecondsLength(string mask) { int length = 0; var millisecondsIndex = mask.LastIndexOf(".") + 1; if (millisecondsIndex != -1) { length = mask.Length - millisecondsIndex; } return length; } }
This leads to a wrong value displayed in the masked input. The mask is always coerced to "hh:mm:ss.ff". An additional, 'f' is added to the mask. Probably, this will happen also if you have a single letter on another position in the mask. To work this around you can create a custom masked input control and override its CoerceTextOverride() method. There you can implement some logic that replaces the wrong milliseconds text. Here is an example in code: public class CustomMaskedDateTimeInput : RadMaskedDateTimeInput { protected override string CoerceTextOverride(ref int selectionStart) { var text = base.CoerceTextOverride(ref selectionStart); if (this.Value.HasValue && this.Mask != null && this.Mask.Contains("hh:mm:ss.f")) { int millisecondsAllowedLength = GetAllowedMillisecondsLength(this.Mask); // example: .ff means that there are 2 allowed millisecond chars int millisecondsMaxLength = 3; // max = 999 var milliseconds = this.Value.Value.Millisecond.ToString(); // the original milliseconds give from the value var zeroesCount = millisecondsMaxLength - milliseconds.Length; // how many zeroes should be append before the millseconds string value milliseconds = new string('0', zeroesCount) + milliseconds; // append the zeroes // apply the milliseconds restriction given by the Mask (.ff - two symbols) if (milliseconds.Length > millisecondsAllowedLength) { int charsToRemoveCount = milliseconds.Length - millisecondsAllowedLength; for (int i = 0; i < charsToRemoveCount; i++) { milliseconds = milliseconds.Remove(milliseconds.Length - 1, 1); } } // replace the default parsed millseconds part of the string with the custom milliseconds var millisecondsIndex = text.LastIndexOf(".") + 1; text = text.Remove(millisecondsIndex, millisecondsMaxLength - millisecondsAllowedLength); text = text.Insert(millisecondsIndex, milliseconds); } return text; } private int GetAllowedMillisecondsLength(string mask) { int length = 0; var millisecondsIndex = mask.LastIndexOf(".") + 1; if (millisecondsIndex != -1) { length = mask.Length - millisecondsIndex; } return length; } }
For example: RadMaskedCurrencyInput with Culture="da-DK" and VALUE 12345.67 and Mask=#9.2. In this culture the currency symbol is "kr." In WIndows 8, the NumberFormat.CurrencyPositivePattern is 2 (meaning '$ n'). In Windows 10, this pattern is 3 (n $). So in WIn8, WIn7 or WIn10 but if you change the pattern programmatically to 2. Th result is: Actual: "kr.___.___._kr,12" this is what we see on load and on focus in control. Editing does not change the value. Desired: 'kr. ___._12.345,67' in pattern 2 Control also produces ugly results with pattern 0 and 1. Control seems to work ok with pattern 3: Actual and Desired: '___._12.345,67 kr.' * this could be achieved on Win 8 with change setting or out of the box in Win10. ============== Workaround (if applicable and desired formatting in the specific scenario) Set in code behind: InitializeComponent(); CultureInfo info = new CultureInfo("da-DK"); info.NumberFormat.CurrencyPositivePattern = 3; this.maskInput.Culture = info;
The current workaround is to create a custom control and override the OnTextInput method: public class CustomInput : RadMaskedTextInput { protected override void OnTextInput(TextCompositionEventArgs e) { base.OnTextInput(e); e.Handled = true; } }
This is reproducible in a NoMask scenario.
Japanese input symbols are not correctly displayed. Empty symbols are shown on left of the japanese symbols. Exception occurs when entering n japanese symbols with mask = an. For example when Mask = "a4", 4 symbols entered in MaskedTextInput. This might lead to a crash.
RadMaskedInput with NO-MASK (Mask="") and percentage P0 formatstring has some issues with typing digits. After clearing the value and typing digit, caret moves after the percentage sign and editing is not possible.
MaskedTextInput with Mask="(###)-###-####" and EmptyContent="Type digits" , type a single digit, for example 6 in the control. Value becomes 6 and Text becomes '(6__)-___-____'. Mask is changed runtime to empty string (runtime) and the focus is out of the MaskedInput the control. Value continues to be 6 but Text becomes '6' according to the new MASK. EmptyContent string is shown, although Text is 6. Expected: Text is shown in the control '6'. Same issue in NumericInput and CurrencyInput. ======================================= ======================================= The following workaround could be considered. public class CustomTextInput : RadMaskedTextInput { protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e) { if (e.Property.Name == "Mask") { if (e.NewValue.ToString() == string.Empty) { this.LiteralPositions.Clear(); } } base.OnPropertyChanged(e); } }
Add built in masks for Email, IP, Phone, etc. Add design time support for this.
A possible workaround is to subscribe to the PreviewKeyDown event of the mask then check if the back key is pressed and the whole text is select and set the value to null in order to erase the text of the mask. private void maskTextInput_KeyDown(object sender, KeyEventArgs e) { if (e.Key == Key.Back && this.maskTextInput.SelectionLength == this.maskTextInput.Text.Length) { this.maskTextInput.Value = null; } }
Mask is like "##--##". Current Value is "1234" and you see "12--34" Caret is between 2 and "-". Pressing 3 wiill not move the caret after the digit 3. InputBehavior is set to "Replace"
When the layout of the keyboard is AZERTY the minus key is not working as expected. Available in LIB version 2017.3.1113, it will be also available in the R1 2018 Release.
When we use context menu of the control to paste text and the mask is not focused an ArgumentOutOfRangeException is thrown.
Fix available in LIB Version 2017.3.1009.
Old Name was. "Implement a feature to change the Value property based on the Text property ". However, Value is the primary property for this control and that is why we want clients to use Value property, not two-way binding of the Text property that changes the Value internally. That is why we changed the name of the feature request. Its meaningful and clients will benefit from it. Basically clients want the literals to be included in in the VALUE. And this is meaningful only in TextInput. So new property in RadMaskedTextInput (for ex. IncludeLiteralsInValue) seems fine - Estimate 10. Example Scenario: Mask="##--##--##", User types 123456, Value property becomes "12--34--56" which will have the same value as the Text property. Example Scenario: IP Address SDK demo. Look at its code - there is converter in file and convert methods in ViewModel.cs. Both Value and Text are bound. If Value includes the dots, only 1 converter and 1 2way bingding would do the job with less code.