protected virtual void SetTableControl(IWpfTableControl2 tableControl) { if (TableControl != null) { TableControl.FiltersChanged -= OnFiltersChanged; TableControl.GroupingsChanged -= OnGroupingsChanged; _contentWrapper.Child = null; TableControl.Dispose(); } TableControl = tableControl; if (tableControl != null) { _contentWrapper.Child = TableControl.Control; TableControl.FiltersChanged += OnFiltersChanged; TableControl.GroupingsChanged += OnGroupingsChanged; } }