public static bool TryPick(MarketStateDbBase marketStateDB, out StallDTO stall) { var win = CreateWindow(); var vm = new StallPickerVM(marketStateDB, win); var res = win.ShowDialog(); stall = vm.PickedStall; return(res == true && stall != null); }
public static StallDTO PickFirstVacant(MarketStateDbBase mkt) { var vm = new StallPickerVM(mkt, null); foreach (var sec in vm.Sections) { vm.PickedSection = sec; if (vm.Stalls.Any()) { return(vm.Stalls.First()); } } throw No.Match <StallDTO>("state", "vacant"); }