/// <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(); }