Hi, I'm trying to set the selected value of my Font Family combobox, which has been populated with the following XAML:
<ComboBox ItemsSource="{x:Static Fonts.SystemFontFamilies}" Name="cboFont">
<ComboBox.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel MinWidth="256" />
</ItemsPanelTemplate>
</ComboBox.ItemsPanel>
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Margin="2" Text="{Binding}" FontFamily="{Binding}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
The field I have to set the combobox to is a string, but that causes FormatExceptions. Can anyone quickly tell me what class the combobox will be expecting and also how to convert a string e.g. "Arial" to that format?