private void SearchBox_KeyDown(object sender, KeyRoutedEventArgs e) { if (!(DataContext is WebPageViewModel vm)) { return; } if (e.Key == Windows.System.VirtualKey.Enter) { var be = SearchTextBox.GetBindingExpression(TextBox.TextProperty); be.UpdateSource(); vm.SearchCommand?.Execute(null); } }
private void SearchTextBox_OnTextChanged(object sender, TextChangedEventArgs e) { BindingExpression be = SearchTextBox.GetBindingExpression(TextBox.TextProperty); be.UpdateSource(); }