Button EnterKeyBehavior - set e.Handled to true
This commit is contained in:
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user