Esempio n. 1
0
        public static IAdaptedCellInfo FromDataGridCellInfo(DataGridCellInfo cellInfo)
        {
            DataGridAdaptedCellInfo adaptedCellInfo = new DataGridAdaptedCellInfo();

            adaptedCellInfo.Item         = cellInfo.Item;
            adaptedCellInfo.DisplayIndex = cellInfo.Column.DisplayIndex;
            adaptedCellInfo.Column       = cellInfo.Column;
            return(adaptedCellInfo);
        }
Esempio n. 2
0
        bool MoveToCell(DataGridCell cell)
        {
            DataGridCellInfo newCellInfo        = new DataGridCellInfo(cell);
            IAdaptedCellInfo newAdaptedCellInfo = DataGridAdaptedCellInfo.FromDataGridCellInfo(newCellInfo);
            bool             canceled;

            RaisePreviewCurrentChangingEvent(newAdaptedCellInfo, out canceled);
            if (canceled)
            {
                return(CurrentItem != null);
            }

            owner.CurrentCell = newCellInfo;
            owner.ScrollIntoView(owner.CurrentCell.Item);

            owner.Dispatcher.Invoke(DispatcherPriority.Render, new Action(() => RaiseCurrentChangedEvent()));

            return(CurrentItem != null);
        }