-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Testing] Refactoring Feature Matrix UITest Cases for Entry Control #34632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
76a24c7
1ff88ec
1d62db3
73d5fd6
4641279
f3af098
93f6a21
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,7 +23,12 @@ private void TextColorButton_Clicked(object sender, EventArgs e) | |
| { | ||
| if (sender is Button button) | ||
| { | ||
| _viewModel.TextColor = button.BackgroundColor; | ||
| _viewModel.TextColor = button.AutomationId switch | ||
| { | ||
| "TextColorRed" => Colors.Red, | ||
| "TextColorBlue" => Colors.Blue, | ||
| _ => null | ||
| }; | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -47,7 +52,12 @@ private void PlaceholderColorButton_Clicked(object sender, EventArgs e) | |
| { | ||
| if (sender is Button button) | ||
| { | ||
| _viewModel.PlaceholderColor = button.BackgroundColor; | ||
| _viewModel.PlaceholderColor = button.AutomationId switch | ||
| { | ||
| "PlaceholderColorRed" => Colors.Red, | ||
| "PlaceholderColorBlue" => Colors.Blue, | ||
| _ => null | ||
| }; | ||
| } | ||
| } | ||
|
|
||
|
|
@@ -121,7 +131,7 @@ private void ReturnTypeButton_Clicked(object sender, EventArgs e) | |
| } | ||
| } | ||
|
|
||
| private void MaxLengthButton_Clicked(object sender, EventArgs e) | ||
| private void MaxLengthEntry_TextChanged(object sender, TextChangedEventArgs e) | ||
| { | ||
| if (int.TryParse(MaxLengthEntry.Text, out int maxLength)) | ||
| { | ||
|
|
@@ -256,19 +266,54 @@ private void TextTransform_CheckedChanged(object sender, CheckedChangedEventArgs | |
| } | ||
| } | ||
|
|
||
| private void FontAttributes_CheckedChanged(object sender, CheckedChangedEventArgs e) | ||
| private void BackgroundColorButton_Clicked(object sender, EventArgs e) | ||
| { | ||
| if (sender is Button button) | ||
| { | ||
| _viewModel.BackgroundColor = button.AutomationId switch | ||
| { | ||
| "BackgroundColorYellow" => Colors.Yellow, | ||
| "BackgroundColorLightBlue" => Colors.LightBlue, | ||
| _ => null | ||
| }; | ||
| } | ||
| } | ||
|
|
||
| private void WidthRequestEntry_TextChanged(object sender, TextChangedEventArgs e) | ||
| { | ||
| if (sender == FontAttributesBold) | ||
| if (double.TryParse(e.NewTextValue, out double widthRequest)) | ||
| { | ||
| _viewModel.FontAttributes = FontAttributes.Bold; | ||
| _viewModel.WidthRequest = widthRequest; | ||
| } | ||
| else if (sender == FontAttributesNone) | ||
| } | ||
|
Comment on lines
+282
to
+288
|
||
|
|
||
| private void OpacityEntry_TextChanged(object sender, TextChangedEventArgs e) | ||
| { | ||
| if (double.TryParse(e.NewTextValue, out double opacity)) | ||
| { | ||
| _viewModel.FontAttributes = FontAttributes.None; | ||
| opacity = Math.Clamp(opacity, 0.0, 1.0); | ||
| _viewModel.Opacity = opacity; | ||
| } | ||
| else if (sender == FontAttributesItalic) | ||
| } | ||
|
|
||
| private void HeightRequestEntry_TextChanged(object sender, TextChangedEventArgs e) | ||
| { | ||
| if (double.TryParse(e.NewTextValue, out double heightRequest)) | ||
| { | ||
| _viewModel.FontAttributes = FontAttributes.Italic; | ||
| _viewModel.HeightRequest = heightRequest; | ||
| } | ||
| } | ||
|
Comment on lines
+299
to
305
|
||
| } | ||
|
|
||
| private void FontAttributesCheckBox_CheckedChanged(object sender, CheckedChangedEventArgs e) | ||
| { | ||
| var attributes = FontAttributes.None; | ||
|
|
||
| if (FontAttributesBoldCheckBox.IsChecked) | ||
| attributes |= FontAttributes.Bold; | ||
|
|
||
| if (FontAttributesItalicCheckBox.IsChecked) | ||
| attributes |= FontAttributes.Italic; | ||
|
|
||
| _viewModel.FontAttributes = attributes; | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CursorPositionEntry is wired to TextChanged but the handler is named CursorPositionButton_Clicked (and takes EventArgs). Renaming the handler (and parameter type) to reflect it’s a TextChanged handler would make the intent clearer and reduce confusion when navigating the code.