交互.触发器数据模板列 WPF



我有一个数据网格,我在其中声明了一个带有组合框的模板comlumn。 我的第一个想法是在PreparingCellForEdit上触发一个Interaction.Trigger,但是带有组合的模板列没有触发它。 我尝试将交互触发器放在组合上,但它甚至没有触发下拉列表

<WPFCtrlD:ExtDataGridTemplateColumn Header="{x:Static Translate:Translate.About}" Width="*" Tag="ID_SAP_MAPPING"
IsReadOnly="False"  >
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Grid>
<!--Visibility="{Binding IsClassSelected, Mode=OneWay, UpdateSourceTrigger=PropertyChanged,  
Converter={StaticResource  BoolToVisibilityCollapsedInverteConverter }}"-->
<ComboBox ItemsSource="{Binding DataContext.characteristicFiltered,
Source={StaticResource ProxyElement}, Mode=OneWay, UpdateSourceTrigger=PropertyChanged }"
SelectedValuePath="ID_SAP_NAME"
DisplayMemberPath="ID_SAP_NAME"
>
<i:Interaction.Triggers>
<i:EventTrigger EventName="DropDown">
<WPFCtrl:EventToCommand 
PassEventArgsToCommand="True"
Command="{Binding DataContext.PreparingCellForEditCommand, Source={StaticResource ProxyElement}}" />
</i:EventTrigger>
</i:Interaction.Triggers>
</ComboBox>
<!--<Label Visibility="{Binding IsClassNotSelected, Mode=OneWay, UpdateSourceTrigger=PropertyChanged,  
Converter={StaticResource  BoolToVisibilityCollapsedInverteConverter }}"/>-->
</Grid>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</WPFCtrlD:ExtDataGridTemplateColumn>

知道如何在组合的下拉列表打开之前为我的命令触发事件吗?

谢谢 安德里亚

我相信我们在WPF中使用的ComboBox来自System.Windows.Controls命名空间,它使用DropDownOpen事件。

来源: https://msdn.microsoft.com/en-US/library/System.Windows.controls.combobox.dropdownopened(v=vs.110(.aspx

另一方面,如果您使用的是 System.Windows.Forms 命名空间中存在的 ComboBox,它将使用DropDown事件。

来源: https://msdn.microsoft.com/en-us/library/system.windows.forms.combobox.dropdown(v=vs.110(.aspx

最新更新