private void DataGridEditingExtender_PreviewCurrentChanging(object sender, PreviewChangeEventArgs e) { UniversalCellInfo oldCell = (UniversalCellInfo)(e.OldValue ?? new UniversalCellInfo()); UniversalCellInfo newCell = (UniversalCellInfo)(e.NewValue ?? new UniversalCellInfo()); var focusManager = UIServiceProvider.GetService <IFocusManagementService>(TargetElement); using (focusManager.DeferFocusUpdate()) { if (!CanLeaveCurrentCell()) { CancelNavigation(e); } else if (oldCell.Item != newCell.Item) { log.DebugFormat("Processing line change event on {0}", this); if (!CanLeaveCurrentLine()) { CancelNavigation(e); } } } }
private void currentCellService_PreviewCurrentCellChanging(object sender, PreviewChangeEventArgs e) { if (e.NewValue == null || e.OldValue == null) { isChangingItem = true; } isChangingItem = ((UniversalCellInfo)e.NewValue).Item != ((UniversalCellInfo)e.OldValue).Item; }
void CancelNavigation(PreviewChangeEventArgs e) { e.Canceled = true; log.DebugFormat("-- Navigation canceled."); }