/// <summary> /// Called when SourceProperty is invalidated on "d." /// </summary> /// <param name="d">The object on which the property was invalidated.</param> /// <param name="e">Argument.</param> private static void OnSourceChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { CollectionViewSource ctrl = (CollectionViewSource)d; ctrl.OnSourceChanged(e.OldValue, e.NewValue); ctrl.EnsureView(); }
private static void OnCollectionViewTypeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) { CollectionViewSource ctrl = (CollectionViewSource)d; Type oldCollectionViewType = (Type)e.OldValue; Type newCollectionViewType = (Type)e.NewValue; if (!ctrl._isInitializing) { throw new InvalidOperationException(SR.Get(SRID.CollectionViewTypeIsInitOnly)); } ctrl.OnCollectionViewTypeChanged(oldCollectionViewType, newCollectionViewType); ctrl.EnsureView(); }