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

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -