Button EnterKeyBehavior - set e.Handled to true

This commit is contained in:
John Colvin committed 2019-01-02 16:59:04 -06:00
1 parent a72780851d
commit 6e6168fba2
1 file changed
+4 -1
@@ -59,8 +59,10 @@ namespace mbts.ui {
{
EnterKeyBehavior.Commit,
(s, e) => {
if (e.Key == Key.Enter)
if (e.Key == Key.Enter) {
BindingOperations.GetBindingExpression(s as DependencyObject, TextBox.TextProperty)?.UpdateSource();
e.Handled = true;
}
}
},
{
@@ -69,6 +71,7 @@ namespace mbts.ui {
if (e.Key == Key.Enter) {
BindingOperations.GetBindingExpression(s as DependencyObject, TextBox.TextProperty)?.UpdateSource();
Keyboard.ClearFocus();
e.Handled = true;
}
}
}