Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace TransactionMobile.Maui.BusinessLogic.Tests.ViewModelTests;

using System.Threading;
using Maui.UIServices;
using MediatR;
using Moq;
using Requests;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace TransactionMobile.Maui.BusinessLogic.Tests.ViewModelTests;

using Maui.UIServices;
using Moq;
using UIServices;
using ViewModels.Transactions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ namespace TransactionMobile.Maui.BusinessLogic.Tests.ViewModelTests;
using System;
using System.Collections.Generic;
using System.Threading;
using Maui.UIServices;
using MediatR;
using Moq;
using Requests;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ namespace TransactionMobile.Maui.BusinessLogic.Tests.ViewModelTests;

using System.Threading;
using System.Threading.Tasks;
using Maui.UIServices;
using MediatR;
using Models;
using Moq;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace TransactionMobile.Maui.BusinessLogic.Tests.ViewModelTests;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Maui.UIServices;
using MediatR;
using Models;
using Moq;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace TransactionMobile.Maui.BusinessLogic.Tests.ViewModelTests;

using Maui.UIServices;
using Moq;
using UIServices;
using ViewModels.Transactions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace TransactionMobile.Maui.BusinessLogic.Tests.ViewModelTests;

using Maui.UIServices;
using Moq;
using UIServices;
using ViewModels.Transactions;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace TransactionMobile.Maui.BusinessLogic.Tests.ViewModelTests;

using Maui.UIServices;
using Moq;
using UIServices;
using ViewModels.Transactions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ namespace TransactionMobile.Maui.BusinessLogic.Tests.ViewModelTests;
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Maui.UIServices;
using MediatR;
using Models;
using Moq;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
namespace TransactionMobile.Maui.BusinessLogic.Tests.ViewModelTests;

using Maui.UIServices;
using Moq;
using UIServices;
using ViewModels.Transactions;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ namespace TransactionMobile.Maui.BusinessLogic.Tests.ViewModelTests;
using System;
using System.Collections.Generic;
using System.Threading;
using Maui.UIServices;
using MediatR;
using Moq;
using Requests;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ namespace TransactionMobile.Maui.BusinessLogic.Tests.ViewModelTests;

using System.Threading;
using System.Threading.Tasks;
using Maui.UIServices;
using MediatR;
using Models;
using Moq;
Expand Down
17 changes: 17 additions & 0 deletions TransactionMobile.Maui.BusinessLogic/UIServices/IDeviceService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TransactionMobile.Maui.BusinessLogic.UIServices
{
public interface IDeviceService
{
String GetModel();

String GetPlatform();

String GetIdentifier();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace TransactionMobile.Maui.BusinessLogic.ViewModels
{
using System.Windows.Input;
using Maui.UIServices;
using MediatR;
using Models;
using MvvmHelpers;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TransactionMobile.Maui.BusinessLogic.ViewModels.Support
{
using MvvmHelpers;
using UIServices;

public class SupportPageViewModel : BaseViewModel
{
private readonly IDeviceService DeviceService;

public SupportPageViewModel(IDeviceService deviceService)
{
this.DeviceService = deviceService;
}
public string AppVersion => $"Version: {AppInfo.VersionString}{Environment.NewLine}Copyright © 2022 Stuart Ferguson";

//public string Description => "A playground for experiments with .Net MAUI. All code is available on GitHub and development is documented on my blog 'Sailing the Sharp Sea'.";

public string Platform
{
get
{
StringBuilder platform = new();
platform.Append("Platform: ").AppendLine(this.DeviceService.GetPlatform());
platform.Append("Manufacturer: ").AppendLine(DeviceInfo.Manufacturer);
platform.Append("Device: ").AppendLine(this.DeviceService.GetModel());

return platform.ToString();
}
}

}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace TransactionMobile.Maui.BusinessLogic.ViewModels.Transactions;

using System.Windows.Input;
using Maui.UIServices;
using MvvmHelpers;
using MvvmHelpers.Commands;
using UIServices;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

using System.Web;
using System.Windows.Input;
using Maui.UIServices;
using MediatR;
using Microsoft.Maui.Controls;
using MvvmHelpers;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace TransactionMobile.Maui.BusinessLogic.ViewModels.Transactions;

using System.Windows.Input;
using Maui.UIServices;
using MediatR;
using Models;
using MvvmHelpers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

using System.Web;
using System.Windows.Input;
using Maui.UIServices;
using MediatR;
using Microsoft.Maui.Controls;
using Models;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace TransactionMobile.Maui.BusinessLogic.ViewModels.Transactions
{
using System.Windows.Input;
using Maui.UIServices;
using MvvmHelpers;
using MvvmHelpers.Commands;
using UIServices;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace TransactionMobile.Maui.BusinessLogic.ViewModels.Transactions
{
using System.Windows.Input;
using Maui.UIServices;
using MvvmHelpers;
using MvvmHelpers.Commands;
using UIServices;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace TransactionMobile.Maui.BusinessLogic.ViewModels.Transactions;

using System.Windows.Input;
using Maui.UIServices;
using MvvmHelpers;
using MvvmHelpers.Commands;
using UIServices;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace TransactionMobile.Maui.BusinessLogic.ViewModels.Transactions
{
using System.Windows.Input;
using Maui.UIServices;
using MvvmHelpers;
using MvvmHelpers.Commands;
using UIServices;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

using System.Web;
using System.Windows.Input;
using Maui.UIServices;
using MediatR;
using MvvmHelpers;
using MvvmHelpers.Commands;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
namespace TransactionMobile.Maui.BusinessLogic.ViewModels.Transactions;

using System.Windows.Input;
using Maui.UIServices;
using MediatR;
using Models;
using MvvmHelpers;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

using System.Web;
using System.Windows.Input;
using Maui.UIServices;
using MediatR;
using Models;
using MvvmHelpers;
Expand Down
3 changes: 2 additions & 1 deletion TransactionMobile.Maui/AppShell.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
xmlns:home="clr-namespace:TransactionMobile.Maui.Pages.AppHome"
xmlns:transactions="clr-namespace:TransactionMobile.Maui.Pages.Transactions"
xmlns:reports="clr-namespace:TransactionMobile.Maui.Pages.Reports"
xmlns:support="clr-namespace:TransactionMobile.Maui.Pages.Support"
xmlns:myaccount="clr-namespace:TransactionMobile.Maui.Pages.MyAccount">
<Shell.Resources>
<!--
Expand All @@ -30,7 +31,7 @@
<ShellContent ContentTemplate="{DataTemplate myaccount:MyAccountPage}" Title="My Account"
Route="myaccount" />

<!--<ShellContent ContentTemplate="{DataTemplate local:LoginPage}"
<!--<ShellContent ContentTemplate="{DataTemplate support:SupportPage}" Title="Support"
Route="support" />-->
</TabBar>
</Shell>
3 changes: 3 additions & 0 deletions TransactionMobile.Maui/Extensions/MauiAppBuilderExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using BusinessLogic.Requests;
using BusinessLogic.Services;
using BusinessLogic.ViewModels;
using BusinessLogic.ViewModels.Support;
using BusinessLogic.ViewModels.Transactions;
using MediatR;
using UIServices;
Expand Down Expand Up @@ -60,6 +61,8 @@ public static MauiAppBuilder ConfigureViewModels(this MauiAppBuilder builder)
builder.Services.AddTransient<VoucherIssueSuccessPageViewModel>();
builder.Services.AddTransient<VoucherIssueFailedPageViewModel>();

builder.Services.AddTransient<SupportPageViewModel>();


return builder;
}
Expand Down
19 changes: 8 additions & 11 deletions TransactionMobile.Maui/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,22 @@

namespace TransactionMobile.Maui;

using BusinessLogic.UIServices;
using CommunityToolkit.Maui;
using UIServices;

public static class MauiProgram
{
public static MauiApp Container;
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureRequestHandlers()
.ConfigureViewModels()
.ConfigureAppServices()
.ConfigureUIServices()
.UseMauiCommunityToolkit()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
});
builder.UseMauiApp<App>().ConfigureRequestHandlers().ConfigureViewModels().ConfigureAppServices().ConfigureUIServices().UseMauiCommunityToolkit()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
})
.Services.AddTransient<IDeviceService, DeviceService>();

Container = builder.Build();
return Container;
Expand Down
53 changes: 53 additions & 0 deletions TransactionMobile.Maui/Pages/Support/SupportPage.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="TransactionMobile.Maui.Pages.Support.SupportPage"
Title="Support"
Shell.NavBarIsVisible="True"
BackgroundColor="White">
<StackLayout>
<Label Grid.Row="0"
Text="Support"
FontSize="42"
FontAttributes="Bold"
HorizontalOptions="Center"
VerticalOptions="End"
Margin="0, 10"/>

<ScrollView Grid.Row="1"
VerticalOptions="FillAndExpand"
Padding="10, 10">

<Grid RowDefinitions="Auto, 70, Auto, 60, 60"
RowSpacing="20">

<Label Grid.Row="0"
Text="{Binding AppVersion, Mode=OneTime}"
HorizontalTextAlignment="Center"
HorizontalOptions="Fill"/>

<Grid Grid.Row="1"
ColumnDefinitions="70, Auto"
ColumnSpacing="10"
HorizontalOptions="Center">

<Image Grid.Column="0"
Source="{OnIdiom Phone='phone.png', Tablet='tablet.png', Watch='watch.png', Default='desktop.png'}"
HeightRequest="70"
HorizontalOptions="Center"/>

<Label Grid.Column="1"
Text="{Binding Platform, Mode=OneTime}"
VerticalOptions="Center"/>

</Grid>

<!--<Label Grid.Row="2"
Text="{Binding Description, Mode=OneTime}"
HorizontalOptions="Center"/>-->

</Grid>

</ScrollView>
</StackLayout>
</ContentPage>
14 changes: 14 additions & 0 deletions TransactionMobile.Maui/Pages/Support/SupportPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
namespace TransactionMobile.Maui.Pages.Support;

using BusinessLogic.ViewModels.Support;

public partial class SupportPage : ContentPage
{
private SupportPageViewModel viewModel => BindingContext as SupportPageViewModel;

public SupportPage(SupportPageViewModel vm)
{
InitializeComponent();
BindingContext = vm;
}
}
Loading