/// <summary> /// Initializes the specified view model. /// </summary> /// <param name="viewModel">The view model.</param> public void Init(RedemptionVoucherDetailsViewModel viewModel) { this.Database.InsertLogMessage(DatabaseContext.CreateDebugLogMessage($"In {this.GetType().Name} Init")); this.ViewModel = viewModel; this.BindingContext = this.ViewModel; }
/// <summary> /// Initializes a new instance of the <see cref="VoucherPresenter" /> class. /// </summary> /// <param name="voucherPage">The voucher page.</param> /// <param name="redemptionSelectEntryModePage">The redemption select entry mode page.</param> /// <param name="redemptionEnterVoucherCodePage">The redemption enter voucher code page.</param> /// <param name="redemptionScanVoucherCodePage">The redemption scan voucher code page.</param> /// <param name="redemptionVoucherDetailsPage">The redemption voucher details page.</param> /// <param name="redemptionEnterVoucherCodeViewModel">The redemption enter voucher code view model.</param> /// <param name="redemptionVoucherDetailsViewModel">The redemption voucher details view model.</param> /// <param name="redemptionSuccessPage">The redemption success page.</param> /// <param name="redemptionFailedPage">The redemption failed page.</param> /// <param name="voucherManagerAclClient">The voucher manager acl client.</param> /// <param name="device">The device.</param> /// <param name="database">The database.</param> public VoucherPresenter(IVoucherPage voucherPage, IRedemptionSelectVoucherEntryModePage redemptionSelectEntryModePage, IRedemptionEnterVoucherCodePage redemptionEnterVoucherCodePage, IRedemptionScanVoucherCodePage redemptionScanVoucherCodePage, IRedemptionVoucherDetailsPage redemptionVoucherDetailsPage, RedemptionEnterVoucherCodeViewModel redemptionEnterVoucherCodeViewModel, RedemptionVoucherDetailsViewModel redemptionVoucherDetailsViewModel, IRedemptionSuccessPage redemptionSuccessPage, IRedemptionFailedPage redemptionFailedPage, IVoucherManagerACLClient voucherManagerAclClient, IDevice device, IDatabaseContext database) { this.VoucherPage = voucherPage; this.RedemptionSelectEntryModePage = redemptionSelectEntryModePage; this.RedemptionEnterVoucherCodePage = redemptionEnterVoucherCodePage; this.RedemptionScanVoucherCodePage = redemptionScanVoucherCodePage; this.RedemptionVoucherDetailsPage = redemptionVoucherDetailsPage; this.RedemptionEnterVoucherCodeViewModel = redemptionEnterVoucherCodeViewModel; this.RedemptionVoucherDetailsViewModel = redemptionVoucherDetailsViewModel; this.RedemptionSuccessPage = redemptionSuccessPage; this.RedemptionFailedPage = redemptionFailedPage; this.VoucherManagerAclClient = voucherManagerAclClient; this.Device = device; this.Database = database; this.VoucherPage.VoucherRedemptionButtonClick += this.VoucherPage_VoucherRedemptionButtonClick; this.RedemptionSelectEntryModePage.KeyEntryButtonClick += this.RedemptionSelectEntryModePage_KeyEntryButtonClick; this.RedemptionSelectEntryModePage.ScanButtonClick += this.RedemptionSelectEntryModePage_ScanButtonClick; this.RedemptionEnterVoucherCodePage.FindVoucherButtonClick += this.RedemptionEnterVoucherCodePage_FindVoucherButtonClick; this.RedemptionEnterVoucherCodePage.CancelButtonClick += this.RedemptionEnterVoucherCodePage_CancelButtonClick; this.RedemptionScanVoucherCodePage.VoucherBarcodeScanned += this.RedemptionScanVoucherCodePage_VoucherBarcodeScanned; this.RedemptionScanVoucherCodePage.CancelButtonClick += this.RedemptionScanVoucherCodePage_CancelButtonClick; this.RedemptionVoucherDetailsPage.CancelButtonClick += this.RedemptionVoucherDetailsPage_CancelButtonClick; this.RedemptionVoucherDetailsPage.RedeemVoucherButtonClick += this.RedemptionVoucherDetailsPage_RedeemVoucherButtonClick; this.RedemptionSuccessPage.CompleteButtonClicked += this.RedemptionSuccessPage_CompleteButtonClicked; this.RedemptionFailedPage.CancelButtonClicked += this.RedemptionFailedPage_CancelButtonClicked; }