diff --git a/UITests/UITests.App/MainPage.xaml b/UITests/UITests.App/MainPage.xaml
index d38db07e3e3..1cd1a25443b 100644
--- a/UITests/UITests.App/MainPage.xaml
+++ b/UITests/UITests.App/MainPage.xaml
@@ -9,11 +9,17 @@
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
+
+
+
+
-
-
-
+
+
+
+
+
diff --git a/UITests/UITests.App/MainPage.xaml.cs b/UITests/UITests.App/MainPage.xaml.cs
index b44c1291f46..f1a6fdb2de2 100644
--- a/UITests/UITests.App/MainPage.xaml.cs
+++ b/UITests/UITests.App/MainPage.xaml.cs
@@ -2,6 +2,9 @@
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
+using UITests.App.Pages;
+using Windows.UI.Xaml;
+
namespace UITests.App
{
public sealed partial class MainPage
@@ -11,9 +14,14 @@ public MainPage()
InitializeComponent();
}
- private void Button_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
+ private void btnSimple_Click(object sender, RoutedEventArgs e)
+ {
+ navigationFrame.Navigate(typeof(SimpleTest));
+ }
+
+ private void btnTextBoxMask_Click(object sender, RoutedEventArgs e)
{
- textBlock.Text = "Clicked";
+ navigationFrame.Navigate(typeof(TextBoxMask));
}
}
}
diff --git a/UITests/UITests.App/Pages/SimpleTest.xaml b/UITests/UITests.App/Pages/SimpleTest.xaml
new file mode 100644
index 00000000000..d9109de6bc7
--- /dev/null
+++ b/UITests/UITests.App/Pages/SimpleTest.xaml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
diff --git a/UITests/UITests.App/Pages/SimpleTest.xaml.cs b/UITests/UITests.App/Pages/SimpleTest.xaml.cs
new file mode 100644
index 00000000000..cd9534b5e8c
--- /dev/null
+++ b/UITests/UITests.App/Pages/SimpleTest.xaml.cs
@@ -0,0 +1,39 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace UITests.App.Pages
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class SimpleTest : Page
+ {
+ public SimpleTest()
+ {
+ this.InitializeComponent();
+ }
+
+ private void Button_Click(object sender, RoutedEventArgs e)
+ {
+ textBlock.Text = "Clicked";
+ }
+ }
+}
diff --git a/UITests/UITests.App/Pages/TextBoxMask.xaml b/UITests/UITests.App/Pages/TextBoxMask.xaml
new file mode 100644
index 00000000000..407adb984aa
--- /dev/null
+++ b/UITests/UITests.App/Pages/TextBoxMask.xaml
@@ -0,0 +1,52 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/UITests/UITests.App/Pages/TextBoxMask.xaml.cs b/UITests/UITests.App/Pages/TextBoxMask.xaml.cs
new file mode 100644
index 00000000000..859f1062c87
--- /dev/null
+++ b/UITests/UITests.App/Pages/TextBoxMask.xaml.cs
@@ -0,0 +1,62 @@
+// Licensed to the .NET Foundation under one or more agreements.
+// The .NET Foundation licenses this file to you under the MIT license.
+// See the LICENSE file in the project root for more information.
+
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.IO;
+using System.Linq;
+using System.Runtime.InteropServices.WindowsRuntime;
+using System.Windows.Input;
+using Windows.Foundation;
+using Windows.Foundation.Collections;
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+using Windows.UI.Xaml.Controls.Primitives;
+using Windows.UI.Xaml.Data;
+using Windows.UI.Xaml.Input;
+using Windows.UI.Xaml.Media;
+using Windows.UI.Xaml.Navigation;
+
+// The Blank Page item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238
+
+namespace UITests.App.Pages
+{
+ ///
+ /// An empty page that can be used on its own or navigated to within a Frame.
+ ///
+ public sealed partial class TextBoxMask : Page, INotifyPropertyChanged
+ {
+ private const string INITIAL_VALUE = "12:50:59";
+ private const string NEW_VALUE = "00:00:00";
+
+ private string _value = INITIAL_VALUE;
+
+ public string InitialValue => INITIAL_VALUE;
+
+ public string NewValue => NEW_VALUE;
+
+ public string Value
+ {
+ get => _value;
+ set
+ {
+ _value = value;
+ PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(Value)));
+ }
+ }
+
+ public TextBoxMask()
+ {
+ this.InitializeComponent();
+ }
+
+ public event PropertyChangedEventHandler PropertyChanged;
+
+ private void ChangeButton_Click(object sender, RoutedEventArgs e)
+ {
+ Value = NEW_VALUE;
+ }
+ }
+}
diff --git a/UITests/UITests.App/UITests.App.csproj b/UITests/UITests.App/UITests.App.csproj
index 48fc8de5936..0d6dcdbacf8 100644
--- a/UITests/UITests.App/UITests.App.csproj
+++ b/UITests/UITests.App/UITests.App.csproj
@@ -133,6 +133,12 @@
MainPage.xaml
+
+ SimpleTest.xaml
+
+
+ TextBoxMask.xaml
+
@@ -159,6 +165,14 @@
MSBuild:Compile
Designer
+
+ Designer
+ MSBuild:Compile
+
+
+ Designer
+ MSBuild:Compile
+
@@ -252,4 +266,4 @@
-->
-
+
\ No newline at end of file
diff --git a/UITests/UITests.Tests.Shared/Tests.cs b/UITests/UITests.Tests.Shared/Tests.cs
index bba017d8c9e..8e64002b9e6 100644
--- a/UITests/UITests.Tests.Shared/Tests.cs
+++ b/UITests/UITests.Tests.Shared/Tests.cs
@@ -98,8 +98,10 @@ public void TestCleanup()
}
[TestMethod]
- public void SimpleLaunchTest()
+ public void SimpleTest()
{
+ OpenTest("Simple");
+
var button = new Button(FindElement.ByName("Click Me"));
var textBlock = new TextBlock(FindElement.ById("textBlock"));
@@ -113,5 +115,33 @@ public void SimpleLaunchTest()
Verify.AreEqual("Clicked", textBlock.GetText());
}
+
+ [TestMethod]
+ public void TestTextBoxMaskBinding_Property()
+ {
+ OpenTest("TextBox Mask");
+
+ var initialValue = FindElement.ById("InitialValueTextBlock").GetText();
+ var textBox = FindElement.ById("TextBox");
+
+ Verify.AreEqual(initialValue, textBox.GetText());
+
+ var changeButton = FindElement.ById