private void SelectionModelSelectionChanged(object sender, SelectionModelSelectionChangedEventArgs e) { if (_updatingModel) { return; } if (_items == null) { throw new AvaloniaInternalException("SelectionModelChanged raised but we don't have items."); } try { var deselected = e.DeselectedItems.ToList(); var selected = e.SelectedItems.ToList(); _updatingItems = true; foreach (var i in deselected) { _items.Remove(i); } foreach (var i in selected) { _items.Add(i); } } finally { _updatingItems = false; } }
private void OnSelectionChanged(SelectionModel sender, SelectionModelSelectionChangedEventArgs args) { if (AutomationPeer.ListenerExists(AutomationEvents.SelectionPatternOnInvalidated)) { var peer = (SelectionContainerAutomationPeer)FrameworkElementAutomationPeer.CreatePeerForElement(this); peer.SelectionChanged(args); } }
internal void SelectionChanged(SelectionModelSelectionChangedEventArgs args) { RaiseAutomationEvent(AutomationEvents.SelectionPatternOnInvalidated); }
protected virtual void OwnerSelectionChanged(object?sender, SelectionModelSelectionChangedEventArgs e) { RaiseSelectionChanged(); }