First of all, I've attempted a great deal of searching, but if my Google-fu appears to be lacking, feel free to instantly link me to another article/question that will answer.
I seem to be misunderstanding the usages of SelectedItem/SelectedValue even though I've read multiple articles and questions about them. Possibly I'm attempting to shoehorn the ComboBox bindings into something it was not meant to be.
public class MappedValue
{
public string Representation
{
get;
set;
}
public object Value
{
get;
set;
}
}
public class ParameterValue
{
public object Value
{
get;
set;
}
}
<ComboBox ItemsSource="{Binding Path=MappedValues}"
DisplayMemberPath="Representation"
SelectedItem="{Binding Path=ParameterValue.Value}"
SelectedValue="{Binding Path=ParameterValue}"
SelectedValuePath="Value"/>
'MappedValues' is just a collection.
So what I'm trying to do is pull the 'Value' property from the selected MappedValue and store that in 'ParameterValue.Value'.
So, as it is, it takes the entire selected MappedValue object (as opposed to the 'MappedValue.Value' property) and sets that as the 'ParameterValue.Value'.
Am I not understanding the function of these combobox properties, or is there no easy way to do this using XAML and ComboBox?