Ejemplo n.º 1
0
        public PaymentButtonViewModel(IApplicationState applicationState, ITicketService ticketService)
        {
            _applicationState = applicationState;
            _ticketService    = ticketService;

            CloseTicketCommand     = new CaptionCommand <string>(Resources.CloseTicket_r, OnCloseTicketExecute, CanCloseTicket);
            MakePaymentCommand     = new CaptionCommand <string>(Resources.Settle, OnMakePaymentExecute, CanMakePayment);
            MakeFastPaymentCommand = new CaptionCommand <PaymentType>("[FastPayment]", OnMakeFastPaymentExecute, CanMakeFastPayment);

            PaymentButtonGroup = new PaymentButtonGroupViewModel();
            PaymentButtonGroup.SetButtonCommands(MakeFastPaymentCommand, MakePaymentCommand, CloseTicketCommand);
            SelectedTicket = Ticket.Empty;

            EventServiceFactory.EventService.GetEvent <GenericEvent <Department> >().Subscribe(OnDepartmentChanged);
        }