【发布时间】:2013-07-22 12:53:16
【问题描述】:
当IsEnabled 设置为false 时,我必须更改组合框的Text 属性,并且当IsEnabled 为true 时,它可以从同一控件中手动选择项目源中的字段,这可能吗?
XAML:
<ComboBox Name="cmbIntervals"
Grid.Row="5"
Grid.Column="1"
Width="150"
HorizontalAlignment="Left"
VerticalAlignment="Top"
IsEnabled="{Binding ElementName=chkBox,
Path=IsChecked}"
ItemsSource="{Binding Source={x:Static res:Parameters.Instance},
Path=Intervals}"
Text="{Binding [Intervals], Mode=TwoWay,
UpdateSourceTrigger=PropertyChanged}" >
<ComboBox.Style>
<Style TargetType="{x:Type ComboBox}">
<Style.Triggers>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Text" Value="1"/>
</Trigger>
</Style.Triggers>
</Style>
</ComboBox.Style>
</ComboBox>
【问题讨论】:
-
您想在禁用时为您的 ComboBox 设置一些文本??
-
@user1805169,禁用时更改为已修复的内容?
标签: wpf combobox converter isenabled