效果如图:
根据下拉框fieldTypeComboBox,控制其他控件的显隐
关键代码
<ComboBox Grid.Column="1" Grid.Row="2" DataContext="{Binding FieldTypeEnumInfos}" ItemsSource="{Binding }" Name="fieldTypeComboBox" DisplayMemberPath="Description" SelectedValuePath="Value"></ComboBox>
<CheckBox Grid.Column="1" Grid.Row="3" IsChecked="{Binding IsUniqueKey,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Visibility="{Binding SelectedItem,ElementName=fieldTypeComboBox,Converter={StaticResource EditFieldVisibilityConverter},ConverterParameter=IsUniqueKey}"></CheckBox>