The CommandManager can be used in 2 ways. Either by binding a default command to one event on the control, or by binding a group commands to several different events

<Button Content="My Button" 
                        cmd:CommandManager.EventName="Click
                        cmd:CommandManager.Command="{Binding MyCommand}"
                        cmd:CommandManager.CommandParameter="My Command Parameter"/>

Or

<Button Content="Change Command">
    <cmd:CommandManager.Commands>
        <cmd:CommandGroup>
            <cmd:CommandBinding EventName="Click"
                                Command="{Binding MyCommand}"
                                CommandParameter="My Command Parameter"/>
            <cmd:CommandBinding EventName="MouseEnter"
                                Command="{Binding MyOtherCommand}"
                                CommandParameter="My Other Command Parameter"/>
        </cmd:CommandGroup>
    </cmd:CommandManager.Commands>
</Button>

Last edited Feb 22, 2010 at 7:51 PM by ZeroKoll, version 4

Comments

No comments yet.