-
Notifications
You must be signed in to change notification settings - Fork 32
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
chore: Add ControlExtensions.Icon support to TextBox #1288
base: master
Are you sure you want to change the base?
Conversation
Azure Static Web Apps: Your stage site is ready! Visit it here: https://salmon-rock-0cfebe70f-1288.eastus2.azurestaticapps.net |
@@ -222,6 +222,14 @@ public static class ControlExtensions | |||
|
|||
#endregion | |||
|
|||
private static void OnIconChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) | |||
{ | |||
if (d is TextBox textBox) |
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.
why constraint it to TextBox
only? the target property accept any Control
as recipient?
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.
But only TextBox supports LeadingIcon/Command/IsVisible, right?
In that case we should probably spit out a warning if someone is trying to set those properties on things other than a TextBox
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.
Should I use System.Diagnostics.Debug.WriteLine("...")
for the warning?
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.
I used d.Log().LogWarning("...")
Uno.Themes/src/library/Uno.Material/Extensions/ControlExtensions.cs
Lines 247 to 253 in fcbeafc
private static void WarnNotSupportedProperty(DependencyObject d, string propertyName) | |
{ | |
if (d is not TextBox) | |
{ | |
d.Log().LogWarning($"Warning: {propertyName} is only supported on TextBox controls."); | |
} | |
} |
Azure Static Web Apps: Your stage site is ready! Visit it here: https://salmon-rock-0cfebe70f-1288.eastus2.azurestaticapps.net |
GitHub Issue: #1286
PR Type
What kind of change does this PR introduce?
Description
PR Checklist
Please check if your PR fulfills the following requirements:
Other information
Internal Issue (If applicable):