// Called after attaching ColumnVirtualizationManager to DataGridContext protected virtual void Initialize() { PropertyChangedEventManager.AddListener(m_dataGridContext, this, string.Empty); ItemsSourceChangeCompletedEventManager.AddListener(m_dataGridContext.DataGridControl, this); ViewChangedEventManager.AddListener(m_dataGridContext.DataGridControl, this); ThemeChangedEventManager.AddListener(m_dataGridContext.DataGridControl, this); ColumnsLayoutChangingEventManager.AddListener(m_dataGridContext.ColumnManager, this); ColumnsLayoutChangedEventManager.AddListener(m_dataGridContext.ColumnManager, this); }
// Called before detaching ColumnVirtualizationManager from DataGridContext protected virtual void Uninitialize() { this.ResetInternalState(); PropertyChangedEventManager.RemoveListener(m_dataGridContext, this, string.Empty); ItemsSourceChangeCompletedEventManager.RemoveListener(m_dataGridContext.DataGridControl, this); ViewChangedEventManager.RemoveListener(m_dataGridContext.DataGridControl, this); ThemeChangedEventManager.RemoveListener(m_dataGridContext.DataGridControl, this); ColumnsLayoutChangingEventManager.RemoveListener(m_dataGridContext.ColumnManager, this); ColumnsLayoutChangedEventManager.RemoveListener(m_dataGridContext.ColumnManager, this); m_dataGridContext = null; }