In the ComboBox.SelectionChanged event, the sender is always a ComboBox, and there will be nothing in SelectionChangedEventArgs that helps you.
. , , , System.Windows.Controls.Primitives.Selector.OnSelectedItemsCollectionChanged(, NotifyCollectionChangedArgs). , . .
, . , - .
1. , , "" "":
public EventingConverter : IValueConverter
{
public event EventHandler Converted;
public event EventHandler ConvertedBack;
public object Convert(object value, ...)
{
if(Converted!=null) Converted(this, EventArgs.Empty);
return value;
}
public object ConvertBack(object value, ...)
{
if(ConvertedBack!=null) ConvertedBack(this, EventArgs.Empty);
return value;
}
}
2. ( , )
<ComboBox ...>
<ComboBox.SelectedValue>
<Binding Path="..." ...>
<Binding.Converter>
<local:EventingConverter
Converted="ComboBoxSelectedValue_Converted"
ConvertedBack="ComboBoxSelectedValue_ConvertedBack" />
</Binding.Converter>
</Binding>
</ComboBox.SelectedValue>
</ComboBox>
ComboBoxSelectedValue_Converted ComboBoxSelectedValue_ConvertedBack .
. , .
XAML,
XAML, (, ), . , ( ), MultiBindings ( ).
, , , , .
, , , - " ComboBox". , , . , , " " " " " 5".