Can anyone explain how silverlight/wpf databinding actually determines which is the right item to set as the selectedItem in a collection as in the following snippet
<ComboBox SelectedItem="{Binding Mode=TwoWay, Path=Province}"
ItemsSource="{StaticResource ProvinceCollection}" />
Where ProvinceCollection is simply a static array of strings.
In this example the items are strings and therefore value types which are simple enough but what how does it know what to set as the selected item when the collection contains something more complicated like object instances loaded at runtime. The object references of the (Datacontext).Province and the items in the ProvinceCollection are NOT going to be the same even if I think they should be.
Im tring to do just this, get the databinding to select a item from a collection where the current datacontext's item is not in the collection (ie there is no item that has the same object reference)