Ejemplo n.º 1
0
        public OutputLine(string name, string section, int index, BaseVM vm, string location)
        {
            this.name     = name;
            this.Index    = index;
            this.Parent   = vm;
            this.section  = section;
            this.Location = location;

            CommonBaseVM commonVm = this.Parent as CommonBaseVM;

            this.DeleteCmd = new Command(() =>
            {
                if (this.Valid)
                {
                    this.Delete(null, null);
                }
                else
                {
                    this.Valid = true;
                    commonVm.EnableLine(this);
                }
                this.RaiseChanges();

                if (this.Previous != null)
                {
                    this.Previous.RaiseChanges();
                }

                if (this.Next != null)
                {
                    this.Next.RaiseChanges();
                }
            });

            this.OnDragCmd = new Command((arg) =>
            {
                SwipeType?swipe = arg as SwipeType?;
                if ((swipe.Value & SwipeType.Up) != 0)
                {
                    this.CommonVM.Order.MoveOutputLine(this, -1, SwipeType.Up);
                }
                else if ((swipe.Value & SwipeType.Down) != 0)
                {
                    this.CommonVM.Order.MoveOutputLine(this, -1, SwipeType.Down);
                }
                else if ((swipe.Value & SwipeType.Left) != 0)
                {
                    this.CommonVM.Order.MoveOutputLine(this, -1, SwipeType.Up);
                }
                else if ((swipe.Value & SwipeType.Right) != 0)
                {
                    this.CommonVM.Order.MoveOutputLine(this, -1, SwipeType.Down);
                }

                commonVm.RaiseChanges();
            });
        }
Ejemplo n.º 2
0
 public static System.Windows.Input.ICommand AcceptChangeCmd()
 {
     return(new Command((it) =>
     {
         BaseVM vm = it as BaseVM;
         if (vm != null)
         {
             vm.Parent.Navi.PopModalAsync();
         }
     }));
 }
Ejemplo n.º 3
0
        public Email(BaseVM vm)
        {
            this.InputFromGmailCmd = new Command((nothing) =>
            {
                StoreFactory.Items.InitInput(this.Body.Split(new String[] { Environment.NewLine, "\n" }, StringSplitOptions.RemoveEmptyEntries), true, StoreFactory.CurrentVM);
                StoreFactory.CurrentVM.RefreshOutputList();
                this.GoToInputCmd.Execute(null);
            });

            this.GoToInputCmd = StoreFactory.HalProxy.GetGoToInputCmd(vm);
        }
Ejemplo n.º 4
0
        public void AssignParent(BaseVM vm)
        {
            foreach (var sect in this.Sections)
            {
                sect.Parent = this;
            }

            this.Parent       = vm;
            this.StoreEditCmd = this.CommonVM.GoToStoreEditCmd;
            this.NewStoreCmd  = this.CommonVM.NewStoreCmd;
            this.Navi         = vm.Navi;
        }
Ejemplo n.º 5
0
        public virtual void RaiseChanges()
        {
            BaseVM vm = this.element as BaseVM;

            if (vm != null)
            {
                vm.RaiseChanges();
            }

            if (this.LineForMove != null)
            {
                this.LineForMove.RaiseChanges();
            }
        }