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); }
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); }