我需要将多个命令绑定到 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,RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type igDP:XamDataPresenter}}}"
CommandParameter="{Binding RelativeSource={RelativeSource Self}}"/>
</localCommand:BehaviorBindingCollection>
</Setter.Value>
</Setter>
</Style>
</igDP:FieldLayoutSettings.DataRecordPresenterStyle>
但是在运行项目时出现错误:
ArgumentNullException:值不能为空。参数名称:属性
提示localCommand:CommandBehaviorCollection.Behaviors
属性为空。我错过了什么?有人有想法吗?