0
我在当前项目中使用扩展WPF工具包中的DoubleUpDown UserControl。现在我必须将一个RelayCommand绑定到该DoubleUpDown的DoubleClick事件,但它不起作用。我已经将DoubleClick分配给了各种不同的UserControl,并且通常它工作正常,或者有时我必须将其包装到一个空的UserControl-Element中,然后才能保存CommandBinding,但到目前为止,我总是可以正常工作。WPF-ToolKit的DoubleUpDown无法使用MouseDoubleClick-CommandBinding?
这是我试过到目前为止:
<UserControl Grid.Row="7"
Grid.Column="0">
<xctk:DoubleUpDown Value="{Binding EditableDevice.SelectedLoadReceptor.DecimalPlaces,
UpdateSourceTrigger=PropertyChanged,
Mode=TwoWay, FallbackValue='1'}"
FormatString="F0"
Minimum="0"
Maximum="10">
<xctk:DoubleUpDown.InputBindings>
<MouseBinding Command="{Binding EditDeviceCommand}"
Gesture="LeftDoubleClick" />
</xctk:DoubleUpDown.InputBindings>
<i:Interaction.Triggers>
<i:EventTrigger EventName="LeftDoubleClick">
<cmd:EventToCommand Command="{Binding EditDeviceCommand}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</xctk:DoubleUpDown>
<UserControl.InputBindings>
<MouseBinding Command="{Binding EditDeviceCommand}"
Gesture="LeftDoubleClick" />
</UserControl.InputBindings>
</UserControl>
我平时没事用化InputBindings,但不能与DoubleUpDown ... 我不知道是什么原因造成的问题。这里有人有没有想法或解决方法?
问候
拉尔夫