The Wpf ComboBox
has three selection properties and one display property:
SelectedItem
SelectedValue
SelectedValuePath
DisplayMemberPath
When using SelectedValue
you should also set the SelectedValuePath
(almost always). Understand that the Items
in your case contains a sequence (ItemCollection
) of ComboBoxItem
objects, and just like any other object you must specify the SelectedValuePath
(read property) that you want to bind to; In this case, you want to access the ComboBoxItem.Content
property (http://msdn.microsoft.com/en-us/library/system.windows.controls.contentcontrol.content(v=vs.110).aspx).
<ComboBox SelectedValue="{Binding Path=MyProperty}" SelectedValuePath="Content">
<ComboBoxItem>A</ComboBoxItem>
<ComboBoxItem>B</ComboBoxItem>
<ComboBoxItem>C</ComboBoxItem>
</ComboBox>
Now you are binding the SelctedValue
to the MyProperty
property using the selected item's Content
property, which happens to be the strings you are looking for.