I'd like to list attribute fields in a combobox. there are two combobox . cmblayers and cmbfields . cmblayers list map layers . user select a layer in cmblayer and attribute fields of selected layer list in cmbfield. i wrote cmblayer but i can't write cmbfield code.How can i write cmbfield using xaml or code behind? cmblayer code :
<ComboBox x:Name="cmblayers" ItemsSource ="{Binding ElementName=Map, Path=Layers}" >
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding LayerInfo.Name}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
i found the below code . but it just bind to specify layer. i couldn't bind cmblayers to cmbfields
<ComboBox x:Name="cmbFields" ItemsSource="{Binding ElementName=Map, Path=Layers[IncidentsLayer].LayerInfo.Fields}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>