用于WPF-ToolKit的DoubleUpDown的MouseDoubleClick-CommandBinding不起作用?

时间:2014-07-18 11:59:47

标签: wpf commandbinding

我正在使用当前项目中的Extended WPF Toolkit中的DoubleUpDown UserControl。现在我必须将RelayCommand绑定到DoubleUpDown的DoubleClick事件,但它无法正常工作。到目前为止,我已经将DoubleClick分配给了各种不同的UserControl,通常它工作正常,或者有时候我必须将它包装成一个空的UserControl-Element然后保存CommandBinding,但到目前为止我总是让它工作。 / p>

这是我到目前为止所尝试的:

                            <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 ... 我想知道导致这个问题的原因。这里有人有想法或解决方法吗?

此致

拉​​尔夫

1 个答案:

答案 0 :(得分:0)

嗯,仍然无法弄清楚这里有什么问题。与此同时,我将使用常规的MouseDoubleClick-Event尽可能地使用CodeBehind。