Skip to content

Commit 57e0ce8

Browse files
committed
migrate RC2
1 parent b55cd43 commit 57e0ce8

File tree

13 files changed

+126
-186
lines changed

13 files changed

+126
-186
lines changed

NethereumExplorer.Maui/App.xaml.cs

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,11 @@
1-
using Microsoft.Maui;
2-
using Microsoft.Maui.Controls;
3-
using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
4-
using Application = Microsoft.Maui.Controls.Application;
1+
namespace NethereumExplorer.Maui;
52

6-
namespace NethereumExplorer.Maui
3+
public partial class App : Application
74
{
8-
public partial class App : Application
9-
{
10-
public App()
11-
{
12-
InitializeComponent();
5+
public App()
6+
{
7+
InitializeComponent();
138

14-
MainPage = new MainPage();
15-
}
16-
}
9+
MainPage = new MainPage();
10+
}
1711
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
global using System;
2+
global using Microsoft.Maui;
3+
global using Microsoft.Maui.Controls;
4+
global using Microsoft.Maui.Hosting;
5+
global using Microsoft.Maui.Controls.Hosting;
6+
global using Blazor.FlexGrid;
7+
global using Microsoft.Extensions.DependencyInjection;
8+
global using NethereumExplorer.Services;
9+
global using NethereumExplorer.ViewModels;
Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,9 @@
1-
using System;
2-
using Microsoft.Maui.Controls;
1+
namespace NethereumExplorer.Maui;
32

4-
namespace NethereumExplorer.Maui
3+
public partial class MainPage : ContentPage
54
{
6-
public partial class MainPage : ContentPage
5+
public MainPage()
76
{
8-
public MainPage()
9-
{
10-
InitializeComponent();
11-
}
7+
InitializeComponent();
128
}
139
}
Lines changed: 14 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,19 @@
1-
using Microsoft.AspNetCore.Components.WebView.Maui;
2-
using Microsoft.Extensions.DependencyInjection;
3-
using Microsoft.Maui;
4-
using Microsoft.Maui.Hosting;
5-
using Microsoft.Maui.Controls.Compatibility;
6-
using Microsoft.Maui.Controls.Hosting;
7-
using NethereumExplorer.Services;
8-
using NethereumExplorer.ViewModels;
9-
using Blazor.FlexGrid;
10-
using System.Net.Http;
1+
namespace NethereumExplorer.Maui;
112

12-
namespace NethereumExplorer.Maui
3+
public static class MauiProgram
134
{
14-
public static class MauiProgram
15-
{
16-
public static MauiApp CreateMauiApp()
17-
{
18-
19-
var builder = MauiApp.CreateBuilder();
20-
builder
21-
.RegisterBlazorMauiWebView()
22-
.UseMauiApp<App>()
23-
.ConfigureFonts(fonts =>
24-
{
25-
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
26-
});
5+
public static MauiApp CreateMauiApp()
6+
{
277

28-
builder.Services.AddBlazorWebView();
29-
30-
var services = builder.Services;
31-
32-
var web3ServiceProvider = new Web3ProviderService();
33-
var accountsService = new AccountsService(web3ServiceProvider);
34-
var newBlockProcessingService = new NewBlockProcessingService(web3ServiceProvider);
35-
var toastsViewModel = new ToastsViewModel();
36-
var blocksViewModel = new BlocksViewModel(newBlockProcessingService);
37-
var latestBlockTransactionsViewModel = new LatestBlockTransactionsViewModel(web3ServiceProvider);
38-
var newAccountPrivateKeyViewModel = new NewAccountPrivateKeyViewModel();
39-
var accountsViewModel = new AccountsViewModel(accountsService, newAccountPrivateKeyViewModel);
40-
var accountsTransactionMonitoringService = new AccountsTransactionMonitoringService(accountsService, web3ServiceProvider);
41-
42-
services.AddSingleton<IWeb3ProviderService, Web3ProviderService>((x) => web3ServiceProvider);
43-
services.AddSingleton<IAccountsService, AccountsService>((x) => accountsService);
44-
services.AddSingleton<NewBlockProcessingService>(newBlockProcessingService);
45-
services.AddSingleton<ToastsViewModel>(toastsViewModel);
46-
services.AddSingleton<BlocksViewModel>(blocksViewModel);
47-
services.AddSingleton<LatestBlockTransactionsViewModel>(latestBlockTransactionsViewModel);
48-
services.AddTransient<BlockTransactionsViewModel>();
49-
services.AddSingleton<AccountsViewModel>(accountsViewModel);
50-
services.AddSingleton<NewAccountPrivateKeyViewModel>(newAccountPrivateKeyViewModel);
51-
services.AddSingleton<SendTransactionViewModel>();
52-
services.AddSingleton<SendErc20TransactionViewModel>();
53-
services.AddSingleton(accountsTransactionMonitoringService);
54-
services.AddSingleton<TransactionWithReceiptViewModel>();
55-
services.AddSingleton<Web3UrlViewModel>();
56-
57-
58-
services.AddFlexGrid(cfg =>
8+
var builder = MauiApp.CreateBuilder();
9+
builder
10+
.UseMauiApp<App>()
11+
.ConfigureFonts(fonts =>
5912
{
60-
cfg.ApplyConfiguration(new TransactionsViewModelGridConfiguration());
61-
});
13+
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
14+
})
15+
.ConfigureServices();
6216

63-
return builder.Build();
64-
}
65-
}
66-
}
17+
return builder.Build();
18+
}
19+
}

NethereumExplorer.Maui/NethereumExplorer.Maui.csproj

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@
1616
<ApplicationId>com.companyname.NethereumExplorer.Maui</ApplicationId>
1717

1818
<!-- Versions -->
19+
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
1920
<ApplicationVersion>1</ApplicationVersion>
2021

2122
<!-- Required for C# Hot Reload -->
2223
<UseInterpreter Condition="'$(Configuration)' == 'Debug'">True</UseInterpreter>
2324

24-
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-ios'">14.2</SupportedOSPlatformVersion>
25-
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-maccatalyst'">14.0</SupportedOSPlatformVersion>
26-
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-android'">21.0</SupportedOSPlatformVersion>
27-
<SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.18362.0</SupportedOSPlatformVersion>
25+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
26+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
27+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
28+
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
29+
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
2830
</PropertyGroup>
2931

3032
<ItemGroup>
@@ -40,17 +42,6 @@
4042
<!-- Custom Fonts -->
4143
<MauiFont Include="Resources\Fonts\*" />
4244
</ItemGroup>
43-
44-
<ItemGroup Condition="$(TargetFramework.Contains('-windows'))">
45-
<!-- Required - WinUI does not yet have buildTransitive for everything -->
46-
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.0.0-preview3" />
47-
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.0.0.29-preview3" />
48-
</ItemGroup>
49-
50-
<PropertyGroup Condition="$(TargetFramework.Contains('-windows'))">
51-
<OutputType>WinExe</OutputType>
52-
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
53-
</PropertyGroup>
5445

5546
<ItemGroup>
5647
<BundleResource Remove="wwwroot\images\**" />
@@ -67,15 +58,6 @@
6758
<Content Remove="wwwroot\logo192x118.png" />
6859
</ItemGroup>
6960

70-
<ItemGroup>
71-
<None Remove="Resources\appicon.svg" />
72-
<None Remove="Resources\appiconfg.svg" />
73-
<None Remove="Resources\Images\logoN.svg" />
74-
<None Remove="Resources\logo512n.png" />
75-
<None Remove="Resources\logoN.svg" />
76-
<None Remove="Resources\logoNIcon.svg" />
77-
</ItemGroup>
78-
7961
<ItemGroup>
8062
<MauiImage Include="Resources\logo512n.png" />
8163
<MauiImage Include="Resources\appicon.svg" />

NethereumExplorer.Maui/Platforms/MacCatalyst/AppDelegate.cs

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22
using Microsoft.Maui;
33
using Microsoft.Maui.Hosting;
44

5-
namespace NethereumExplorer.Maui
5+
namespace NethereumExplorer.Maui;
6+
7+
[Register("AppDelegate")]
8+
public class AppDelegate : MauiUIApplicationDelegate
69
{
7-
[Register("AppDelegate")]
8-
public class AppDelegate : MauiUIApplicationDelegate
9-
{
10-
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
11-
}
10+
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
1211
}
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
using UIKit;
22

3-
namespace NethereumExplorer.Maui
3+
namespace NethereumExplorer.Maui;
4+
5+
public class Program
46
{
5-
public class Program
7+
// This is the main entry point of the application.
8+
static void Main(string[] args)
69
{
7-
// This is the main entry point of the application.
8-
static void Main(string[] args)
9-
{
10-
// if you want to use a different Application Delegate class from "AppDelegate"
11-
// you can specify it here.
12-
UIApplication.Main(args, null, typeof(AppDelegate));
13-
}
10+
// if you want to use a different Application Delegate class from "AppDelegate"
11+
// you can specify it here.
12+
UIApplication.Main(args, null, typeof(AppDelegate));
1413
}
1514
}

NethereumExplorer.Maui/Platforms/Windows/App.xaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
x:Class="NethereumExplorer.Maui.WinUI.App"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5-
xmlns:maui="using:Microsoft.Maui"
6-
xmlns:local="using:NethereumExplorer.Maui.WinUI">
5+
xmlns:maui="using:Microsoft.Maui">
76

87
</maui:MauiWinUIApplication>
Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,21 @@
1-
using Microsoft.Maui;
2-
using Microsoft.Maui.Hosting;
3-
using Microsoft.UI.Xaml;
4-
using Windows.ApplicationModel;
5-
6-
// To learn more about WinUI, the WinUI project structure,
1+
// To learn more about WinUI, the WinUI project structure,
72
// and more about our project templates, see: http://aka.ms/winui-project-info.
83

9-
namespace NethereumExplorer.Maui.WinUI
4+
namespace NethereumExplorer.Maui.WinUI;
5+
6+
/// <summary>
7+
/// Provides application-specific behavior to supplement the default Application class.
8+
/// </summary>
9+
public partial class App : MauiWinUIApplication
1010
{
1111
/// <summary>
12-
/// Provides application-specific behavior to supplement the default Application class.
12+
/// Initializes the singleton application object. This is the first line of authored code
13+
/// executed, and as such is the logical equivalent of main() or WinMain().
1314
/// </summary>
14-
public partial class App : MauiWinUIApplication
15+
public App()
1516
{
16-
/// <summary>
17-
/// Initializes the singleton application object. This is the first line of authored code
18-
/// executed, and as such is the logical equivalent of main() or WinMain().
19-
/// </summary>
20-
public App()
21-
{
22-
this.InitializeComponent();
23-
}
24-
25-
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
26-
27-
protected override void OnLaunched(LaunchActivatedEventArgs args)
28-
{
29-
base.OnLaunched(args);
30-
31-
Microsoft.Maui.Essentials.Platform.OnLaunched(args);
32-
}
17+
this.InitializeComponent();
3318
}
19+
20+
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
3421
}

NethereumExplorer.Maui/Platforms/Windows/Package.appxmanifest

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
<Properties>
1515
<DisplayName>NethereumExplorer.Maui</DisplayName>
1616
<PublisherDisplayName>Microsoft</PublisherDisplayName>
17-
<Logo>Assets\appiconStoreLogo.png</Logo>
1817
</Properties>
1918

2019
<Dependencies>
@@ -27,27 +26,8 @@
2726
</Resources>
2827

2928
<Applications>
30-
<Application Id="App"
31-
Executable="$targetnametoken$.exe"
32-
EntryPoint="$targetentrypoint$">
33-
<uap:VisualElements
34-
DisplayName="NethereumExplorer.Maui"
35-
Description="NethereumExplorer.Maui"
36-
BackgroundColor="transparent"
37-
Square150x150Logo="Assets\appiconMediumTile.png"
38-
Square44x44Logo="Assets\appiconLogo.png">
39-
<uap:DefaultTile
40-
Wide310x150Logo="Assets\appiconWideTile.png"
41-
Square71x71Logo="Assets\appiconSmallTile.png"
42-
Square310x310Logo="Assets\appiconLargeTile.png"
43-
ShortName="NethereumExplorer.Maui">
44-
<uap:ShowNameOnTiles>
45-
<uap:ShowOn Tile="square150x150Logo"/>
46-
<uap:ShowOn Tile="wide310x150Logo"/>
47-
</uap:ShowNameOnTiles>
48-
</uap:DefaultTile >
49-
<uap:SplashScreen Image="Assets\appiconfgSplashScreen.png" />
50-
</uap:VisualElements>
29+
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
30+
<uap:VisualElements />
5131
</Application>
5232
</Applications>
5333

0 commit comments

Comments
 (0)