-
Notifications
You must be signed in to change notification settings - Fork 762
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Implement TextBox.Select, TextBox.SelectAll on all platforms
- Loading branch information
1 parent
60d4a34
commit b0f7646
Showing
15 changed files
with
149 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/TextBox/TextBox_Selection.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<UserControl | ||
x:Class="UITests.Shared.Windows_UI_Xaml_Controls.TextBoxTests.TextBox_Selection" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:local="using:UITests.Windows_UI_Xaml_Controls.TextBox" | ||
xmlns:controls="using:Microsoft.UI.Xaml.Controls" | ||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
mc:Ignorable="d" | ||
d:DesignHeight="300" | ||
d:DesignWidth="400"> | ||
|
||
<StackPanel> | ||
<controls:NumberBox x:Name="startNumber" PlaceholderText="Start" /> | ||
<controls:NumberBox x:Name="lengthNumber" PlaceholderText="Length" /> | ||
<TextBox x:Name="myTextBox" /> | ||
<Button Click="Select_OnClick" Content="Select"></Button> | ||
<Button Click="SelectAll_OnClick" Content="Select all"></Button> | ||
</StackPanel> | ||
</UserControl> |
28 changes: 28 additions & 0 deletions
28
src/SamplesApp/UITests.Shared/Windows_UI_Xaml_Controls/TextBox/TextBox_Selection.xaml.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
using Uno.UI.Samples.Controls; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
using static Uno.UI.FeatureConfiguration; | ||
|
||
|
||
namespace UITests.Shared.Windows_UI_Xaml_Controls.TextBoxTests | ||
{ | ||
[Sample("TextBox")] | ||
public sealed partial class TextBox_Selection : UserControl | ||
{ | ||
public TextBox_Selection() | ||
{ | ||
this.InitializeComponent(); | ||
} | ||
private void Select_OnClick(object sender, RoutedEventArgs args) | ||
{ | ||
myTextBox.Focus(FocusState.Programmatic); | ||
myTextBox.Select((int)startNumber.Value, (int)lengthNumber.Value); | ||
} | ||
|
||
private void SelectAll_OnClick(object sender, RoutedEventArgs args) | ||
{ | ||
myTextBox.Focus(FocusState.Programmatic); | ||
myTextBox.SelectAll(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters