c# - WPF: Execute a Command Binding in a search field when pressing the enter button -


I have a search field with a search button in which a command is binding. It works great, but if I enter the keyboard, how can I use the same command binding for text fields? The examples I have seen are using all the code with the KeyDown event handler, is this a great way to build this task only with xaml and command binding?

You can use the IsDefault property of the button:

  & Lt; Button command = "Search Command" ISDFault = "{Bidding Elementonym = Search Textbox, Path = Iskiboard Focus}" & gt; Search! & Lt; / Button & gt;  

Comments

Popular posts from this blog

MySql variables and php -

php - Laravel - Overriding a resource route into a different route filter group -

url rewriting - How to implement the returnurl like SO in PHP? -