ListBox上下文菜单未触发wpf mvvm

时间:2016-06-25 13:29:36

标签: c# wpf mvvm contextmenu

我有一个带有上下文菜单的devexpress ListBoxEdit控件。 听到的是我的设计。

<dxe:ListBoxEdit x:Name="lstEventsList"  Grid.Column="1" Grid.Row="3" Tag="{Binding DataContext}" >
                        <mvvm:Interaction.Triggers>
                            <mvvm:EventToCommand EventName="SelectedIndexChanged" Command="{Binding GetReferenceCodeListOnEventSelect}" PassEventArgsToCommand="True" />
                        </mvvm:Interaction.Triggers>

                        <dxe:ListBoxEdit.ContextMenu>
                            <ContextMenu DataContext="{Binding PlacementTarget.Tag, RelativeSource={RelativeSource Self}}">
                                <MenuItem Command="{Binding SyncToMediaDevice}" Header="SYNC"
                                          CommandParameter="{Binding}"/>

                            </ContextMenu>

                        </dxe:ListBoxEdit.ContextMenu>
                    </dxe:ListBoxEdit>

现在问题是菜单上下文命令不起作用。绑定属性是

public ICommand SyncToMediaDevice
    {
        get
        {
            return _syncToMediaDevice;
        }
        set
        {
            _syncToMediaDevice = value;
        }
    }`

请帮助我谢谢。

0 个答案:

没有答案