我想将MouseDoubleClick(或PreviewMouseDoubleClick)绑定到我的自定义WPF控件中定义的自定义命令。
问题在于它不起作用。
...
<Popup>
...
<!--This CommandBinding **DOES NOT WORK** !-->
<ListBox Grid.Row="1"
x:Name="PART_lBox"
VirtualizingStackPanel.IsVirtualizing="True"
DisplayMemberPath="{TemplateBinding DisplayMemberPath}"
ItemsSource="{TemplateBinding ItemsSource}">
<ListBox.InputBindings>
<MouseBinding Command="{x:Static local:ListPicker.AcceptCommand}"
MouseAction="LeftDoubleClick" />
</ListBox.InputBindings>
</ListBox>
<!--This CommandBinding **WORKS** !-->
<Button Grid.Row="0"
Grid.Column="1"
HorizontalAlignment="Right"
Command="{x:Static local:ListPicker.AcceptCommand}"
Content="Accept" />
...
</Popup>
答案 0 :(得分:0)