From a tutorial I have the following combobox:
<ComboBox Name="comboBox_warnColor" Margin="5,0,5,0" SelectionChanged="comboBox_warnColor_SelectionChanged">
<ComboBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<Rectangle Fill="{Binding Name}" Width="12" Height="12" Margin="0,2,5,2" />
<TextBlock Name="PART_ColorName" Text="{Binding Name}" />
</StackPanel>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
I populate it like this:
comboBox_warnColor.ItemsSource = typeof(Colors).GetProperties();
I want to save the selected item in a text file to load it to the combobox later again.
What value could I save to use it for that scenario? or What would be a good ID value for default defined colors?
SelectedIndex aside I couldn't find one.