如何使用 AttachedCommandBehavior 将多个事件绑定到 setter 样式?

问题描述

我需要将多个命令绑定到 xamdatapresenter 的记录。

<igDP:FieldLayoutSettings.DataRecordPresenterStyle>
    <Style targettype="{x:Type igDP:DataRecordPresenter}" >
        <Setter Property="HeaderAreaBackground" Value="#FF1E1E1E" />
        <Setter Property="localCommand:CommandBehaviorCollection.Behaviors">
            <Setter.Value>
                <localCommand:BehaviorBindingCollection>
                    <localCommand:BehaviorBinding Event="MouseDoubleClick" 
                                                  Command="{Binding  DataContext.ShowOrderDetailCommand,RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type igDP:XamDataPresenter}}}" 
                                                  CommandParameter="{Binding RelativeSource={RelativeSource Self}}"/>
                    <localCommand:BehaviorBinding Event="PreviewMouseUp" 
                                                  Command="{Binding  DataContext.ShowSecurityDetailCommand,AncestorType={x:Type igDP:XamDataPresenter}}}" 
                                                  CommandParameter="{Binding RelativeSource={RelativeSource Self}}"/>
                </localCommand:BehaviorBindingCollection>
            </Setter.Value>
        </Setter>
    </Style>
</igDP:FieldLayoutSettings.DataRecordPresenterStyle>

但是我在运行项目时出错:

ArgumentNullException:值不能为空。参数名称属性

提示 localCommand:CommandBehaviorCollection.Behaviors 属性为空。我错过了什么?有人有想法吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)