Skip to content

Commit 52af8cc

Browse files
Fix event subscription mismatch which also fixes reported issue
1 parent 806146b commit 52af8cc

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/MaterialDesignThemes.Wpf/UpDownBase.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ public override void OnApplyTemplate()
201201
if (_decreaseButton != null)
202202
_decreaseButton.Click -= DecreaseButtonOnClick;
203203
if (_textBoxField != null)
204-
_textBoxField.TextChanged -= OnTextBoxFocusLost;
204+
_textBoxField.TextChanged -= OnTextBoxTextChanged;
205205

206206
base.OnApplyTemplate();
207207

@@ -219,13 +219,13 @@ public override void OnApplyTemplate()
219219

220220
if (_textBoxField != null)
221221
{
222-
_textBoxField.LostFocus += OnTextBoxFocusLost;
222+
_textBoxField.TextChanged += OnTextBoxTextChanged;
223223
_textBoxField.Text = Value?.ToString();
224224
}
225225

226226
}
227227

228-
private void OnTextBoxFocusLost(object sender, EventArgs e)
228+
private void OnTextBoxTextChanged(object sender, EventArgs e)
229229
{
230230
if (_textBoxField is { } textBoxField)
231231
{

0 commit comments

Comments
 (0)