Skip to content

Commit e15cb9e

Browse files
committed
Renamed mask placeholder property
1 parent 274bcf7 commit e15cb9e

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/TextBoxMask/TextBoxMask.bind

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141

4242
<TextBox Grid.Row="1"
4343
ui:TextBoxExtensions.Mask="+1999-9999"
44-
ui:TextBoxExtensions.MaskPlaceholderCharacter=" "
44+
ui:TextBoxExtensions.MaskPlaceholder=" "
4545
Header="Text box with Mask +1999-9999 and placeHolder as space (placeholder represents the characters the user can change on runtime)"
4646
HeaderTemplate="{StaticResource HeaderTemplate}"
4747
Style="{StaticResource MaskedTextBoxStyle}" />

Microsoft.Toolkit.Uwp.SampleApp/SamplePages/TextBoxMask/TextBoxMaskPage.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111
<TextBox ui:TextBoxExtensions.Mask="9a9a--a9a*"/>
1212

1313
<TextBox ui:TextBoxExtensions.Mask="+1999-9999"
14-
ui:TextBoxExtensions.MaskPlaceholderCharacter=" " />
14+
ui:TextBoxExtensions.MaskPlaceholder=" " />
1515

1616
<TextBox ui:TextBoxExtensions.Mask="+\964 799 999 9999"
17-
ui:TextBoxExtensions.MaskPlaceholderCharacter=" " />
17+
ui:TextBoxExtensions.MaskPlaceholder=" " />
1818

1919
<TextBox ui:TextBoxExtensions.CustomMask="5:[1-5],c:[a-c]"
2020
ui:TextBoxExtensions.Mask="a5c-5c*9" />

Microsoft.Toolkit.Uwp.UI/Extensions/TextBox/TextBoxExtensions.Mask.Internals.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ private static void Textbox_Loaded(object sender, RoutedEventArgs e)
4949
return;
5050
}
5151

52-
var placeHolderValue = textbox.GetValue(MaskPlaceholderCharacterProperty) as string;
52+
var placeHolderValue = textbox.GetValue(MaskPlaceholderProperty) as string;
5353
if (string.IsNullOrEmpty(placeHolderValue))
5454
{
5555
throw new ArgumentException("PlaceHolder can't be null or empty");
@@ -152,7 +152,7 @@ private static void Textbox_GotFocus_Mask(object sender, RoutedEventArgs e)
152152
{
153153
var textbox = (TextBox)sender;
154154
var mask = textbox?.GetValue(MaskProperty) as string;
155-
var placeHolderValue = textbox?.GetValue(MaskPlaceholderCharacterProperty) as string;
155+
var placeHolderValue = textbox?.GetValue(MaskPlaceholderProperty) as string;
156156
var representationDictionary = textbox?.GetValue(RepresentationDictionaryProperty) as Dictionary<char, string>;
157157
if (string.IsNullOrWhiteSpace(mask) ||
158158
representationDictionary == null ||
@@ -194,7 +194,7 @@ private static async void Textbox_Paste(object sender, TextControlPasteEventArgs
194194
var textbox = (TextBox)sender;
195195
var mask = textbox.GetValue(MaskProperty) as string;
196196
var representationDictionary = textbox?.GetValue(RepresentationDictionaryProperty) as Dictionary<char, string>;
197-
var placeHolderValue = textbox.GetValue(MaskPlaceholderCharacterProperty) as string;
197+
var placeHolderValue = textbox.GetValue(MaskPlaceholderProperty) as string;
198198
if (string.IsNullOrWhiteSpace(mask) ||
199199
representationDictionary == null ||
200200
string.IsNullOrEmpty(placeHolderValue))
@@ -262,7 +262,7 @@ private static void Textbox_TextChanging(TextBox textbox, TextBoxTextChangingEve
262262
var escapedChars = textbox.GetValue(EscapedCharacterIndicesProperty) as List<int>;
263263

264264
var representationDictionary = textbox.GetValue(RepresentationDictionaryProperty) as Dictionary<char, string>;
265-
var placeHolderValue = textbox?.GetValue(MaskPlaceholderCharacterProperty) as string;
265+
var placeHolderValue = textbox?.GetValue(MaskPlaceholderProperty) as string;
266266
var oldText = textbox.GetValue(OldTextProperty) as string;
267267
var oldSelectionStart = (int)textbox.GetValue(OldSelectionStartProperty);
268268
var oldSelectionLength = (int)textbox.GetValue(OldSelectionLengthProperty);

Microsoft.Toolkit.Uwp.UI/Extensions/TextBox/TextBoxExtensions.Mask.Properties.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public static partial class TextBoxExtensions
1919
/// <summary>
2020
/// Represents the mask place holder which represents the variable character that the user can edit in the textbox
2121
/// </summary>
22-
public static readonly DependencyProperty MaskPlaceholderCharacterProperty = DependencyProperty.RegisterAttached("MaskPlaceholderCharacter", typeof(string), typeof(TextBoxExtensions), new PropertyMetadata(DefaultPlaceHolder, InitTextBoxMask));
22+
public static readonly DependencyProperty MaskPlaceholderProperty = DependencyProperty.RegisterAttached("MaskPlaceholder", typeof(string), typeof(TextBoxExtensions), new PropertyMetadata(DefaultPlaceHolder, InitTextBoxMask));
2323

2424
/// <summary>
2525
/// Represents the custom mask that the user can create to add his own variable characters based on regex expression
@@ -60,19 +60,19 @@ public static void SetMask(TextBox obj, string value)
6060
/// </summary>
6161
/// <param name="obj">TextBox control</param>
6262
/// <returns>placeholder value</returns>
63-
public static string GetMaskPlaceholderCharacter(TextBox obj)
63+
public static string GetMaskPlaceholder(TextBox obj)
6464
{
65-
return (string)obj.GetValue(MaskPlaceholderCharacterProperty);
65+
return (string)obj.GetValue(MaskPlaceholderProperty);
6666
}
6767

6868
/// <summary>
6969
/// Sets placeholder property which represents the variable character that the user can edit in the textbox
7070
/// </summary>
7171
/// <param name="obj">TextBox Control</param>
7272
/// <param name="value">placeholder Value</param>
73-
public static void SetMaskPlaceholderCharacter(TextBox obj, string value)
73+
public static void SetMaskPlaceholder(TextBox obj, string value)
7474
{
75-
obj.SetValue(MaskPlaceholderCharacterProperty, value);
75+
obj.SetValue(MaskPlaceholderProperty, value);
7676
}
7777

7878
/// <summary>

0 commit comments

Comments
 (0)