コード例 #1
0
        public PaymentEditorViewModel(IApplicationState applicationState, ICacheService cacheService, IExpressionService expressionService,
            TicketTotalsViewModel paymentTotals, PaymentEditor paymentEditor, NumberPadViewModel numberPadViewModel,
            OrderSelectorViewModel orderSelectorViewModel, ITicketService ticketService,
            ForeignCurrencyButtonsViewModel foreignCurrencyButtonsViewModel, PaymentButtonsViewModel paymentButtonsViewModel,
            CommandButtonsViewModel commandButtonsViewModel, TenderedValueViewModel tenderedValueViewModel,
            ReturningAmountViewModel returningAmountViewModel, ChangeTemplatesViewModel changeTemplatesViewModel, AccountBalances accountBalances)
        {
            _applicationState = applicationState;
            _cacheService = cacheService;
            _expressionService = expressionService;
            _paymentTotals = paymentTotals;
            _paymentEditor = paymentEditor;
            _numberPadViewModel = numberPadViewModel;
            _orderSelectorViewModel = orderSelectorViewModel;
            _ticketService = ticketService;
            _foreignCurrencyButtonsViewModel = foreignCurrencyButtonsViewModel;
            _commandButtonsViewModel = commandButtonsViewModel;
            _tenderedValueViewModel = tenderedValueViewModel;
            _returningAmountViewModel = returningAmountViewModel;
            _changeTemplatesViewModel = changeTemplatesViewModel;
            _accountBalances = accountBalances;

            _makePaymentCommand = new CaptionCommand<PaymentType>("", OnMakePayment, CanMakePayment);
            _selectChangePaymentTypeCommand = new CaptionCommand<PaymentData>("", OnSelectChangePaymentType);

            ClosePaymentScreenCommand = new CaptionCommand<string>(Resources.Close, OnClosePaymentScreen, CanClosePaymentScreen);
            paymentButtonsViewModel.SetButtonCommands(_makePaymentCommand, null, ClosePaymentScreenCommand);
        }
コード例 #2
0
 public ForeignCurrencyButtonsViewModel(PaymentEditor paymentEditor, OrderSelectorViewModel orderSelectorViewModel,
     ICacheService cacheService, PaymentButtonsViewModel paymentButtonsViewModel, ISettingService settingService, TenderedValueViewModel tenderedValueViewModel)
 {
     _paymentEditor = paymentEditor;
     _orderSelectorViewModel = orderSelectorViewModel;
     _cacheService = cacheService;
     _paymentButtonsViewModel = paymentButtonsViewModel;
     _settingService = settingService;
     _tenderedValueViewModel = tenderedValueViewModel;
     _tenderedValueViewModel.PaymentDueChanged += TenderedValueViewModelPaymentDueChanged;
     _foreignCurrencySelectedCommand = new CaptionCommand<ForeignCurrency>("", OnForeignCurrencySelected);
     ForeignCurrencyButtons = new ObservableCollection<CommandButtonViewModel<ForeignCurrency>>(_cacheService.GetForeignCurrencies().Select(x => new CommandButtonViewModel<ForeignCurrency> { Caption = x.CurrencySymbol, Command = _foreignCurrencySelectedCommand, Parameter = x }));
 }
コード例 #3
0
 public ForeignCurrencyButtonsViewModel(PaymentEditor paymentEditor, OrderSelectorViewModel orderSelectorViewModel,
                                        ICacheService cacheService, PaymentButtonsViewModel paymentButtonsViewModel, ISettingService settingService, TenderedValueViewModel tenderedValueViewModel)
 {
     _paymentEditor           = paymentEditor;
     _orderSelectorViewModel  = orderSelectorViewModel;
     _cacheService            = cacheService;
     _paymentButtonsViewModel = paymentButtonsViewModel;
     _settingService          = settingService;
     _tenderedValueViewModel  = tenderedValueViewModel;
     _tenderedValueViewModel.PaymentDueChanged += TenderedValueViewModelPaymentDueChanged;
     _foreignCurrencySelectedCommand            = new CaptionCommand <ForeignCurrency>("", OnForeignCurrencySelected);
     ForeignCurrencyButtons = new ObservableCollection <CommandButtonViewModel <ForeignCurrency> >();
 }
コード例 #4
0
        public PaymentEditorViewModel(IApplicationState applicationState,
                                      TicketTotalsViewModel paymentTotals, PaymentEditor paymentEditor, NumberPadViewModel numberPadViewModel,
                                      OrderSelectorViewModel orderSelectorViewModel, ITicketService ticketService,
                                      ForeignCurrencyButtonsViewModel foreignCurrencyButtonsViewModel, PaymentButtonsViewModel paymentButtonsViewModel,
                                      CommandButtonsViewModel commandButtonsViewModel, TenderedValueViewModel tenderedValueViewModel,
                                      ReturningAmountViewModel returningAmountViewModel, ChangeTemplatesViewModel changeTemplatesViewModel, AccountBalances accountBalances)
        {
            _applicationState                = applicationState;
            _paymentTotals                   = paymentTotals;
            _paymentEditor                   = paymentEditor;
            _numberPadViewModel              = numberPadViewModel;
            _orderSelectorViewModel          = orderSelectorViewModel;
            _ticketService                   = ticketService;
            _foreignCurrencyButtonsViewModel = foreignCurrencyButtonsViewModel;
            _commandButtonsViewModel         = commandButtonsViewModel;
            _tenderedValueViewModel          = tenderedValueViewModel;
            _returningAmountViewModel        = returningAmountViewModel;
            _changeTemplatesViewModel        = changeTemplatesViewModel;
            _accountBalances                 = accountBalances;

            _makePaymentCommand             = new CaptionCommand <PaymentType>("", OnMakePayment, CanMakePayment);
            _selectChangePaymentTypeCommand = new CaptionCommand <PaymentData>("", OnSelectChangePaymentType);

            ClosePaymentScreenCommand = new CaptionCommand <string>(Resources.Close, OnClosePaymentScreen, CanClosePaymentScreen);
            paymentButtonsViewModel.SetButtonCommands(_makePaymentCommand, null, ClosePaymentScreenCommand);
        }
コード例 #5
0
 public PaymentButtonsView(PaymentButtonsViewModel viewModel)
 {
     DataContext = viewModel;
     InitializeComponent();
 }
コード例 #6
0
 public PaymentButtonsView(PaymentButtonsViewModel viewModel)
 {
     DataContext = viewModel;
     InitializeComponent();
 }