Ejemplo n.º 1
0
        protected override void SetDataContext(object item)
        {
            DataGridContext dataGridContext = DataGridControl.GetDataGridContext(this);

            // When TableflowViewItemsHost is used and an EmptyDataItem is detected.  We also want to avoid getting an animation when the container is sticky
            if (!(item is EmptyDataItem) &&
                (dataGridContext != null) &&
                (dataGridContext.DataGridControl.GetView() is TableflowView) &&
                !(TableflowViewItemsHost.GetIsSticky(this)) &&
                TableflowViewItemsHost.GetShouldDelayDataContext(this))
            {
                this.ApplyAnimationClock(Row.CellContentOpacityProperty, null);
                this.SetValue(Row.CellContentOpacityProperty, 0d);

                // We set the DataContext to an EmptyDataItem to have the real data item set later on with an opacity animation.
                this.DataContext = this.EmptyDataItem;
                this.UpdateUnboundDataItemContext();

                // Dispatch a call to SetDataContextDispatched that will update the DataContext of the Row and every CreatedCells to the
                // DataItem the Row must display. We use a low priority to limit the impact on scrolling.
                if (m_affectDataContextOperation == null)
                {
                    m_affectDataContextOperation = this.Dispatcher.BeginInvoke(new Action <object>(this.SetDataContextDispatched), DispatcherPriority.Background, item);
                }
            }
            else
            {
                this.DataContext = item;
                this.UpdateUnboundDataItemContext();

                this.ApplyAnimationClock(Row.CellContentOpacityProperty, null);
                this.ClearValue(Row.CellContentOpacityProperty);
            }
        }
Ejemplo n.º 2
0
    internal static bool IsDataItemHiddenBySticky( DataGridContext dataGridContext, object tempValue )
    {
      // We only want to do special handling for a TableflowItemsHost.
      TableflowViewItemsHost itemsHost = dataGridContext.DataGridControl.ItemsHost as TableflowViewItemsHost;

      if( itemsHost == null )
        return false;

      int index = dataGridContext.CustomItemContainerGenerator.FindIndexForItem( tempValue, dataGridContext );

      if( index > -1 )
      {
        return itemsHost.IsDataItemHiddenBySticky( index );
      }

      return false;
    }
Ejemplo n.º 3
0
 internal ItemContextVisitor(TableflowViewItemsHost itemsHost, double firstItemHiddenRatio)
 {
     m_itemsHost            = itemsHost;
     m_firstItemHiddenRatio = firstItemHiddenRatio;
 }