从后面的代码执行SelectionChangedEvent

时间:2014-04-16 11:49:11

标签: c# wpf-controls command selectionchanged

public ICommand SelectionChanged
{
    get
    {
        return new RelayCommand(param => this.ExecuteSelectionChanged(param));
    }
}

private object ExecuteSelectionChanged(object param)
{
    var e = param as SelectionChangedEventArgs;
    var addedItem = e.AddedItems[0];
}

我想这样做:

SelectionChanged.Execute(new SelectionChangedEventArgs( null,null, addedList)); 

但它表示值不能为事件id的null。有什么工作吗?

1 个答案:

答案 0 :(得分:0)

   SelectionChanged.Execute(new SelectionChangedEventArgs(ComboBox.SelectionChangedEvent, removeList,addList));