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 ... 我不知道是什麼原因造成的問題。這裏有人有沒有想法或解決方法?
問候
拉爾夫