Ejemplo n.º 1
0
        public void DragEnd(DragInfo info)
        {
            if (_dragStartIndex < 0)
            {
                return;
            }
            RadListBox rlb = info.Source as RadListBox;

            if (rlb != null)
            {
                TimeSwitchViewModel vm = rlb.DataContext as TimeSwitchViewModel;
                if (vm != null)
                {
                    vm.ToDropPlan(_dragStartIndex);
                }
                _dragStartIndex = -1;
            }
        }
Ejemplo n.º 2
0
        public void Drop(DropInfo info)
        {
            RadListBox rlb = info.Source as RadListBox;

            if (rlb != null)
            {
                TimeSwitchViewModel source = rlb.DataContext as TimeSwitchViewModel;
                if (source != null && source.DragPlan != null && source.DragPlan != TimeSwitchViewModel.AddPlanStatic)
                {
                    var dragSource             = source.DragPlan;
                    TimeSwitchViewModel target = (info.Target as RadListBox)?.DataContext as TimeSwitchViewModel;
                    if (target != source)
                    {
                        return;
                    }
                    if (target != null)
                    {
                        var list = target.PlansSource.Source as ObservableCollection <LayoutPlanModel>;
                        source.ToDropPlan(info.InsertIndex);
                        GC.Collect();
                    }
                }
            }
        }