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(); }); }
public static System.Windows.Input.ICommand AcceptChangeCmd() { return(new Command((it) => { BaseVM vm = it as BaseVM; if (vm != null) { vm.Parent.Navi.PopModalAsync(); } })); }
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); }
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; }
public virtual void RaiseChanges() { BaseVM vm = this.element as BaseVM; if (vm != null) { vm.RaiseChanges(); } if (this.LineForMove != null) { this.LineForMove.RaiseChanges(); } }