Re: How to send event from view to VM?
Do you mean if you can have more than one Command bound to a given event?
Re: How to send event from view to VM?
My game logic will process TouchDown/TouchUp event, so I think there should be both two commands for MVVM, am I wrong?
At present, then EventToCommand can be used only once, so I implement a UserControl, and treat both TouchDown and TouchUp as ButtonAction event, but pass deffirent param, then convert to command and I can use one command send 2 actions.
At present, then EventToCommand can be used only once, so I implement a UserControl, and treat both TouchDown and TouchUp as ButtonAction event, but pass deffirent param, then convert to command and I can use one command send 2 actions.
Re: How to send event from view to VM?
Hi,
Yes, you are right, that is a limitation of the EventToCommand class. We are working on an new system that will allow you to bind multiple events to commands, with a syntax like this:
Yes, you are right, that is a limitation of the EventToCommand class. We are working on an new system that will allow you to bind multiple events to commands, with a syntax like this:
Code: Select all
<ListBox ...>
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding SelectedItemChangedCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</ListBox>
Who is online
Users browsing this forum: Bing [Bot] and 2 guests