public ColumnVirtualizationManager(DataGridContext dataGridContext)
        {
            Debug.Assert(dataGridContext != null);
            m_dataGridContext = dataGridContext;

            // Assign the ColumnVirtualizationManager to the DataGridContext
            ColumnVirtualizationManager.SetColumnVirtualizationManager(m_dataGridContext, this);

            this.Initialize();

            unchecked
            {
                m_version++;
            }
        }
        protected virtual bool OnReceivedWeakEvent(Type managerType, object sender, EventArgs e)
        {
            bool handled = false;
            bool detachFromDataGridContext = false;

            if (managerType == typeof(VisibleColumnsUpdatedEventManager))
            {
                this.IncrementVersion(null);

                handled = true;
            }
            else if (managerType == typeof(ViewChangedEventManager))
            {
                detachFromDataGridContext = true;
                this.IncrementVersion(null);

                handled = true;
            }
            else if (managerType == typeof(ThemeChangedEventManager))
            {
                detachFromDataGridContext = true;
                this.IncrementVersion(null);

                handled = true;
            }
            else if (managerType == typeof(ItemsSourceChangeCompletedEventManager))
            {
                detachFromDataGridContext = true;
                handled = true;
            }

            if (detachFromDataGridContext == true)
            {
                if (m_dataGridContext != null)
                {
                    // Detach the ColumnVirtualizationManager from the DataGridContext and detach from the DataGridContext
                    ColumnVirtualizationManager.SetColumnVirtualizationManager(m_dataGridContext, null);

                    this.Uninitialize();
                }
            }

            return(handled);
        }
 internal static void SetColumnVirtualizationManager(DependencyObject obj, ColumnVirtualizationManager value)
 {
     obj.SetValue(ColumnVirtualizationManager.ColumnVirtualizationManagerPropertyKey, value);
 }