tags:

views:

30

answers:

2

what could be done if i want to get the removed itema dn added items from a comboBox?

A: 

What are you using for binding the items of the combobox? if you are using a ObservableCollection you can use the CollectionChanged event to be notified of those changes. And it would all be done in the ModelView layer were you probably want to.

jpsstavares
A: 

In any case bind your ComboBox's SelectedItem to a property in your ViewModel. The changes could be done to that property in the setter.

Foo _selectedItem;
public Foo SelectedItem
{
    get
    { 
        return _selectedItem;
    }
    set
    {
        oldvalue = _selectedItem; // Do something with the previously SelectedItem
        _selectedItem = value; // Do something with the newly SelectedItem
        // PropertyChange Notification goes here
    }
}
Veer