Skip to content
This repository was archived by the owner on Sep 20, 2021. It is now read-only.
This repository was archived by the owner on Sep 20, 2021. It is now read-only.

EventTo Command: difference (advantages/ disadvantages). Can't see. #87

Open
@Wobeam

Description

@Wobeam

Hello everyone,
Could anyone tell me about advantages od EventToCommand in contrast with classic InvokeCommandAction. Simple from the point of my experience I can't see an advantage.
Both are working. What was a reason of creation EventToCommand?

Usage EventToCommand in button

 <i:Interaction.Triggers>
                    <i:EventTrigger EventName="PreviewMouseLeftButtonDown">
                        <command:EventToCommand Command="{Binding FillwithCustomColour_command1}" />
                    </i:EventTrigger>
                    <i:EventTrigger EventName="PreviewMouseLeftButtonUp">
                        <command:EventToCommand Command="{Binding FillwithDefaultColour_command1}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>

Usage classic InvokeCommandAction in button

 <i:Interaction.Triggers>
                    <i:EventTrigger EventName="PreviewMouseLeftButtonDown">
                        <i:InvokeCommandAction Command="{Binding FillwithCustomColour_command2}" />
                    </i:EventTrigger>
                    <i:EventTrigger EventName="PreviewMouseLeftButtonUp">
                        <i:InvokeCommandAction Command="{Binding FillwithDefaultColour_command2}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions