我为组合框设置了IsFilteringEnabled="True"
IsEditable="True"
。当我们键入搜索组合框的项目然后选择更改发生和随机项目选择。怎么预防这个?仅当项目选择不是键入文本时才会触发事件。
XAMl代码如下:
<!--<telerik:RadComboBox.LayoutTransform>
<ScaleTransform ScaleX="1.5" ScaleY="1.5"></ScaleTransform>
</telerik:RadComboBox.LayoutTransform>-->
<telerik:RadComboBox.ItemContainerStyle>
<Style TargetType="{x:Type telerik:RadComboBoxItem}">
<Setter Property="FontSize" Value="16"></Setter>
<Setter Property="FontWeight" Value="SemiBold"></Setter>
</Style>
</telerik:RadComboBox.ItemContainerStyle>
<telerik:RadComboBox.Resources>
<Style TargetType="telerik:RadToggleButton">
<Setter Property="Width" Value="36" />
<Setter Property="Height" Value="36" />
</Style>
</telerik:RadComboBox.Resources>
<ie:Interaction.Triggers>
<ie:EventTrigger EventName="SelectionChanged">
<ie:InvokeCommandAction Command="{Binding serviceTypeComboBoxSelectedItemChangedCommand}" >
<ie:InvokeCommandAction.CommandParameter>
<Binding ElementName="serviceComboBox" Path="SelectedItem"/>
</ie:InvokeCommandAction.CommandParameter>
</ie:InvokeCommandAction>
</ie:EventTrigger>
</ie:Interaction.Triggers>
</telerik:RadComboBox>
代码如下:private void serviceTypeComboBoxSelectedItemChanged_Event(object sender) { //做点什么 }