-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Clear TextBox Button doesn't seem to be fully working #1764
Comments
@CobyBorel which version you are using? i can't reproduce this with the latest github source. |
@punker76 |
I was able to reproduce this issue. The problem is, that private static void ButtonCommandOrClearTextChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var textbox = d as TextBox;
if (textbox != null)
{
// only one loaded event
textbox.Loaded -= TextBoxLoaded;
textbox.Loaded += TextBoxLoaded;
if (textbox.IsLoaded) {
TextBoxLoaded(textbox, new RoutedEventArgs());
}
}
//... |
@thoemmi seems like we should do this always and for the password and combo box too |
That's what I think too. Should I create a PR? |
@thoemmi jepp 👍 |
Subscribe to clear button even if control is already loaded. Fixes #1764
In the Demo App, TextExamples.xaml line 41, the 3rd textbox
Changed to this:
When running the app I get this behaviour.
Change tab to "text"
Enter "asdf" into the 3rd textbox
ClearTextButton appears
Click ClearTextButton and nothing happens
Tab to another tab "dates" and tab back "text"
Click ClearTextButton and text clears
enter text "asdf" into the 3rd textbox
ClearTextButton appears
Click ClearTextButton and text clears
Tab to another tab "dates" and tab back "text"
enter text into the 3rd textbox "asdf"
ClearTextButton appears
Click ClearTextButton and nothing happens
I'm thinking something is out of synce or not being updated.
I'm experiencing the same thing in my app as well when bound to an object.
Thanks for any help or advise.
The text was updated successfully, but these errors were encountered: