Answer the question
In order to leave comments, you need to log in
How to determine event type in WPF MVVM?
For example, a form button has many events like Click, DoubleClick, MouseLeave, etc. In the MVVM approach, you cannot use events, everything is built on commands. But as I understand it, a command for a button is just a click, for a textbox it is a change in content. How to define other events for teams?
Answer the question
In order to leave comments, you need to log in
I did not understand what you asked and why the textbox has a command to change the content.
There are actions in the application that are conveniently represented in the viewmodel as commands, and for which controls are usually used a la a button (activated / clicked - launched a command). If actions that are convenient in the view model are represented by properties, which are then tied to controls (for example, changing the contents of a text box). I think you need to read more about bindings. Well, or rephrase the question to make it clear.
As a rule, in the MVVM framework there is an EventToCommand or you need to torture Blend.
It is written in the button under
as
EventToCommand Command="{Binding InitializeCommand}" EventName="Loaded"
. Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question