<Window.Resources>
<DataTemplate x:Key="IpInfoTemplate">
<DockPanel>
<TextBlock Text="{Binding Path=InterfaceName}" DockPanel.Dock="Left" Margin="0,0,10,0" />
<TextBlock Text="{Binding Path=Address}"/>
</DockPanel>
</DataTemplate>
</Window.Resources>
<ComboBox ItemTemplate="{StaticResource IpInfoTemplate}"
ItemsSource="{Binding Source={x:Static WpfApplication1:App.IpInfoList}, Mode=OneWay}">
</ComboBox>
This code has binded App.IpInfoList to ComboBox.
IpInfo class has a bool property Enabled. The requirement is that set ComboBoxItem.IsEnabled=false (so that users can’t select it) when corresponding IpInfo.Enable==false.
I hope all code is written in XAML.
It binds
ComboBoxItem.IsEnabledproperty to yourIpInfo.Enabledproperty