I am using Calibrun Micro and WPF, I have a textBox and when i recieves a focus I want to call a method in ViewModel and same when it leaves LostFocus.
You can use the Message.Attach syntax to hook on the GotFocus
and LostFocus
event
The following code will call the GotFocusMethod
and LostFocusMethod
on your viewmodel:
<TextBox cal:Message.Attach="[Event GotFocus] = [Action GotFocusMethod];
[Event LostFocus] = [Action LostFocusMethod]" />
Note: don't forget the separating the actions with a semicolon ;
when you declare multiple actions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With