GotFocus event for TextBox in Caliburn Micro?

I use Calibrun Micro and WPF, I have a textBox, and when I get the focus, I want to call the method in the ViewModel and the same when it leaves LostFocus.

+4
source share
1 answer

You can use LostFocus syntax to connect to the GotFocus and LostFocus

The following code will call GotFocusMethod and LostFocusMethod on your view model:

 <TextBox cal:Message.Attach="[Event GotFocus] = [Action GotFocusMethod]; [Event LostFocus] = [Action LostFocusMethod]" /> 

Note. Remember to separate actions with a semicolon ; when you announce a few actions.

+11
source

Source: https://habr.com/ru/post/1440979/


All Articles