Read and preset a combobox of color properties

ساخت وبلاگ

Vote count: 0

From a tutorial I have the following combobox:

<ComboBox Name="comboBox_waColor" Margin="5,0,5,0" SelectionChanged="comboBox_waColor_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_waColor.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 and how should I do it?

SelectedIndex aside I couldn't find one.

asked 13 secs ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 250 تاريخ : دوشنبه 18 مرداد 1395 ساعت: 16:42