Skip to content

Commit

Permalink
Merge pull request #2586 from cwensley/curtis/wpf-cancel-text-changing
Browse files Browse the repository at this point in the history
Wpf: Fix dispatcher error when cancelling a TextBox TextChanging event
  • Loading branch information
cwensley authored Nov 29, 2023
2 parents 015f78b + d0b0595 commit 1c59032
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Eto.Wpf/Forms/Controls/TextBoxHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,11 @@ public string Text
var args = new TextChangingEventArgs(oldText, newText, false);
Callback.OnTextChanging(Widget, args);
if (args.Cancel)
{
TextBox.EndChange();
return;
}

var needsTextChanged = TextBox.Text == newText;

// Improve performance when setting text often
Expand Down

0 comments on commit 1c59032

Please sign in to comment.