在 WPF 中,我使用 DoubleClick 事件处理程序创建了一个 CustomUserControl。我以这种方式在 ControlTemplate 中使用此控件:
<xcdg:DataCell FieldName="." Template="{StaticResource myTemplate}">
</xcdg:DataCell>
这也是我的 ControlTemplate:
<ControlTemplate x:Key="myTemplate" TargetType="xcdg:DataCell">
<uicontrols:MyCustomControl Tag="{Binding ID}" Margin="0" Height="140" Width="150" DoubleClick="ctrl_DoubleClick">
</ControlTemplate>
DoubleClick 事件处理程序在 ControlTemplate 中不起作用。什么是问题,什么是最好的解决方案?