XAML文件中的级联组合框

时间:2016-08-29 12:55:19

标签: wpf data-binding

 <ComboBox Name="comboBox1"  Height="23" HorizontalAlignment="Right" SelectedIndex="0"  Margin="0,33,142,0" VerticalAlignment="Top" Width="120" >
        <ComboBoxItem Name="cb1" Cotent= "AA"/> 
        <ComboBoxItem Name="cb2" Content="BB"/>
 </ComboBox>



 <ComboBox  Name="comboBox2" Height="23" HorizontalAlignment="Right" SelectedIndex="0"  Margin="0,33,142,0" VerticalAlignment="Top" Width="120" >
        <ComboBoxItem Content ="a"/> 
        <ComboBoxItem Content="b"/>
        <ComboBoxItem Content="c"/>
    </ComboBox>

<ComboBox Name="comboBox3" Height="23" HorizontalAlignment="Right" SelectedIndex="0"  Margin="0,33,142,0" VerticalAlignment="Top" Width="120" >
        <ComboBoxItem Content ="d"/> 
        <ComboBoxItem Content="e"/>
        <ComboBoxItem Content="f"/>
    </ComboBox>

如果我选择 cb1 ,则需要使用combobox2项目,如果选择 cb2 ,我需要使用combobox3项目。 如何在xaml中绑定它。

0 个答案:

没有答案