internal void RollbackReorderedColumnsAndFixedColumnCount()
 {
   this.RequiredAnimations = new RequiredAnimationsInfo( this.InitialColumnVisiblePosition, this.InitialFixedColumnCount, 0, this.InitialColumnsByVisiblePosition );
 }
 internal void InitializeInfoManager( int newFixedColumnCount, int correctionValue )
 {
   this.RequiredAnimations = new RequiredAnimationsInfo();
   this.RequiredAnimations.NewFixedColumnCount = newFixedColumnCount;
   this.RequiredAnimations.CorrectionValue = correctionValue;
 }
    private void CommitColumnReordering( RequiredAnimationsInfo animationState )
    {
      int newVisiblePosition = ( animationState != null ) ? animationState.DraggedColumnNewVisiblePosition : -1;

      // Affect the new VisiblePosition to the DraggedColumn to allow the Grid to reflect the change
      if( newVisiblePosition > -1 )
      {
        // There is a ReorderVisiblePosition assigned only when a ColumnReordering is processed, not when a FixedColumnSplitter is moved
        ColumnManagerCell draggedCell = this.DraggedElement as ColumnManagerCell;
        Debug.Assert( draggedCell != null );
        if( draggedCell != null )
        {
          ColumnBase draggedColumn = draggedCell.ParentColumn;

          // Affect the new VisiblePosition of the DraggedColumn - this will automatically update all child columns when dealing with merged columns
          draggedColumn.VisiblePosition = newVisiblePosition;
        }
      }

      this.CleanUpColumnAnimations();
    }
    private void CommitSplitterReordering( RequiredAnimationsInfo animationState )
    {
      if( m_splitterAnimationClock == null )
        return;

      double fixedColumnTranslation = this.FixedColumnSplitterTranslation.X;

      // Try to get the TargetOffset of the FixedColumnSplitter AnimationClock if available to ensure to commit the correct fixed column count
      if( m_splitterAnimationClock != null )
      {
        OffsetAnimation animation = m_splitterAnimationClock.Timeline as OffsetAnimation;

        if( animation != null )
        {
          if( ( animation.To != null ) && ( animation.To.HasValue ) )
          {
            fixedColumnTranslation = animation.To.Value;
          }
        }
      }

      if( fixedColumnTranslation != 0 )
      {
        int fixedColumnCount = animationState.NewFixedColumnCount;
        int correctionValue = animationState.CorrectionValue;

        // Update the FixedColumnCount on the DataGridContext in order to correctly represent the value modified during animated reordering
        DataGridContext dataGridContext = this.DraggedDataGridContext;

        if( dataGridContext.ParentDataGridContext != null )
        {
          foreach( DataGridContext childDataGridContext in dataGridContext.ParentDataGridContext.GetChildContexts() )
          {
            this.ColumnVirtualizationManager.SetFixedColumnCount( m_level, fixedColumnCount, correctionValue );
          }
        }
        else
        {
          this.ColumnVirtualizationManager.SetFixedColumnCount( m_level, fixedColumnCount, correctionValue );
        }
      }

      m_splitterAnimationClock.Controller.Remove();

      // Ensure 0 to move to original position
      this.FixedColumnSplitterTranslation.X = 0;
    }
 internal void InitalizeInfoManager( int newFixedColumnCount )
 {
   this.RequiredAnimations = new RequiredAnimationsInfo();
   this.RequiredAnimations.NewFixedColumnCount = newFixedColumnCount;
 }