Мне нужно отключить ComboBox
и Label
на основе другого ComboBox
выбора.
У меня есть следующий код для отключения комбинированного списка, но дополнительно мне нужно отключить метку с помощьюполе со списком.
XAML
<Label Style="{StaticResource LabelTitle}" Content="F" x:Name="Label_FType" Margin="25.087,24.592,-94.145,7.6" d:LayoutOverrides="Width, Height" />
<ComboBox x:Name="Combo_F_Type" Style="{StaticResource ComboBox}" IsSynchronizedWithCurrentItem="True" Margin="46.145,29.692,0,12.5" Grid.Column="1"
Width="226.199" HorizontalAlignment="Left" d:LayoutOverrides="Height">
<ComboBoxItem Content="Select Type" IsSelected="True" />
<ComboBoxItem Content="F1" />
<ComboBoxItem Content="F2" />
<ComboBoxItem Content="F3" />
</ComboBox>
<Label Style="{StaticResource LabelTitle}" Content="S" x:Name="Label_SType" Margin="25.087,3.1,-94.145,29.092" d:LayoutOverrides="Width, Height" Grid.Row="1" />
<ComboBox Style="{StaticResource EnableSType}" IsSynchronizedWithCurrentItem="True" Margin="46.145,8.2,0,33.992" Grid.Column="1" Width="226.199"
HorizontalAlignment="Left" d:LayoutOverrides="Height" Grid.Row="1" >
<ComboBoxItem Content="Select Type" IsSelected="True" />
<ComboBoxItem Content="S1" />
<ComboBoxItem Content="S2" />
<ComboBoxItem Content="S3" />
<ComboBoxItem Content="S4" />
</ComboBox>
XAML STYLE
<Style TargetType="{x:Type ComboBox}" x:Key="EnableSType">
<Setter Property="FontSize" Value="14" />
<Setter Property="Height" Value="30"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="IsEnabled" Value="False" />
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=Combo_FType, Path=SelectedIndex}" Value="3">
<Setter Property="IsEnabled" Value="True" />
</DataTrigger>
</Style.Triggers>
</Style>
Может кто-нибудь помочь мне?