I am looking for way to select the first item when data became available. But if no data in the source , then do not select. How to do it ? I am very new to WPF.
<ComboBox Grid.Row="5" Grid.Column="1"
IsEditable="False"
ItemsSource="{Binding Source={x:Static l:DirectXResolution.Resolutions}}"
ToolTip="Resolutions">
<ComboBox.Resources>
<l:ResolutionConverter x:Key="resolutionConverter"/>
</ComboBox.Resources>
<ComboBox.Text>
<MultiBinding Converter="{StaticResource resolutionConverter}">
<Binding Path="GameWidth" Mode="OneWayToSource"/>
<Binding Path="GameHeight" Mode="OneWayToSource"/>
</MultiBinding>
</ComboBox.Text>
</ComboBox>
The easiest way is to use SelectedIndex. Please, check the code below.