diff --git a/TransactionProcessor.Mobile.BusinessLogic/UIServices/INavigationService.cs b/TransactionProcessor.Mobile.BusinessLogic/UIServices/INavigationService.cs
index d07ae4c08..acfe12075 100644
--- a/TransactionProcessor.Mobile.BusinessLogic/UIServices/INavigationService.cs
+++ b/TransactionProcessor.Mobile.BusinessLogic/UIServices/INavigationService.cs
@@ -62,6 +62,8 @@ Task GoToBillPaymentPayBillPage(ProductDetails productDetails,
Task GoToMyAccountContacts();
Task GoToMyAccountDetails();
+ Task GoToTransactionsPage();
+
Task GoToReportsSalesAnalysis();
Task GoToReportsBalanceAnalysis();
diff --git a/TransactionProcessor.Mobile.BusinessLogic/ViewModels/HomePageViewModel.cs b/TransactionProcessor.Mobile.BusinessLogic/ViewModels/HomePageViewModel.cs
index 9cc4b25c3..53f122250 100644
--- a/TransactionProcessor.Mobile.BusinessLogic/ViewModels/HomePageViewModel.cs
+++ b/TransactionProcessor.Mobile.BusinessLogic/ViewModels/HomePageViewModel.cs
@@ -1,18 +1,96 @@
-using System.Diagnostics.CodeAnalysis;
+using System.Diagnostics.CodeAnalysis;
+using CommunityToolkit.Mvvm.Input;
+using TransactionProcessor.Mobile.BusinessLogic.Common;
+using TransactionProcessor.Mobile.BusinessLogic.Models;
using TransactionProcessor.Mobile.BusinessLogic.Services;
using TransactionProcessor.Mobile.BusinessLogic.UIServices;
namespace TransactionProcessor.Mobile.BusinessLogic.ViewModels;
-[ExcludeFromCodeCoverage]
-public class HomePageViewModel : ExtendedBaseViewModel
+public partial class HomePageViewModel : ExtendedBaseViewModel
{
+ #region Fields
+
+ private String merchantName;
+ private String availableBalance;
+
+ #endregion
+
+ #region Constructors
+
public HomePageViewModel(IApplicationCache applicationCache,
IDialogService dialogService,
IDeviceService deviceService,
INavigationService navigationService,
- INavigationParameterService navigationParameterService) :base(applicationCache,dialogService, navigationService, deviceService,navigationParameterService)
+ INavigationParameterService navigationParameterService)
+ : base(applicationCache, dialogService, navigationService, deviceService, navigationParameterService)
+ {
+ this.Title = "Home";
+ }
+
+ #endregion
+
+ #region Properties
+
+ public String MerchantName
+ {
+ get => this.merchantName;
+ set => this.SetProperty(ref this.merchantName, value);
+ }
+
+ public String AvailableBalance
{
-
+ get => this.availableBalance;
+ set => this.SetProperty(ref this.availableBalance, value);
}
-}
\ No newline at end of file
+
+ #endregion
+
+ #region Methods
+
+ public override async Task Initialise(CancellationToken cancellationToken)
+ {
+ await base.Initialise(cancellationToken);
+
+ MerchantDetailsModel merchantDetails = this.ApplicationCache.GetMerchantDetails();
+ if (merchantDetails != null)
+ {
+ this.MerchantName = merchantDetails.MerchantName;
+ this.AvailableBalance = merchantDetails.AvailableBalance.ToString("C2");
+ }
+ else
+ {
+ this.MerchantName = String.Empty;
+ this.AvailableBalance = "-";
+ }
+ }
+
+ [RelayCommand]
+ public async Task MobileTopup()
+ {
+ CorrelationIdProvider.NewId();
+ await this.NavigationService.GoToMobileTopupSelectOperatorPage();
+ }
+
+ [RelayCommand]
+ public async Task BillPayment()
+ {
+ CorrelationIdProvider.NewId();
+ await this.NavigationService.GoToBillPaymentSelectOperatorPage();
+ }
+
+ [RelayCommand]
+ public async Task Voucher()
+ {
+ CorrelationIdProvider.NewId();
+ await this.NavigationService.GoToVoucherSelectOperatorPage();
+ }
+
+ [RelayCommand]
+ public async Task AllTransactions()
+ {
+ await this.NavigationService.GoToTransactionsPage();
+ }
+
+ #endregion
+}
diff --git a/TransactionProcessor.Mobile/Pages/AppHome/HomePage.xaml b/TransactionProcessor.Mobile/Pages/AppHome/HomePage.xaml
index ad32197be..01f907e18 100644
--- a/TransactionProcessor.Mobile/Pages/AppHome/HomePage.xaml
+++ b/TransactionProcessor.Mobile/Pages/AppHome/HomePage.xaml
@@ -4,13 +4,99 @@
x:Class="TransactionProcessor.Mobile.Pages.AppHome.HomePage"
xmlns:controls="using:TransactionProcessor.Mobile.Controls"
xmlns:common="using:TransactionProcessor.Mobile.Pages.Common"
- Shell.NavBarIsVisible="False">
-
-
-
-
-
-
-
\ No newline at end of file
+ Shell.NavBarIsVisible="False"
+ x:Name="HomeView">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TransactionProcessor.Mobile/Pages/LoginPage.xaml b/TransactionProcessor.Mobile/Pages/LoginPage.xaml
index 6dec8c24e..11477a3ce 100644
--- a/TransactionProcessor.Mobile/Pages/LoginPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/LoginPage.xaml
@@ -7,54 +7,81 @@
Shell.NavBarIsVisible="False"
Shell.FlyoutItemIsVisible="True"
x:Name="Logon">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
-
-
\ No newline at end of file
+
+
+
diff --git a/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountAddressesPage.xaml b/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountAddressesPage.xaml
index e16b0e28a..07114e21f 100644
--- a/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountAddressesPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountAddressesPage.xaml
@@ -4,42 +4,82 @@
x:Class="TransactionProcessor.Mobile.Pages.MyAccount.MyAccountAddressesPage"
xmlns:controls="clr-namespace:TransactionProcessor.Mobile.Controls"
Shell.NavBarIsVisible="False">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountContactPage.xaml b/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountContactPage.xaml
index fc5999cbf..8b7974240 100644
--- a/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountContactPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountContactPage.xaml
@@ -4,44 +4,65 @@
x:Class="TransactionProcessor.Mobile.Pages.MyAccount.MyAccountContactPage"
xmlns:controls="clr-namespace:TransactionProcessor.Mobile.Controls"
Shell.NavBarIsVisible="False">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountDetailsPage.xaml b/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountDetailsPage.xaml
index c52902387..35521c9ff 100644
--- a/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountDetailsPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountDetailsPage.xaml
@@ -4,65 +4,87 @@
x:Class="TransactionProcessor.Mobile.Pages.MyAccount.MyAccountDetailsPage"
xmlns:controls="clr-namespace:TransactionProcessor.Mobile.Controls"
Shell.NavBarIsVisible="False">
-
-
-
+
+
-
-
+
+
+
+
-
-
+
-
-
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
+
+
+
+
+
-
-
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountPage.xaml b/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountPage.xaml
index f5f62c8a9..9d65a8caf 100644
--- a/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountPage.xaml
@@ -5,40 +5,45 @@
xmlns:common="clr-namespace:TransactionProcessor.Mobile.Pages.Common"
xmlns:controls="clr-namespace:TransactionProcessor.Mobile.Controls"
Shell.NavBarIsVisible="False">
-
-
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountPage.xaml.cs b/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountPage.xaml.cs
index f8a4f0c18..25aa729e8 100644
--- a/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountPage.xaml.cs
+++ b/TransactionProcessor.Mobile/Pages/MyAccount/MyAccountPage.xaml.cs
@@ -13,9 +13,7 @@ public partial class MyAccountPage : NoBackWithoutLogoutPage
public MyAccountPage(MyAccountPageViewModel vm)
{
this.InitializeComponent();
-
BindingContext = vm;
-
}
protected override async void OnAppearing()
@@ -27,48 +25,62 @@ protected override async void OnAppearing()
private void LoadOptions(MyAccountPageViewModel viewModel)
{
- this.MyAccountOptionsList.Clear();
+ this.MyAccountOptionsList.Children.Clear();
+ this.MyAccountOptionsList.RowDefinitions.Clear();
+ var tiles = new List();
Int32 rowCount = 0;
foreach (ListViewItem modelOption in viewModel.MyAccountOptions)
{
- Button button = new Button
+ Frame tile = this.CreateTile(modelOption.Title, (Color)Application.Current.Resources["profile"], $"{modelOption.Title.Replace(" ", "")}Button");
+ TapGestureRecognizer tap = new TapGestureRecognizer
{
- Text = modelOption.Title,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- AutomationId = $"{modelOption.Title.Replace(" ", "")}Button",
- };
- button.SetDynamicResource(VisualElement.StyleProperty, "MyAccountButtonStyle");
-
- Binding commandParameter = new Binding
- {
- Source = new ItemSelected
- {
- SelectedItem = modelOption,
- SelectedItemIndex = rowCount
- }
+ Command = new Command(() => viewModel.OptionSelectedCommand.Execute(
+ new ItemSelected { SelectedItem = modelOption, SelectedItemIndex = rowCount }))
};
+ tile.GestureRecognizers.Add(tap);
+ tiles.Add(tile);
+ rowCount++;
+ }
- Binding command = new Binding
- {
- Source = viewModel.OptionSelectedCommand
- };
-
- // Create the behavior and bind it to the command
- EventToCommandBehavior behavior = new EventToCommandBehavior
+ int row = 0;
+ for (int i = 0; i < tiles.Count; i += 2)
+ {
+ this.MyAccountOptionsList.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
+ Grid.SetRow(tiles[i], row);
+ Grid.SetColumn(tiles[i], 0);
+ this.MyAccountOptionsList.Children.Add(tiles[i]);
+ if (i + 1 < tiles.Count)
{
- EventName = "Clicked"
- };
- behavior.SetBinding(EventToCommandBehavior.CommandProperty, command);
- behavior.SetBinding(EventToCommandBehavior.CommandParameterProperty, commandParameter);
-
- // Attach the behavior to the button
- button.Behaviors.Add(behavior);
-
- this.MyAccountOptionsList.Add(button);
-
- rowCount++;
+ Grid.SetRow(tiles[i + 1], row);
+ Grid.SetColumn(tiles[i + 1], 1);
+ this.MyAccountOptionsList.Children.Add(tiles[i + 1]);
+ }
+ row++;
}
}
-}
\ No newline at end of file
+ private Frame CreateTile(string text, Color backgroundColor, string automationId)
+ {
+ return new Frame
+ {
+ CornerRadius = 16,
+ HasShadow = true,
+ Padding = new Thickness(12),
+ HeightRequest = 100,
+ BackgroundColor = backgroundColor,
+ BorderColor = Colors.Transparent,
+ HorizontalOptions = LayoutOptions.FillAndExpand,
+ Content = new Label
+ {
+ Text = text,
+ TextColor = Colors.White,
+ FontAttributes = FontAttributes.Bold,
+ FontSize = 16,
+ HorizontalTextAlignment = TextAlignment.Center,
+ VerticalTextAlignment = TextAlignment.Center,
+ AutomationId = automationId
+ }
+ };
+ }
+}
diff --git a/TransactionProcessor.Mobile/Pages/Reports/ReportsBalanceAnalysisPage.xaml b/TransactionProcessor.Mobile/Pages/Reports/ReportsBalanceAnalysisPage.xaml
index 89f1bafca..1b9a39ef3 100644
--- a/TransactionProcessor.Mobile/Pages/Reports/ReportsBalanceAnalysisPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Reports/ReportsBalanceAnalysisPage.xaml
@@ -5,23 +5,38 @@
xmlns:controls="clr-namespace:TransactionProcessor.Mobile.Controls"
xmlns:liveChartsCore="clr-namespace:LiveChartsCore.SkiaSharpView.Maui;assembly=LiveChartsCore.SkiaSharpView.Maui"
Shell.NavBarIsVisible="False">
+
-
-
-
+
+
+
+
-
-
-
-
-
+
+
+
+
+
+
-
-
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TransactionProcessor.Mobile/Pages/Reports/ReportsPage.xaml b/TransactionProcessor.Mobile/Pages/Reports/ReportsPage.xaml
index cf021724c..99f365b72 100644
--- a/TransactionProcessor.Mobile/Pages/Reports/ReportsPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Reports/ReportsPage.xaml
@@ -5,11 +5,19 @@
xmlns:common="clr-namespace:TransactionProcessor.Mobile.Pages.Common"
x:Class="TransactionProcessor.Mobile.Pages.Reports.ReportsPage"
Shell.NavBarIsVisible="False">
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
\ No newline at end of file
+
+
+
+
diff --git a/TransactionProcessor.Mobile/Pages/Reports/ReportsPage.xaml.cs b/TransactionProcessor.Mobile/Pages/Reports/ReportsPage.xaml.cs
index 87a0b9513..dcda1564f 100644
--- a/TransactionProcessor.Mobile/Pages/Reports/ReportsPage.xaml.cs
+++ b/TransactionProcessor.Mobile/Pages/Reports/ReportsPage.xaml.cs
@@ -11,8 +11,8 @@ public partial class ReportsPage : NoBackWithoutLogoutPage
private ReportsPageViewModel viewModel => BindingContext as ReportsPageViewModel;
public ReportsPage(ReportsPageViewModel vm)
- {
- this.InitializeComponent();
+{
+this.InitializeComponent();
BindingContext = vm;
}
@@ -25,67 +25,76 @@ protected override async void OnAppearing()
private void LoadProducts(ReportsPageViewModel viewModel)
{
- this.ReportsList.Clear();
+ this.ReportsList.Children.Clear();
+ this.ReportsList.RowDefinitions.Clear();
+ var tiles = new List();
Int32 rowCount = 0;
foreach (ListViewItem modelOption in viewModel.ReportsMenuOptions)
{
- Button button = new Button
- {
- Text = modelOption.Title,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- AutomationId = $"{modelOption.Title.Replace(" ", "")}Button",
- };
- button.SetDynamicResource(VisualElement.StyleProperty, "ReportsButtonStyle");
-
- Binding commandParameter = new Binding
- {
- Source = new ItemSelected
- {
- SelectedItem = modelOption,
- SelectedItemIndex = rowCount
- }
- };
-
- Binding command = new Binding("OptionSelectedCommand", source: this.viewModel);
-
- // Create the behavior and bind it to the command
- EventToCommandBehavior behavior = new EventToCommandBehavior
+ Frame tile = this.CreateTile(modelOption.Title, (Color)Application.Current.Resources["reports"], $"{modelOption.Title.Replace(" ", "")}Button");
+ TapGestureRecognizer tap = new TapGestureRecognizer
{
- EventName = "Clicked"
+ Command = new Command(() => viewModel.OptionSelectedCommand.Execute(
+ new ItemSelected { SelectedItem = modelOption, SelectedItemIndex = rowCount }))
};
- behavior.SetBinding(EventToCommandBehavior.CommandProperty, command);
- behavior.SetBinding(EventToCommandBehavior.CommandParameterProperty, commandParameter);
-
- // Attach the behavior to the button
- button.Behaviors.Add(behavior);
-
+ tile.GestureRecognizers.Add(tap);
+ tiles.Add(tile);
rowCount++;
- this.ReportsList.Add(button);
+ }
+ int row = 0;
+ for (int i = 0; i < tiles.Count; i += 2)
+ {
+ this.ReportsList.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
+ Grid.SetRow(tiles[i], row);
+ Grid.SetColumn(tiles[i], 0);
+ this.ReportsList.Children.Add(tiles[i]);
+ if (i + 1 < tiles.Count)
+ {
+ Grid.SetRow(tiles[i + 1], row);
+ Grid.SetColumn(tiles[i + 1], 1);
+ this.ReportsList.Children.Add(tiles[i + 1]);
+ }
+ row++;
}
- this.ReportsList.Add(this.AddBackButton());
+ Frame backTile = this.CreateBackTile(viewModel.BackButtonCommand);
+ this.ReportsList.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
+ Grid.SetRow(backTile, row);
+ Grid.SetColumn(backTile, 0);
+ Grid.SetColumnSpan(backTile, 2);
+ this.ReportsList.Children.Add(backTile);
}
- private Button AddBackButton()
+ private Frame CreateTile(string text, Color backgroundColor, string automationId)
{
- Button button = new Button
+ return new Frame
{
- Text = "Back",
+ CornerRadius = 16,
+ HasShadow = true,
+ Padding = new Thickness(12),
+ HeightRequest = 100,
+ BackgroundColor = backgroundColor,
+ BorderColor = Colors.Transparent,
HorizontalOptions = LayoutOptions.FillAndExpand,
- AutomationId = "BackButton",
- };
- button.SetDynamicResource(VisualElement.StyleProperty, "ReportsButtonStyle");
-
- Binding backButtonCommand = new Binding
- {
- Source = this.viewModel.BackButtonCommand
+ Content = new Label
+ {
+ Text = text,
+ TextColor = Colors.White,
+ FontAttributes = FontAttributes.Bold,
+ FontSize = 16,
+ HorizontalTextAlignment = TextAlignment.Center,
+ VerticalTextAlignment = TextAlignment.Center,
+ AutomationId = automationId
+ }
};
-
- button.SetBinding(Button.CommandProperty, backButtonCommand);
-
- return button;
}
-}
\ No newline at end of file
+ private Frame CreateBackTile(System.Windows.Input.ICommand command)
+ {
+ Frame frame = this.CreateTile("Back", (Color)Application.Current.Resources["MidGray"], "BackButton");
+ frame.GestureRecognizers.Add(new TapGestureRecognizer { Command = command });
+ return frame;
+ }
+}
diff --git a/TransactionProcessor.Mobile/Pages/Reports/ReportsSalesAnalysisPage.xaml b/TransactionProcessor.Mobile/Pages/Reports/ReportsSalesAnalysisPage.xaml
index 15a5dcc0c..2557ae003 100644
--- a/TransactionProcessor.Mobile/Pages/Reports/ReportsSalesAnalysisPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Reports/ReportsSalesAnalysisPage.xaml
@@ -10,100 +10,102 @@
-
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ SelectedItem="{Binding SelectedItem}"
+ TextColor="{StaticResource labelTextColor}">
+ BindingContext="{Binding Source={x:Reference SalesAnalysisPage}, Path=BindingContext}"/>
+
-
-
-
-
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TransactionProcessor.Mobile/Pages/Support/SupportPage.xaml b/TransactionProcessor.Mobile/Pages/Support/SupportPage.xaml
index 858b6a53d..851cfd722 100644
--- a/TransactionProcessor.Mobile/Pages/Support/SupportPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Support/SupportPage.xaml
@@ -7,45 +7,59 @@
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
Shell.NavBarIsVisible="False"
x:Name="Support">
-
-
+
+
-
-
-
-
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
+
-
+
+
+
+
+
+
+
-
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/Support/ViewLogsPage.xaml b/TransactionProcessor.Mobile/Pages/Support/ViewLogsPage.xaml
index 0f47fb33d..a5e09f1e4 100644
--- a/TransactionProcessor.Mobile/Pages/Support/ViewLogsPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Support/ViewLogsPage.xaml
@@ -1,25 +1,46 @@
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/Admin/AdminPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/Admin/AdminPage.xaml
index 3b3886e3b..8076fe588 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/Admin/AdminPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Transactions/Admin/AdminPage.xaml
@@ -6,20 +6,36 @@
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
Shell.NavBarIsVisible="False"
x:Name="Admin">
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentFailedPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentFailedPage.xaml
index ded937e65..04c901b5f 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentFailedPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentFailedPage.xaml
@@ -6,29 +6,42 @@
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
Shell.NavBarIsVisible="False"
x:Name="BillPaymentFailed">
-
-
-
-
-
+
+
-
+
+
+
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentGetAccountPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentGetAccountPage.xaml
index d26a874d1..7dfc60a19 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentGetAccountPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentGetAccountPage.xaml
@@ -6,33 +6,53 @@
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
Shell.NavBarIsVisible="False"
x:Name="BillPaymentGetAccount">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentGetMeterPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentGetMeterPage.xaml
index 31d223e35..3bc7812d4 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentGetMeterPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentGetMeterPage.xaml
@@ -6,34 +6,53 @@
x:Class="TransactionProcessor.Mobile.Pages.Transactions.BillPayment.BillPaymentGetMeterPage"
Shell.NavBarIsVisible="False"
x:Name="BillPaymentGetMeter">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentPayBillPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentPayBillPage.xaml
index 5d97c4d15..b024fbf0c 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentPayBillPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentPayBillPage.xaml
@@ -6,89 +6,117 @@
xmlns:controls="clr-namespace:TransactionProcessor.Mobile.Controls"
Shell.NavBarIsVisible="False"
x:Name="BillPaymentPayBill">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
-
+
+
+
-
-
-
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentPayBillPage.xaml.cs b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentPayBillPage.xaml.cs
index 56d64cd9d..ae15c898b 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentPayBillPage.xaml.cs
+++ b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentPayBillPage.xaml.cs
@@ -16,7 +16,6 @@ public BillPaymentPayBillPage(BillPaymentPayBillPageViewModel vm)
};
vm.OnPaymentAmountEntryCompleted = () =>
{
- this.MakePaymentButton.Focus();
};
}
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentSelectOperatorPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentSelectOperatorPage.xaml
index dc2254b32..a08105feb 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentSelectOperatorPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentSelectOperatorPage.xaml
@@ -4,14 +4,18 @@
x:Class="TransactionProcessor.Mobile.Pages.Transactions.BillPayment.BillPaymentSelectOperatorPage"
xmlns:controls="clr-namespace:TransactionProcessor.Mobile.Controls"
Shell.NavBarIsVisible="False">
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentSelectOperatorPage.xaml.cs b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentSelectOperatorPage.xaml.cs
index e5aa1e577..230eb7a6c 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentSelectOperatorPage.xaml.cs
+++ b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentSelectOperatorPage.xaml.cs
@@ -9,9 +9,9 @@ public partial class BillPaymentSelectOperatorPage : ContentPage
{
private BillPaymentSelectOperatorPageViewModel viewModel => this.BindingContext as BillPaymentSelectOperatorPageViewModel;
- public BillPaymentSelectOperatorPage(BillPaymentSelectOperatorPageViewModel vm)
- {
- this.InitializeComponent();
+public BillPaymentSelectOperatorPage(BillPaymentSelectOperatorPageViewModel vm)
+{
+this.InitializeComponent();
this.BindingContext = vm;
}
@@ -25,58 +25,75 @@ protected override async void OnAppearing()
private void LoadOperators(BillPaymentSelectOperatorPageViewModel viewModel)
{
this.OperatorList.Children.Clear();
-
+ this.OperatorList.RowDefinitions.Clear();
+
+ var tiles = new List();
Int32 rowCount = 0;
foreach (ContractOperatorModel modelOperator in viewModel.Operators)
{
- Button button = new Button
- {
- Text = modelOperator.OperatorName,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- AutomationId = modelOperator.OperatorName,
- };
- button.SetDynamicResource(VisualElement.StyleProperty, "BillPaymentButtonStyle");
-
- Binding commandParameter = new Binding { Source = new ItemSelected() { SelectedItem = modelOperator, SelectedItemIndex = rowCount } };
-
- Binding command = new Binding("OperatorSelectedCommand", source: this.viewModel);
-
- // Create the behavior and bind it to the command
- EventToCommandBehavior behavior = new EventToCommandBehavior
+ Frame tile = this.CreateTile(modelOperator.OperatorName, (Color)Application.Current.Resources["billPayment"], modelOperator.OperatorName.Replace(" ", ""));
+ TapGestureRecognizer tap = new TapGestureRecognizer
{
- EventName = "Clicked"
+ Command = new Command(() => viewModel.OperatorSelectedCommand.Execute(
+ new ItemSelected { SelectedItem = modelOperator, SelectedItemIndex = rowCount }))
};
- behavior.SetBinding(EventToCommandBehavior.CommandProperty, command);
- behavior.SetBinding(EventToCommandBehavior.CommandParameterProperty, commandParameter);
-
- // Attach the behavior to the button
- button.Behaviors.Add(behavior);
-
- this.OperatorList.Add(button);
-
+ tile.GestureRecognizers.Add(tap);
+ tiles.Add(tile);
rowCount++;
}
- this.OperatorList.Add(this.AddBackButton());
-
- }
- private Button AddBackButton()
- {
- Button button = new Button
- {
- Text = "Back",
- HorizontalOptions = LayoutOptions.FillAndExpand,
- AutomationId = "BackButton",
- };
- button.SetDynamicResource(VisualElement.StyleProperty, "BillPaymentButtonStyle");
+ int row = 0;
+ for (int i = 0; i < tiles.Count; i += 2)
+ {
+ this.OperatorList.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
+ Grid.SetRow(tiles[i], row);
+ Grid.SetColumn(tiles[i], 0);
+ this.OperatorList.Children.Add(tiles[i]);
+ if (i + 1 < tiles.Count)
+ {
+ Grid.SetRow(tiles[i + 1], row);
+ Grid.SetColumn(tiles[i + 1], 1);
+ this.OperatorList.Children.Add(tiles[i + 1]);
+ }
+ row++;
+ }
- Binding backButtonCommand = new Binding
- {
- Source = this.viewModel.BackButtonCommand
- };
+ Frame backTile = this.CreateBackTile(viewModel.BackButtonCommand);
+ this.OperatorList.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
+ Grid.SetRow(backTile, row);
+ Grid.SetColumn(backTile, 0);
+ Grid.SetColumnSpan(backTile, 2);
+ this.OperatorList.Children.Add(backTile);
+ }
- button.SetBinding(Button.CommandProperty, backButtonCommand);
+ private Frame CreateTile(string text, Color backgroundColor, string automationId)
+ {
+ return new Frame
+ {
+ CornerRadius = 16,
+ HasShadow = true,
+ Padding = new Thickness(12),
+ HeightRequest = 100,
+ BackgroundColor = backgroundColor,
+ BorderColor = Colors.Transparent,
+ HorizontalOptions = LayoutOptions.FillAndExpand,
+ Content = new Label
+ {
+ Text = text,
+ TextColor = Colors.White,
+ FontAttributes = FontAttributes.Bold,
+ FontSize = 16,
+ HorizontalTextAlignment = TextAlignment.Center,
+ VerticalTextAlignment = TextAlignment.Center,
+ AutomationId = automationId
+ }
+ };
+ }
- return button;
+ private Frame CreateBackTile(System.Windows.Input.ICommand command)
+ {
+ Frame frame = this.CreateTile("Back", (Color)Application.Current.Resources["MidGray"], "BackButton");
+ frame.GestureRecognizers.Add(new TapGestureRecognizer { Command = command });
+ return frame;
}
-}
\ No newline at end of file
+}
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentSelectProductPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentSelectProductPage.xaml
index 207ee6f72..3730ff331 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentSelectProductPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentSelectProductPage.xaml
@@ -1,17 +1,21 @@
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentSelectProductPage.xaml.cs b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentSelectProductPage.xaml.cs
index 79fd14f3a..0de392e55 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentSelectProductPage.xaml.cs
+++ b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentSelectProductPage.xaml.cs
@@ -9,9 +9,9 @@ public partial class BillPaymentSelectProductPage : ContentPage
{
private BillPaymentSelectProductPageViewModel viewModel => this.BindingContext as BillPaymentSelectProductPageViewModel;
- public BillPaymentSelectProductPage(BillPaymentSelectProductPageViewModel vm)
- {
- this.InitializeComponent();
+public BillPaymentSelectProductPage(BillPaymentSelectProductPageViewModel vm)
+{
+this.InitializeComponent();
this.BindingContext = vm;
}
@@ -25,57 +25,75 @@ protected override async void OnAppearing()
private void LoadProducts(BillPaymentSelectProductPageViewModel viewModel)
{
this.ProductsList.Children.Clear();
+ this.ProductsList.RowDefinitions.Clear();
+ var tiles = new List();
Int32 rowCount = 0;
foreach (ContractProductModel modelProduct in viewModel.Products)
{
- Button button = new Button
+ Frame tile = this.CreateTile(modelProduct.ProductDisplayText, (Color)Application.Current.Resources["billPayment"], modelProduct.ProductDisplayText.Replace(" ", ""));
+ TapGestureRecognizer tap = new TapGestureRecognizer
{
- Text = modelProduct.ProductDisplayText,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- AutomationId = modelProduct.ProductDisplayText,
+ Command = new Command(() => viewModel.ProductSelectedCommand.Execute(
+ new ItemSelected { SelectedItem = modelProduct, SelectedItemIndex = rowCount }))
};
- button.SetDynamicResource(VisualElement.StyleProperty, "BillPaymentButtonStyle");
-
- Binding commandParameter = new Binding { Source = new ItemSelected() { SelectedItem = modelProduct, SelectedItemIndex = rowCount } };
-
- Binding command = new Binding("ProductSelectedCommand", source: this.viewModel);
+ tile.GestureRecognizers.Add(tap);
+ tiles.Add(tile);
+ rowCount++;
+ }
- // Create the behavior and bind it to the command
- EventToCommandBehavior behavior = new EventToCommandBehavior
+ int row = 0;
+ for (int i = 0; i < tiles.Count; i += 2)
+ {
+ this.ProductsList.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
+ Grid.SetRow(tiles[i], row);
+ Grid.SetColumn(tiles[i], 0);
+ this.ProductsList.Children.Add(tiles[i]);
+ if (i + 1 < tiles.Count)
{
- EventName = "Clicked"
- };
- behavior.SetBinding(EventToCommandBehavior.CommandProperty, command);
- behavior.SetBinding(EventToCommandBehavior.CommandParameterProperty, commandParameter);
-
- // Attach the behavior to the button
- button.Behaviors.Add(behavior);
-
- this.ProductsList.Add(button);
-
- rowCount++;
+ Grid.SetRow(tiles[i + 1], row);
+ Grid.SetColumn(tiles[i + 1], 1);
+ this.ProductsList.Children.Add(tiles[i + 1]);
+ }
+ row++;
}
- this.ProductsList.Add(this.AddBackButton());
+
+ Frame backTile = this.CreateBackTile(viewModel.BackButtonCommand);
+ this.ProductsList.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
+ Grid.SetRow(backTile, row);
+ Grid.SetColumn(backTile, 0);
+ Grid.SetColumnSpan(backTile, 2);
+ this.ProductsList.Children.Add(backTile);
}
- private Button AddBackButton()
+ private Frame CreateTile(string text, Color backgroundColor, string automationId)
{
- Button button = new Button
- {
- Text = "Back",
- HorizontalOptions = LayoutOptions.FillAndExpand,
- AutomationId = "BackButton",
- };
- button.SetDynamicResource(VisualElement.StyleProperty, "BillPaymentButtonStyle");
-
- Binding backButtonCommand = new Binding
- {
- Source = this.viewModel.BackButtonCommand
- };
-
- button.SetBinding(Button.CommandProperty, backButtonCommand);
+ return new Frame
+ {
+ CornerRadius = 16,
+ HasShadow = true,
+ Padding = new Thickness(12),
+ HeightRequest = 100,
+ BackgroundColor = backgroundColor,
+ BorderColor = Colors.Transparent,
+ HorizontalOptions = LayoutOptions.FillAndExpand,
+ Content = new Label
+ {
+ Text = text,
+ TextColor = Colors.White,
+ FontAttributes = FontAttributes.Bold,
+ FontSize = 16,
+ HorizontalTextAlignment = TextAlignment.Center,
+ VerticalTextAlignment = TextAlignment.Center,
+ AutomationId = automationId
+ }
+ };
+ }
- return button;
+ private Frame CreateBackTile(System.Windows.Input.ICommand command)
+ {
+ Frame frame = this.CreateTile("Back", (Color)Application.Current.Resources["MidGray"], "BackButton");
+ frame.GestureRecognizers.Add(new TapGestureRecognizer { Command = command });
+ return frame;
}
-}
\ No newline at end of file
+}
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentSuccessPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentSuccessPage.xaml
index f8ca3035b..89b07b9b5 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentSuccessPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Transactions/BillPayment/BillPaymentSuccessPage.xaml
@@ -6,29 +6,52 @@
x:Class="TransactionProcessor.Mobile.Pages.Transactions.BillPayment.BillPaymentSuccessPage"
Shell.NavBarIsVisible="False"
x:Name="BillPaymentSuccess">
-
-
-
-
-
+
+
-
+
+
+
+
-
-
+
-
-
-
-
-
+
+
+
+
+
+
+
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupFailedPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupFailedPage.xaml
index 1b84bf956..56caed5d8 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupFailedPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupFailedPage.xaml
@@ -6,28 +6,43 @@
x:Class="TransactionProcessor.Mobile.Pages.Transactions.MobileTopup.MobileTopupFailedPage"
Shell.NavBarIsVisible="False"
x:Name="MobileTopupFailed">
-
-
-
-
-
+
+
-
+
+
+
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupPerformTopupPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupPerformTopupPage.xaml
index 66c2d24cb..9a0772a1d 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupPerformTopupPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupPerformTopupPage.xaml
@@ -6,62 +6,92 @@
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
Shell.NavBarIsVisible="False"
x:Name="MobileTopPerformTopup">
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
+
+
+
+
-
-
-
-
-
+
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupPerformTopupPage.xaml.cs b/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupPerformTopupPage.xaml.cs
index b679ff368..a73369282 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupPerformTopupPage.xaml.cs
+++ b/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupPerformTopupPage.xaml.cs
@@ -27,7 +27,6 @@ public MobileTopupPerformTopupPage(MobileTopupPerformTopupPageViewModel vm)
};
vm.OnCustomerEmailAddressEntryCompleted = () =>
{
- this.PerformTopupButton.Focus();
};
}
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupSelectOperatorPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupSelectOperatorPage.xaml
index 0cd0e2cbe..4028e6f5f 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupSelectOperatorPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupSelectOperatorPage.xaml
@@ -4,13 +4,18 @@
x:Class="TransactionProcessor.Mobile.Pages.Transactions.MobileTopup.MobileTopupSelectOperatorPage"
xmlns:controls="clr-namespace:TransactionProcessor.Mobile.Controls"
Shell.NavBarIsVisible="False">
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupSelectOperatorPage.xaml.cs b/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupSelectOperatorPage.xaml.cs
index 4506af51a..856361ccc 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupSelectOperatorPage.xaml.cs
+++ b/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupSelectOperatorPage.xaml.cs
@@ -9,9 +9,9 @@ public partial class MobileTopupSelectOperatorPage : ContentPage
{
private MobileTopupSelectOperatorPageViewModel viewModel => this.BindingContext as MobileTopupSelectOperatorPageViewModel;
- public MobileTopupSelectOperatorPage(MobileTopupSelectOperatorPageViewModel vm)
- {
- this.InitializeComponent();
+public MobileTopupSelectOperatorPage(MobileTopupSelectOperatorPageViewModel vm)
+{
+this.InitializeComponent();
this.BindingContext = vm;
}
@@ -25,79 +25,75 @@ protected override async void OnAppearing()
private void LoadOperators(MobileTopupSelectOperatorPageViewModel viewModel)
{
this.OperatorList.Children.Clear();
+ this.OperatorList.RowDefinitions.Clear();
+ var tiles = new List();
Int32 rowCount = 0;
foreach (ContractOperatorModel modelOperator in viewModel.Operators)
{
- Button button = new Button
- {
- Text = modelOperator.OperatorName,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- AutomationId = modelOperator.OperatorName,
- };
- button.SetDynamicResource(VisualElement.StyleProperty, "MobileTopupButtonStyle");
- //Binding commandParameter = new Binding()
- // {
- // Source = new ItemSelected(){
- // SelectedItem = modelOperator,
- // SelectedItemIndex = rowCount
- // }
- // };
-
- //Binding command = new Binding
- // {
- // Source = viewModel.OperatorSelectedCommand
- // };
-
- //button.SetBinding(Button.CommandProperty, command);
- //button.SetBinding(Button.CommandParameterProperty, commandParameter);
-
- Binding commandParameter = new Binding
+ Frame tile = this.CreateTile(modelOperator.OperatorName, (Color)Application.Current.Resources["mobileTopup"], modelOperator.OperatorName.Replace(" ", ""));
+ TapGestureRecognizer tap = new TapGestureRecognizer
{
- Source = new ItemSelected
- {
- SelectedItem = modelOperator,
- SelectedItemIndex = rowCount
- }
+ Command = new Command(() => viewModel.OperatorSelectedCommand.Execute(
+ new ItemSelected { SelectedItem = modelOperator, SelectedItemIndex = rowCount }))
};
+ tile.GestureRecognizers.Add(tap);
+ tiles.Add(tile);
+ rowCount++;
+ }
- Binding command = new Binding("OperatorSelectedCommand", source: this.viewModel);
-
- // Create the behavior and bind it to the command
- EventToCommandBehavior behavior = new EventToCommandBehavior
+ int row = 0;
+ for (int i = 0; i < tiles.Count; i += 2)
+ {
+ this.OperatorList.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
+ Grid.SetRow(tiles[i], row);
+ Grid.SetColumn(tiles[i], 0);
+ this.OperatorList.Children.Add(tiles[i]);
+ if (i + 1 < tiles.Count)
{
- EventName = "Clicked",
- };
- behavior.SetBinding(EventToCommandBehavior.CommandProperty, command);
- behavior.SetBinding(EventToCommandBehavior.CommandParameterProperty, commandParameter);
-
- // Attach the behavior to the button
- button.Behaviors.Add(behavior);
-
- this.OperatorList.Children.Add(button);
-
- rowCount++;
+ Grid.SetRow(tiles[i + 1], row);
+ Grid.SetColumn(tiles[i + 1], 1);
+ this.OperatorList.Children.Add(tiles[i + 1]);
+ }
+ row++;
}
- this.OperatorList.Children.Add(this.AddBackButton());
+ Frame backTile = this.CreateBackTile(viewModel.BackButtonCommand);
+ this.OperatorList.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
+ Grid.SetRow(backTile, row);
+ Grid.SetColumn(backTile, 0);
+ Grid.SetColumnSpan(backTile, 2);
+ this.OperatorList.Children.Add(backTile);
}
- private Button AddBackButton() {
- Button button = new Button
- {
- Text = "Back",
- HorizontalOptions = LayoutOptions.FillAndExpand,
- AutomationId = "BackButton",
- };
- button.SetDynamicResource(VisualElement.StyleProperty, "MobileTopupButtonStyle");
-
- Binding backButtonCommand = new Binding
- {
- Source = this.viewModel.BackButtonCommand
- };
-
- button.SetBinding(Button.CommandProperty, backButtonCommand);
+ private Frame CreateTile(string text, Color backgroundColor, string automationId)
+ {
+ return new Frame
+ {
+ CornerRadius = 16,
+ HasShadow = true,
+ Padding = new Thickness(12),
+ HeightRequest = 100,
+ BackgroundColor = backgroundColor,
+ BorderColor = Colors.Transparent,
+ HorizontalOptions = LayoutOptions.FillAndExpand,
+ Content = new Label
+ {
+ Text = text,
+ TextColor = Colors.White,
+ FontAttributes = FontAttributes.Bold,
+ FontSize = 16,
+ HorizontalTextAlignment = TextAlignment.Center,
+ VerticalTextAlignment = TextAlignment.Center,
+ AutomationId = automationId
+ }
+ };
+ }
- return button;
+ private Frame CreateBackTile(System.Windows.Input.ICommand command)
+ {
+ Frame frame = this.CreateTile("Back", (Color)Application.Current.Resources["MidGray"], "BackButton");
+ frame.GestureRecognizers.Add(new TapGestureRecognizer { Command = command });
+ return frame;
}
-}
\ No newline at end of file
+}
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupSelectProductPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupSelectProductPage.xaml
index 759d5e820..c17bd7ff9 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupSelectProductPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupSelectProductPage.xaml
@@ -4,14 +4,18 @@
xmlns:controls="clr-namespace:TransactionProcessor.Mobile.Controls"
x:Class="TransactionProcessor.Mobile.Pages.Transactions.MobileTopup.MobileTopupSelectProductPage"
Shell.NavBarIsVisible="False">
-
-
-
-
+
+
-
-
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupSelectProductPage.xaml.cs b/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupSelectProductPage.xaml.cs
index 31fa5ba7b..8a8e91a15 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupSelectProductPage.xaml.cs
+++ b/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupSelectProductPage.xaml.cs
@@ -31,66 +31,77 @@ protected override async void OnAppearing() {
}
private void LoadProducts(MobileTopupSelectProductPageViewModel viewModel) {
- this.ProductsList.Clear();
+ this.ProductsList.Children.Clear();
+ this.ProductsList.RowDefinitions.Clear();
+ var tiles = new List();
Int32 rowCount = 0;
foreach (ContractProductModel modelProduct in viewModel.Products) {
- Button button = new Button {
- Text = modelProduct.ProductDisplayText,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- AutomationId = modelProduct.ProductDisplayText,
- };
- button.SetDynamicResource(VisualElement.StyleProperty, "MobileTopupButtonStyle");
-
- Binding commandParameter = new Binding
+ Frame tile = this.CreateTile(modelProduct.ProductDisplayText, (Color)Application.Current.Resources["mobileTopup"], modelProduct.ProductDisplayText.Replace(" ", ""));
+ TapGestureRecognizer tap = new TapGestureRecognizer
{
- Source = new ItemSelected
- {
- SelectedItem = modelProduct,
- SelectedItemIndex = rowCount
- }
+ Command = new Command(() => viewModel.ProductSelectedCommand.Execute(
+ new ItemSelected { SelectedItem = modelProduct, SelectedItemIndex = rowCount }))
};
+ tile.GestureRecognizers.Add(tap);
+ tiles.Add(tile);
+ rowCount++;
+ }
- Binding command = new Binding("ProductSelectedCommand", source: this.viewModel);
-
- // Create the behavior and bind it to the command
- EventToCommandBehavior behavior = new EventToCommandBehavior
+ int row = 0;
+ for (int i = 0; i < tiles.Count; i += 2)
+ {
+ this.ProductsList.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
+ Grid.SetRow(tiles[i], row);
+ Grid.SetColumn(tiles[i], 0);
+ this.ProductsList.Children.Add(tiles[i]);
+ if (i + 1 < tiles.Count)
{
- EventName = "Clicked"
- };
- behavior.SetBinding(EventToCommandBehavior.CommandProperty, command);
- behavior.SetBinding(EventToCommandBehavior.CommandParameterProperty, commandParameter);
-
- // Attach the behavior to the button
- button.Behaviors.Add(behavior);
-
- this.ProductsList.Add(button);
-
- rowCount++;
+ Grid.SetRow(tiles[i + 1], row);
+ Grid.SetColumn(tiles[i + 1], 1);
+ this.ProductsList.Children.Add(tiles[i + 1]);
+ }
+ row++;
}
- this.ProductsList.Add(this.AddBackButton());
+ Frame backTile = this.CreateBackTile(viewModel.BackButtonCommand);
+ this.ProductsList.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
+ Grid.SetRow(backTile, row);
+ Grid.SetColumn(backTile, 0);
+ Grid.SetColumnSpan(backTile, 2);
+ this.ProductsList.Children.Add(backTile);
+ }
+
+ private Frame CreateTile(string text, Color backgroundColor, string automationId)
+ {
+ return new Frame
+ {
+ CornerRadius = 16,
+ HasShadow = true,
+ Padding = new Thickness(12),
+ HeightRequest = 100,
+ BackgroundColor = backgroundColor,
+ BorderColor = Colors.Transparent,
+ HorizontalOptions = LayoutOptions.FillAndExpand,
+ Content = new Label
+ {
+ Text = text,
+ TextColor = Colors.White,
+ FontAttributes = FontAttributes.Bold,
+ FontSize = 16,
+ HorizontalTextAlignment = TextAlignment.Center,
+ VerticalTextAlignment = TextAlignment.Center,
+ AutomationId = automationId
+ }
+ };
}
- private Button AddBackButton()
+ private Frame CreateBackTile(System.Windows.Input.ICommand command)
{
- Button button = new Button
- {
- Text = "Back",
- HorizontalOptions = LayoutOptions.FillAndExpand,
- AutomationId = "BackButton",
- };
- button.SetDynamicResource(VisualElement.StyleProperty, "MobileTopupButtonStyle");
-
- Binding backButtonCommand = new Binding
- {
- Source = this.viewModel.BackButtonCommand
- };
-
- button.SetBinding(Button.CommandProperty, backButtonCommand);
-
- return button;
+ Frame frame = this.CreateTile("Back", (Color)Application.Current.Resources["MidGray"], "BackButton");
+ frame.GestureRecognizers.Add(new TapGestureRecognizer { Command = command });
+ return frame;
}
#endregion
-}
\ No newline at end of file
+}
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupSuccessPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupSuccessPage.xaml
index 5555520c9..d0b62486a 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupSuccessPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Transactions/MobileTopup/MobileTopupSuccessPage.xaml
@@ -6,28 +6,53 @@
x:Class="TransactionProcessor.Mobile.Pages.Transactions.MobileTopup.MobileTopupSuccessPage"
Shell.NavBarIsVisible="False"
x:Name="MobileTopupSuccess">
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/TransactionsPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/TransactionsPage.xaml
index bb0e3a449..4f27e5043 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/TransactionsPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Transactions/TransactionsPage.xaml
@@ -7,51 +7,95 @@
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
Shell.NavBarIsVisible="False"
x:Name="Transactions">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherIssueFailedPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherIssueFailedPage.xaml
index 4fa26fb84..255ac7bff 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherIssueFailedPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherIssueFailedPage.xaml
@@ -6,29 +6,42 @@
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
Shell.NavBarIsVisible="False"
x:Name="VoucherIssueFailed">
-
-
-
-
-
+
+
-
+
+
+
+
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherIssueSuccessPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherIssueSuccessPage.xaml
index 564eb27e5..fb041d8d9 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherIssueSuccessPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherIssueSuccessPage.xaml
@@ -6,29 +6,52 @@
x:Class="TransactionProcessor.Mobile.Pages.Transactions.Voucher.VoucherIssueSuccessPage"
Shell.NavBarIsVisible="False"
x:Name="VoucherIssueSuccess">
-
-
-
-
-
+
+
-
+
+
+
+
-
-
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherPerformIssuePage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherPerformIssuePage.xaml
index 7101bac40..f6651ffdf 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherPerformIssuePage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherPerformIssuePage.xaml
@@ -6,76 +6,108 @@
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
Shell.NavBarIsVisible="False"
x:Name="VoucherPerformIssue">
-
-
-
-
-
-
-
-
-
-
+
+
-
-
-
-
-
+
+
+
+
-
-
-
-
-
+
-
-
-
-
-
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherPerformIssuePage.xaml.cs b/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherPerformIssuePage.xaml.cs
index 133be6785..542b51697 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherPerformIssuePage.xaml.cs
+++ b/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherPerformIssuePage.xaml.cs
@@ -38,7 +38,6 @@ public VoucherPerformIssuePage(VoucherPerformIssuePageViewModel vm)
};
vm.OnCustomerEmailAddressEntryCompleted = () =>
{
- this.IssueVoucherButton.Focus();
};
}
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherSelectOperatorPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherSelectOperatorPage.xaml
index a7f1298d5..96682cbdc 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherSelectOperatorPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherSelectOperatorPage.xaml
@@ -4,14 +4,18 @@
x:Class="TransactionProcessor.Mobile.Pages.Transactions.Voucher.VoucherSelectOperatorPage"
xmlns:controls="clr-namespace:TransactionProcessor.Mobile.Controls"
Shell.NavBarIsVisible="False">
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherSelectOperatorPage.xaml.cs b/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherSelectOperatorPage.xaml.cs
index 29ab6f6c8..4ebaf18ba 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherSelectOperatorPage.xaml.cs
+++ b/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherSelectOperatorPage.xaml.cs
@@ -9,9 +9,9 @@ public partial class VoucherSelectOperatorPage : ContentPage
{
private VoucherSelectOperatorPageViewModel viewModel => this.BindingContext as VoucherSelectOperatorPageViewModel;
- public VoucherSelectOperatorPage(VoucherSelectOperatorPageViewModel vm)
- {
- this.InitializeComponent();
+public VoucherSelectOperatorPage(VoucherSelectOperatorPageViewModel vm)
+{
+this.InitializeComponent();
this.BindingContext = vm;
}
@@ -25,65 +25,75 @@ protected override async void OnAppearing()
private void LoadOperators(VoucherSelectOperatorPageViewModel viewModel)
{
this.OperatorList.Children.Clear();
-
+ this.OperatorList.RowDefinitions.Clear();
+
+ var tiles = new List();
Int32 rowCount = 0;
foreach (ContractOperatorModel modelOperator in viewModel.Operators)
{
- Button button = new Button
- {
- Text = modelOperator.OperatorName,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- AutomationId = modelOperator.OperatorName,
- };
- button.SetDynamicResource(VisualElement.StyleProperty, "VoucherButtonStyle");
-
- Binding commandParameter = new Binding
+ Frame tile = this.CreateTile(modelOperator.OperatorName, (Color)Application.Current.Resources["voucher"], modelOperator.OperatorName.Replace(" ", ""));
+ TapGestureRecognizer tap = new TapGestureRecognizer
{
- Source = new ItemSelected
- {
- SelectedItem = modelOperator,
- SelectedItemIndex = rowCount
- }
+ Command = new Command(() => viewModel.OperatorSelectedCommand.Execute(
+ new ItemSelected { SelectedItem = modelOperator, SelectedItemIndex = rowCount }))
};
+ tile.GestureRecognizers.Add(tap);
+ tiles.Add(tile);
+ rowCount++;
+ }
- Binding command = new Binding("OperatorSelectedCommand", source: this.viewModel);
-
- // Create the behavior and bind it to the command
- EventToCommandBehavior behavior = new EventToCommandBehavior
+ int row = 0;
+ for (int i = 0; i < tiles.Count; i += 2)
+ {
+ this.OperatorList.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
+ Grid.SetRow(tiles[i], row);
+ Grid.SetColumn(tiles[i], 0);
+ this.OperatorList.Children.Add(tiles[i]);
+ if (i + 1 < tiles.Count)
{
- EventName = "Clicked"
- };
- behavior.SetBinding(EventToCommandBehavior.CommandProperty, command);
- behavior.SetBinding(EventToCommandBehavior.CommandParameterProperty, commandParameter);
-
- // Attach the behavior to the button
- button.Behaviors.Add(behavior);
-
- this.OperatorList.Add(button);
-
- rowCount++;
+ Grid.SetRow(tiles[i + 1], row);
+ Grid.SetColumn(tiles[i + 1], 1);
+ this.OperatorList.Children.Add(tiles[i + 1]);
+ }
+ row++;
}
- this.OperatorList.Add(this.AddBackButton());
-
+
+ Frame backTile = this.CreateBackTile(viewModel.BackButtonCommand);
+ this.OperatorList.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
+ Grid.SetRow(backTile, row);
+ Grid.SetColumn(backTile, 0);
+ Grid.SetColumnSpan(backTile, 2);
+ this.OperatorList.Children.Add(backTile);
}
- private Button AddBackButton()
+ private Frame CreateTile(string text, Color backgroundColor, string automationId)
{
- Button button = new Button
- {
- Text = "Back",
- HorizontalOptions = LayoutOptions.FillAndExpand,
- AutomationId = "BackButton",
- };
- button.SetDynamicResource(VisualElement.StyleProperty, "VoucherButtonStyle");
-
- Binding backButtonCommand = new Binding
- {
- Source = this.viewModel.BackButtonCommand
- };
-
- button.SetBinding(Button.CommandProperty, backButtonCommand);
+ return new Frame
+ {
+ CornerRadius = 16,
+ HasShadow = true,
+ Padding = new Thickness(12),
+ HeightRequest = 100,
+ BackgroundColor = backgroundColor,
+ BorderColor = Colors.Transparent,
+ HorizontalOptions = LayoutOptions.FillAndExpand,
+ Content = new Label
+ {
+ Text = text,
+ TextColor = Colors.White,
+ FontAttributes = FontAttributes.Bold,
+ FontSize = 16,
+ HorizontalTextAlignment = TextAlignment.Center,
+ VerticalTextAlignment = TextAlignment.Center,
+ AutomationId = automationId
+ }
+ };
+ }
- return button;
+ private Frame CreateBackTile(System.Windows.Input.ICommand command)
+ {
+ Frame frame = this.CreateTile("Back", (Color)Application.Current.Resources["MidGray"], "BackButton");
+ frame.GestureRecognizers.Add(new TapGestureRecognizer { Command = command });
+ return frame;
}
-}
\ No newline at end of file
+}
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherSelectProductPage.xaml b/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherSelectProductPage.xaml
index c3b9bbdc4..1f92d1d67 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherSelectProductPage.xaml
+++ b/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherSelectProductPage.xaml
@@ -4,14 +4,18 @@
x:Class="TransactionProcessor.Mobile.Pages.Transactions.Voucher.VoucherSelectProductPage"
xmlns:controls="clr-namespace:TransactionProcessor.Mobile.Controls"
Shell.NavBarIsVisible="False">
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherSelectProductPage.xaml.cs b/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherSelectProductPage.xaml.cs
index 199db4b68..9d18d6474 100644
--- a/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherSelectProductPage.xaml.cs
+++ b/TransactionProcessor.Mobile/Pages/Transactions/Voucher/VoucherSelectProductPage.xaml.cs
@@ -9,9 +9,9 @@ public partial class VoucherSelectProductPage : ContentPage
{
private VoucherSelectProductPageViewModel viewModel => this.BindingContext as VoucherSelectProductPageViewModel;
- public VoucherSelectProductPage(VoucherSelectProductPageViewModel vm)
- {
- this.InitializeComponent();
+public VoucherSelectProductPage(VoucherSelectProductPageViewModel vm)
+{
+this.InitializeComponent();
this.BindingContext = vm;
}
@@ -25,64 +25,75 @@ protected override async void OnAppearing()
private void LoadProducts(VoucherSelectProductPageViewModel viewModel)
{
this.ProductsList.Children.Clear();
+ this.ProductsList.RowDefinitions.Clear();
+ var tiles = new List();
Int32 rowCount = 0;
foreach (ContractProductModel modelProduct in viewModel.Products)
{
- Button button = new Button
+ Frame tile = this.CreateTile(modelProduct.ProductDisplayText, (Color)Application.Current.Resources["voucher"], modelProduct.ProductDisplayText.Replace(" ", ""));
+ TapGestureRecognizer tap = new TapGestureRecognizer
{
- Text = modelProduct.ProductDisplayText,
- HorizontalOptions = LayoutOptions.FillAndExpand,
- AutomationId = modelProduct.ProductDisplayText,
+ Command = new Command(() => viewModel.ProductSelectedCommand.Execute(
+ new ItemSelected { SelectedItem = modelProduct, SelectedItemIndex = rowCount }))
};
- button.SetDynamicResource(VisualElement.StyleProperty, "VoucherButtonStyle");
+ tile.GestureRecognizers.Add(tap);
+ tiles.Add(tile);
+ rowCount++;
+ }
- Binding commandParameter = new Binding
+ int row = 0;
+ for (int i = 0; i < tiles.Count; i += 2)
+ {
+ this.ProductsList.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
+ Grid.SetRow(tiles[i], row);
+ Grid.SetColumn(tiles[i], 0);
+ this.ProductsList.Children.Add(tiles[i]);
+ if (i + 1 < tiles.Count)
{
- Source = new ItemSelected
- {
- SelectedItem = modelProduct,
- SelectedItemIndex = rowCount
- }
- };
+ Grid.SetRow(tiles[i + 1], row);
+ Grid.SetColumn(tiles[i + 1], 1);
+ this.ProductsList.Children.Add(tiles[i + 1]);
+ }
+ row++;
+ }
- Binding command = new Binding("ProductSelectedCommand", source: this.viewModel);
+ Frame backTile = this.CreateBackTile(viewModel.BackButtonCommand);
+ this.ProductsList.RowDefinitions.Add(new RowDefinition { Height = GridLength.Auto });
+ Grid.SetRow(backTile, row);
+ Grid.SetColumn(backTile, 0);
+ Grid.SetColumnSpan(backTile, 2);
+ this.ProductsList.Children.Add(backTile);
+ }
- // Create the behavior and bind it to the command
- EventToCommandBehavior behavior = new EventToCommandBehavior
+ private Frame CreateTile(string text, Color backgroundColor, string automationId)
+ {
+ return new Frame
+ {
+ CornerRadius = 16,
+ HasShadow = true,
+ Padding = new Thickness(12),
+ HeightRequest = 100,
+ BackgroundColor = backgroundColor,
+ BorderColor = Colors.Transparent,
+ HorizontalOptions = LayoutOptions.FillAndExpand,
+ Content = new Label
{
- EventName = "Clicked"
- };
- behavior.SetBinding(EventToCommandBehavior.CommandProperty, command);
- behavior.SetBinding(EventToCommandBehavior.CommandParameterProperty, commandParameter);
-
- // Attach the behavior to the button
- button.Behaviors.Add(behavior);
-
- this.ProductsList.Add(button);
-
- rowCount++;
- }
- this.ProductsList.Add(this.AddBackButton());
+ Text = text,
+ TextColor = Colors.White,
+ FontAttributes = FontAttributes.Bold,
+ FontSize = 16,
+ HorizontalTextAlignment = TextAlignment.Center,
+ VerticalTextAlignment = TextAlignment.Center,
+ AutomationId = automationId
+ }
+ };
}
- private Button AddBackButton()
+ private Frame CreateBackTile(System.Windows.Input.ICommand command)
{
- Button button = new Button
- {
- Text = "Back",
- HorizontalOptions = LayoutOptions.FillAndExpand,
- AutomationId = "BackButton",
- };
- button.SetDynamicResource(VisualElement.StyleProperty, "VoucherButtonStyle");
-
- Binding backButtonCommand = new Binding
- {
- Source = this.viewModel.BackButtonCommand
- };
-
- button.SetBinding(Button.CommandProperty, backButtonCommand);
-
- return button;
+ Frame frame = this.CreateTile("Back", (Color)Application.Current.Resources["MidGray"], "BackButton");
+ frame.GestureRecognizers.Add(new TapGestureRecognizer { Command = command });
+ return frame;
}
-}
\ No newline at end of file
+}
diff --git a/TransactionProcessor.Mobile/Resources/Styles/LightTheme.xaml b/TransactionProcessor.Mobile/Resources/Styles/LightTheme.xaml
index a0ebe8c81..2dd38d601 100644
--- a/TransactionProcessor.Mobile/Resources/Styles/LightTheme.xaml
+++ b/TransactionProcessor.Mobile/Resources/Styles/LightTheme.xaml
@@ -30,6 +30,9 @@
#212125
#CFCFD3
#EFEFEF
+ #FFFFFF
+ #F8FAFF
+ #27AE60
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/TransactionProcessor.Mobile/UIServices/ShellNavigationService.cs b/TransactionProcessor.Mobile/UIServices/ShellNavigationService.cs
index f1397d1ef..0ddb05fcf 100644
--- a/TransactionProcessor.Mobile/UIServices/ShellNavigationService.cs
+++ b/TransactionProcessor.Mobile/UIServices/ShellNavigationService.cs
@@ -186,6 +186,10 @@ public async Task GoToMyAccountDetails() {
await NavigateTo(nameof(MyAccountDetailsPage));
}
+ public async Task GoToTransactionsPage() {
+ await NavigateTo("///main/transactions");
+ }
+
public async Task GoToReportsSalesAnalysis(){
await NavigateTo(nameof(ReportsSalesAnalysisPage));
}