Пример #1
0
 public System.Windows.Input.ICommand GetDelLineCmd(CommonBaseVM vm, OutputLine key)
 {
     return(new Command(() =>
     {
         vm.DeleteOutputLine(vm.OutputList.FirstOrDefault(x => x.Name == key.Name));
     }));
 }
Пример #2
0
 public System.Windows.Input.ICommand GetDelInputLineCmd(CommonBaseVM vm, Item key)
 {
     return(new Command(() =>
     {
         vm.InputList.Remove(key);
     }));
 }
Пример #3
0
        public System.Windows.Input.ICommand GetMoveSectionCmd(CommonBaseVM vm, IOrdered line)
        {
            return(new Command((arg) =>
            {
                line.TimeStamp = DateTime.Now;

                Task.Factory.StartNew(() => Task.Delay(3000))
                .ContinueWith((t, x) =>
                {
                    if ((DateTime.Now.Subtract((x as IOrdered).TimeStamp).TotalSeconds > 3))
                    {
                        (x as IOrdered).OrderImageName = "empty.png";
                    }
                },
                              line);


                SwipeAction swipe = (arg as SwipeAction?).Value;
                SwipeType swipeType = SwipeType.None;
                if ((swipe.Type & SwipeType.Up) != 0 || (swipe.Type & SwipeType.Left) != 0)
                {
                    line.OrderImageName = "up.png";
                    swipeType = SwipeType.Up;
                }
                else if ((swipe.Type & SwipeType.Down) != 0 || (swipe.Type & SwipeType.Right) != 0)
                {
                    line.OrderImageName = "down.png";
                    swipeType = SwipeType.Down;
                }
                else
                {
                    line.OrderImageName = "empty.png";
                }

                if (swipe.Finished)
                {
                    vm.Order.MoveOutputLine(line, -1, swipeType);
                    line.OrderImageName = "empty.png";
                }

                vm.RaiseChanges();
            }));
        }