Microsoft.Windows.Controls.Ribbon.RibbonGallery.OnItemsChanged C# (CSharp) Method

OnItemsChanged() protected method

This method is invoked when the Items property changes.
protected OnItemsChanged ( NotifyCollectionChangedEventArgs e ) : void
e System.Collections.Specialized.NotifyCollectionChangedEventArgs
return void
        protected override void OnItemsChanged(NotifyCollectionChangedEventArgs e)
        {
            switch (e.Action)
            {
                case NotifyCollectionChangedAction.Remove:
                case NotifyCollectionChangedAction.Reset:
                case NotifyCollectionChangedAction.Replace:
                    if (SelectedItem != null)
                    {
                        // Synchronize SelectedItem after Remove, Replace or Reset operations.
                        ForceCoerceSelectedItem();
                    }
                    if (HighlightedItem != null)
                    {
                        // Synchronize HighlightedItem after Remove, Replace or Reset operations.
                        ForceCoerceHighlightedItem();
                    }
                    break;

                case NotifyCollectionChangedAction.Add:
                case NotifyCollectionChangedAction.Move:
                    break;
            }
        }
RibbonGallery