Skip to content

Commit e3c97e6

Browse files
committed
Renamed TextBoxExtensions.PlaceHolder property
1 parent b553bfb commit e3c97e6

File tree

3 files changed

+7
-8
lines changed

3 files changed

+7
-8
lines changed

Microsoft.Toolkit.Uwp.UI/Extensions/TextBox/SurfaceDialOptions.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
using Windows.UI.Input;
66
using Windows.UI.Xaml;
77
using Windows.UI.Xaml.Controls;
8-
using Windows.UI.Xaml.Input;
98

109
namespace Microsoft.Toolkit.Uwp.UI
1110
{

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(PlaceHolderProperty) as string;
52+
var placeHolderValue = textbox.GetValue(MaskPlaceholderCharacterProperty) 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(PlaceHolderProperty) as string;
155+
var placeHolderValue = textbox?.GetValue(MaskPlaceholderCharacterProperty) 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(PlaceHolderProperty) as string;
197+
var placeHolderValue = textbox.GetValue(MaskPlaceholderCharacterProperty) 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(PlaceHolderProperty) as string;
265+
var placeHolderValue = textbox?.GetValue(MaskPlaceholderCharacterProperty) 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: 3 additions & 3 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 PlaceHolderProperty = DependencyProperty.RegisterAttached("PlaceHolder", typeof(string), typeof(TextBoxExtensions), new PropertyMetadata(DefaultPlaceHolder, InitTextBoxMask));
22+
public static readonly DependencyProperty MaskPlaceholderCharacterProperty = DependencyProperty.RegisterAttached("MaskPlaceholderCharacter", 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
@@ -62,7 +62,7 @@ public static void SetMask(TextBox obj, string value)
6262
/// <returns>placeholder value</returns>
6363
public static string GetPlaceHolder(TextBox obj)
6464
{
65-
return (string)obj.GetValue(PlaceHolderProperty);
65+
return (string)obj.GetValue(MaskPlaceholderCharacterProperty);
6666
}
6767

6868
/// <summary>
@@ -72,7 +72,7 @@ public static string GetPlaceHolder(TextBox obj)
7272
/// <param name="value">placeholder Value</param>
7373
public static void SetPlaceHolder(TextBox obj, string value)
7474
{
75-
obj.SetValue(PlaceHolderProperty, value);
75+
obj.SetValue(MaskPlaceholderCharacterProperty, value);
7676
}
7777

7878
/// <summary>

0 commit comments

Comments
 (0)