Let's say I have a list of Customers (List) and each Customer has a State-property.
Is it possible to bind the SelectedValue of a ComboBox, so that it shows (has a SelectedValue of) e.g. "WA" if all Customers have WA as their State?
If the customers have different State-values nothing is shown. But if I then choose OR, then all Customers should have their State set to this value.
I've accompliced it through a ValueConverter, where I use the Convert method to return the value of the State-property if they're all the same, and null if not. In this method the value-parameter is a List...
But in the ConvertBack method I don't have access to the List object, but could set the parameter object to the List object i XAML when setting up the binding, and then setting the State-property manually on all Customers, but that just doesn't feel right!
Is there any other way to do this?