I have two ComboBoxes as follows
<StackPanel Orientation="Horizontal" > <ComboBox x:Name="cbxOne" Style="{StaticResource demoStyle}" > <ComboBoxItem >One</ComboBoxItem> <ComboBoxItem >Two</ComboBoxItem> <ComboBoxItem >All</ComboBoxItem> </ComboBox> <ComboBox x:Name="cbxTwo"> <ComboBoxItem >1</ComboBoxItem> <ComboBoxItem >2</ComboBoxItem> </ComboBox> </StackPanel>
I tried this style
<Style x:Key="demoStyle" TargetType="{x:Type ComboBox}"> <Style.Triggers> <Trigger Property="SelectedValue" Value="All"> <Setter Property="cbxTwo.Visibility" Value="Collapsed"></Setter> </Trigger> </Style.Triggers> </Style>
I want the first to be "Everything" to hide the second using Xaml and trigger.
thanks
source share