I have a WPF custom combo box that is for selecting Contacts. I'd like to expose multiple ways of interfacing with the combo box's selected item and I'd like them to be bindable.
public class ContactComboBox : ComboBox {
public ContactJson SelectedContact {get; set;}
public long? SelectedContactId {get; set; }
}
I know how to handle single properties that bind to single values with dependency properties, but how do I have a change in one property affect the change in another?
For example:
<local:ContactComboBox SelectedContactId="{Binding ContactId}" />
When the ContactID on the datasource is changed, both the SelectedContact and SelectedContactId values should be changed.
Thanks for your help!