示例#1
0
        /// <summary>
        /// Loads the operators.
        /// </summary>
        /// <param name="viewModel">The view model.</param>
        private void LoadOperators(MobileTopupSelectOperatorViewModel viewModel)
        {
            RowDefinitionCollection rowDefinitionCollection = new RowDefinitionCollection();

            for (Int32 i = 0; i < viewModel.Operators.Count; i++)
            {
                rowDefinitionCollection.Add(new RowDefinition
                {
                    Height = 80
                });
            }

            this.OperatorsGrid.RowDefinitions = rowDefinitionCollection;

            Int32 rowCount = 0;

            foreach (String viewModelOperator in viewModel.Operators)
            {
                SfButton button = new SfButton
                {
                    Text = viewModelOperator,
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    //HeightRequest = 100,
                    //WidthRequest = 400,
                    AutomationId     = viewModelOperator,
                    Command          = new Command <SelectedItemChangedEventArgs>(this.Execute),
                    CommandParameter = new SelectedItemChangedEventArgs(viewModelOperator, rowCount)
                };
                button.SetDynamicResource(VisualElement.StyleProperty, "SfButtonStyleMobileTopup");

                this.OperatorsGrid.Children.Add(button, 0, rowCount);
                rowCount++;
            }
        }
示例#2
0
        public void TransactionsPresenter_CanBeCreated_IsCreated()
        {
            Mock <ITransactionsPage> transactionsPage = new Mock <ITransactionsPage>();
            Mock <IMobileTopupSelectOperatorPage> mobileTopupSelectOperatorPage      = new Mock <IMobileTopupSelectOperatorPage>();
            MobileTopupSelectOperatorViewModel    mobileTopupSelectOperatorViewModel = new MobileTopupSelectOperatorViewModel();
            Mock <IMobileTopupPerformTopupPage>   mobileTopupPerformTopupPage        = new Mock <IMobileTopupPerformTopupPage>();
            MobileTopupPerformTopupViewModel      mobileTopupPerformTopupViewModel   = new MobileTopupPerformTopupViewModel();
            Mock <IMobileTopupPaymentSuccessPage> mobileTopupPaymentSuccessPage      = new Mock <IMobileTopupPaymentSuccessPage>();
            Mock <IMobileTopupPaymentFailedPage>  mobileTopupPaymentFailedPage       = new Mock <IMobileTopupPaymentFailedPage>();
            Mock <IDevice> device = new Mock <IDevice>();
            Mock <ITransactionProcessorACLClient> transactionProcessorACLClient = new Mock <ITransactionProcessorACLClient>();
            Mock <IAnalysisLogger> analysisLogger = new Mock <IAnalysisLogger>();

            TransactionsPresenter transactionsPresenter = new TransactionsPresenter(transactionsPage.Object,
                                                                                    mobileTopupSelectOperatorPage.Object,
                                                                                    mobileTopupSelectOperatorViewModel,
                                                                                    mobileTopupPerformTopupPage.Object,
                                                                                    mobileTopupPerformTopupViewModel,
                                                                                    mobileTopupPaymentSuccessPage.Object,
                                                                                    mobileTopupPaymentFailedPage.Object,
                                                                                    device.Object,
                                                                                    transactionProcessorACLClient.Object,
                                                                                    analysisLogger.Object);

            transactionsPresenter.ShouldNotBeNull();
        }
示例#3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="TransactionsPresenter" /> class.
 /// </summary>
 /// <param name="transactionsPage">The transactions page.</param>
 /// <param name="mobileTopupSelectOperatorPage">The mobile topup select operator page.</param>
 /// <param name="mobileTopupSelectOperatorViewModel">The mobile topup select operator view model.</param>
 /// <param name="mobileTopupPerformTopupPage">The mobile topup perform topup page.</param>
 /// <param name="mobileTopupPerformTopupViewModel">The mobile topup perform topup view model.</param>
 /// <param name="mobileTopupPaymentSuccessPage">The mobile topup payment success page.</param>
 /// <param name="mobileTopupPaymentFailedPage">The mobile topup payment failed page.</param>
 /// <param name="device">The device.</param>
 /// <param name="transactionProcessorAclClient">The transaction processor acl client.</param>
 /// <param name="analysisLogger">The analysis logger.</param>
 public TransactionsPresenter(ITransactionsPage transactionsPage,
                              IMobileTopupSelectOperatorPage mobileTopupSelectOperatorPage,
                              MobileTopupSelectOperatorViewModel mobileTopupSelectOperatorViewModel,
                              IMobileTopupPerformTopupPage mobileTopupPerformTopupPage,
                              MobileTopupPerformTopupViewModel mobileTopupPerformTopupViewModel,
                              IMobileTopupPaymentSuccessPage mobileTopupPaymentSuccessPage,
                              IMobileTopupPaymentFailedPage mobileTopupPaymentFailedPage,
                              IDevice device,
                              ITransactionProcessorACLClient transactionProcessorAclClient,
                              IAnalysisLogger analysisLogger)
 {
     this.TransactionsPage = transactionsPage;
     this.MobileTopupSelectOperatorPage      = mobileTopupSelectOperatorPage;
     this.MobileTopupSelectOperatorViewModel = mobileTopupSelectOperatorViewModel;
     this.MobileTopupPerformTopupPage        = mobileTopupPerformTopupPage;
     this.MobileTopupPerformTopupViewModel   = mobileTopupPerformTopupViewModel;
     this.MobileTopupPaymentSuccessPage      = mobileTopupPaymentSuccessPage;
     this.MobileTopupPaymentFailedPage       = mobileTopupPaymentFailedPage;
     this.Device = device;
     this.TransactionProcessorAclClient = transactionProcessorAclClient;
     this.AnalysisLogger = analysisLogger;
 }
示例#4
0
 /// <summary>
 /// Initializes the specified view model.
 /// </summary>
 /// <param name="viewModel">The view model.</param>
 public void Init(MobileTopupSelectOperatorViewModel viewModel)
 {
     this.AnalysisLogger.TrackEvent(PageInitialisedEvent.Create(this.GetType().Name));
     this.LoadOperators(viewModel);
 }