예제 #1
0
        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);
                    }
                }
            }
        }
예제 #2
0
            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;
            }
예제 #3
0
 void CancelNavigation(PreviewChangeEventArgs e)
 {
     e.Canceled = true;
     log.DebugFormat("-- Navigation canceled.");
 }