Closed SuperJMN closed 7 years ago
If there is an event on a control, you can use the EventTriggerBehavior. Then you can use the ChangePropertyAction
What will be the TargetObject if I will use ChangePropertyAction though? It is not a control in the view, a property of the ViewModel is the one that must be changed.
You would set the TargetObject
to the view model, typically with a binding expression TargetObject="{Binding}"
.
Oh, thanks!
Can I set a value in a
ViewModel
reacting to an Event in the View?For instance, when a
WebView
control starts loading content, theContentLoading
event is invoked. When it has finished loading the content, theLoadCompleted
event is invoked.I would like to have a property in my ViewModel that is set to true/false when those events are raised. For example, a IsLoading property.
Then, I could show a ProgressRing when appropriate.