Microsoft.Windows.Controls.Ribbon.RibbonGallery.GetSourceCollectionView C# (CSharp) Méthode

GetSourceCollectionView() static private méthode

static private GetSourceCollectionView ( ItemsControl itemsControl ) : CollectionView
itemsControl System.Windows.Controls.ItemsControl
Résultat CollectionView
        internal static CollectionView GetSourceCollectionView(ItemsControl itemsControl)
        {
            if (itemsControl == null)
                return null;

            CollectionViewSource cvs = null;
            CollectionView cv = null;
            Binding binding = BindingOperations.GetBinding(itemsControl, ItemsSourceProperty);
            if (binding != null)
            {
                cvs = binding.Source as CollectionViewSource;
                if (cvs != null)
                {
                    cv = cvs.View as CollectionView;
                }
            }

            return cv;
        }
RibbonGallery