Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@erikvilima
Copy link
Contributor

GitHub Issue: #1286

PR Type

What kind of change does this PR introduce?

  • Bugfix

Description

PR Checklist

Please check if your PR fulfills the following requirements:

Other information

Internal Issue (If applicable):

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://salmon-rock-0cfebe70f-1288.eastus2.azurestaticapps.net


private static void OnIconChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (d is TextBox textBox)
Copy link
Contributor

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?

Copy link
Collaborator

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

Copy link
Contributor Author

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?

Copy link
Contributor Author

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("...")

private static void WarnNotSupportedProperty(DependencyObject d, string propertyName)
{
if (d is not TextBox)
{
d.Log().LogWarning($"Warning: {propertyName} is only supported on TextBox controls.");
}
}

@github-actions
Copy link

Azure Static Web Apps: Your stage site is ready! Visit it here: https://salmon-rock-0cfebe70f-1288.eastus2.azurestaticapps.net

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants