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
@@ -0,0 +1,16 @@
namespace TransactionMobile.Maui.BusinessLogic.UIServices;

public interface IApplicationInfoService
{
String BuildString { get; }

String ApplicationName { get; }

String PackageName { get; }

String Theme { get; }

Version Version { get; }

String VersionString { get; }
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,16 @@ public class SupportPageViewModel : BaseViewModel
{
private readonly IDeviceService DeviceService;

public SupportPageViewModel(IDeviceService deviceService)
private readonly IApplicationInfoService ApplicationInfoService;

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

public String ApplicationName => $"{this.ApplicationInfoService.ApplicationName} v{this.ApplicationInfoService.VersionString}";
//public string AppVersion => $"Version: {this.ApplicationInfoService.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'.";

Expand Down
2 changes: 2 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.Services.DummyServices;
using BusinessLogic.UIServices;
using BusinessLogic.ViewModels;
using BusinessLogic.ViewModels.Support;
using BusinessLogic.ViewModels.Transactions;
Expand All @@ -29,6 +30,7 @@ public static MauiAppBuilder ConfigureUIServices(this MauiAppBuilder builder)
{
// builder.Services.AddSingleton<IDialogService, DialogService>();
builder.Services.AddSingleton<INavigationService, ShellNavigationService>();
builder.Services.AddSingleton<IApplicationInfoService, ApplicationInfoService>();
return builder;
}

Expand Down
57 changes: 16 additions & 41 deletions TransactionMobile.Maui/Pages/Support/SupportPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,52 +2,27 @@
<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"/>
<VerticalStackLayout>

<ScrollView Grid.Row="1"
VerticalOptions="FillAndExpand"
Padding="10, 10">
<!--Main image-->
<Image Source="Resources/techsupport.jpg" VerticalOptions="Start" Aspect="AspectFit"/>

<Grid RowDefinitions="Auto, 70, Auto, 60, 60"
RowSpacing="20">
<!-- Title-->
<Label Text="Support" FontSize="34" HorizontalOptions="Center" FontAttributes="Bold" Padding="20,0,0,20"/>

<Label Grid.Row="0"
Text="{Binding AppVersion, Mode=OneTime}"
<Frame HasShadow="True" Padding="25,50" Margin="10,0,10,10" VerticalOptions="CenterAndExpand"
CornerRadius="20" Opacity="0.9" BackgroundColor="#E5E9F0">
<VerticalStackLayout x:Name="SubLayout" Spacing="5">

<Label Text="{Binding ApplicationName, 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>

<Label Text="{Binding Platform, Mode=OneTime}"
VerticalOptions="Center"/>
</VerticalStackLayout>
</Frame>
</VerticalStackLayout>
</ContentPage>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 18 additions & 0 deletions TransactionMobile.Maui/UIServices/ApplicationInfoService.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
namespace TransactionMobile.Maui.UIServices;

using BusinessLogic.UIServices;

public class ApplicationInfoService : IApplicationInfoService
{
public String BuildString => AppInfo.BuildString;

public String ApplicationName => AppInfo.Name;

public String PackageName => AppInfo.PackageName;

public String Theme => AppInfo.RequestedTheme.ToString();

public Version Version => AppInfo.Version;

public String VersionString => AppInfo.VersionString;
}