public AtmViewModel(Atm atm, IAtmRepository repository, EventDispatcher eventDispatcher) { _atm = atm; _repository = repository; _eventDispatcher = eventDispatcher; _paymentGateway = new PaymentGateway(); TakeMoneyCommand = new Command<decimal>(x => x > 0, TakeMoney); }
public SnackMachineViewModel(SnackMachine snackMachine, ISnackMachineRepository repository, EventDispatcher eventDispatcher) { _snackMachine = snackMachine; _repository = repository; _eventDispatcher = eventDispatcher; InsertCentCommand = new Command(() => InsertMoney(Money.Cent)); InsertTenCentCommand = new Command(() => InsertMoney(Money.TenCent)); InsertQuarterCommand = new Command(() => InsertMoney(Money.Quarter)); InsertDollarCommand = new Command(() => InsertMoney(Money.Dollar)); InsertFiveDollarCommand = new Command(() => InsertMoney(Money.FiveDollar)); InsertTwentyDollarCommand = new Command(() => InsertMoney(Money.TwentyDollar)); ReturnMoneyCommand = new Command(() => ReturnMoney()); BuySnackCommand = new Command<string>(BuySnack); }
public DashboardViewModel(ISnackMachineRepository snackMachineRepository, IAtmRepository atmRepository, IHeadOfficeRepository headOfficeRepository, EventDispatcher eventDispatcher) { _snackMachineRepository = snackMachineRepository; _atmRepository = atmRepository; _headOfficeRepository = headOfficeRepository; _eventDispatcher = eventDispatcher; HeadOffice = HeadOfficeInstance.Instance; RefreshAll(); ShowSnackMachineCommand = new Command<SnackMachineDto>(x => x != null, ShowSnackMachine); UnloadCashCommand = new Command<SnackMachineDto>(CanUnloadCash, UnloadCash); ShowAtmCommand = new Command<AtmDto>(x => x != null, ShowAtm); LoadCashToAtmCommand = new Command<AtmDto>(CanLoadCashToAtm, LoadCashToAtm); }
public MainViewModel(ISnackMachineRepository smRep, IAtmRepository atmRep, IHeadOfficeRepository hoRep, EventDispatcher dispatcher) { Dashboard = new DashboardViewModel(smRep, atmRep, hoRep, dispatcher); }