Skip to content
Open
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
20 changes: 7 additions & 13 deletions NethereumExplorer.Maui/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
using Microsoft.Maui;
using Microsoft.Maui.Controls;
using Microsoft.Maui.Controls.PlatformConfiguration.WindowsSpecific;
using Application = Microsoft.Maui.Controls.Application;
namespace NethereumExplorer.Maui;

namespace NethereumExplorer.Maui
public partial class App : Application
{
public partial class App : Application
{
public App()
{
InitializeComponent();
public App()
{
InitializeComponent();

MainPage = new MainPage();
}
}
MainPage = new MainPage();
}
}
9 changes: 9 additions & 0 deletions NethereumExplorer.Maui/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
global using System;
global using Microsoft.Maui;
global using Microsoft.Maui.Controls;
global using Microsoft.Maui.Hosting;
global using Microsoft.Maui.Controls.Hosting;
global using Blazor.FlexGrid;
global using Microsoft.Extensions.DependencyInjection;
global using NethereumExplorer.Services;
global using NethereumExplorer.ViewModels;
12 changes: 4 additions & 8 deletions NethereumExplorer.Maui/MainPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
using System;
using Microsoft.Maui.Controls;
namespace NethereumExplorer.Maui;

namespace NethereumExplorer.Maui
public partial class MainPage : ContentPage
{
public partial class MainPage : ContentPage
public MainPage()
{
public MainPage()
{
InitializeComponent();
}
InitializeComponent();
}
}
75 changes: 14 additions & 61 deletions NethereumExplorer.Maui/MauiProgram.cs
Original file line number Diff line number Diff line change
@@ -1,66 +1,19 @@
using Microsoft.AspNetCore.Components.WebView.Maui;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Maui;
using Microsoft.Maui.Hosting;
using Microsoft.Maui.Controls.Compatibility;
using Microsoft.Maui.Controls.Hosting;
using NethereumExplorer.Services;
using NethereumExplorer.ViewModels;
using Blazor.FlexGrid;
using System.Net.Http;
namespace NethereumExplorer.Maui;

namespace NethereumExplorer.Maui
public static class MauiProgram
{
public static class MauiProgram
{
public static MauiApp CreateMauiApp()
{

var builder = MauiApp.CreateBuilder();
builder
.RegisterBlazorMauiWebView()
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
});
public static MauiApp CreateMauiApp()
{

builder.Services.AddBlazorWebView();

var services = builder.Services;

var web3ServiceProvider = new Web3ProviderService();
var accountsService = new AccountsService(web3ServiceProvider);
var newBlockProcessingService = new NewBlockProcessingService(web3ServiceProvider);
var toastsViewModel = new ToastsViewModel();
var blocksViewModel = new BlocksViewModel(newBlockProcessingService);
var latestBlockTransactionsViewModel = new LatestBlockTransactionsViewModel(web3ServiceProvider);
var newAccountPrivateKeyViewModel = new NewAccountPrivateKeyViewModel();
var accountsViewModel = new AccountsViewModel(accountsService, newAccountPrivateKeyViewModel);
var accountsTransactionMonitoringService = new AccountsTransactionMonitoringService(accountsService, web3ServiceProvider);

services.AddSingleton<IWeb3ProviderService, Web3ProviderService>((x) => web3ServiceProvider);
services.AddSingleton<IAccountsService, AccountsService>((x) => accountsService);
services.AddSingleton<NewBlockProcessingService>(newBlockProcessingService);
services.AddSingleton<ToastsViewModel>(toastsViewModel);
services.AddSingleton<BlocksViewModel>(blocksViewModel);
services.AddSingleton<LatestBlockTransactionsViewModel>(latestBlockTransactionsViewModel);
services.AddTransient<BlockTransactionsViewModel>();
services.AddSingleton<AccountsViewModel>(accountsViewModel);
services.AddSingleton<NewAccountPrivateKeyViewModel>(newAccountPrivateKeyViewModel);
services.AddSingleton<SendTransactionViewModel>();
services.AddSingleton<SendErc20TransactionViewModel>();
services.AddSingleton(accountsTransactionMonitoringService);
services.AddSingleton<TransactionWithReceiptViewModel>();
services.AddSingleton<Web3UrlViewModel>();


services.AddFlexGrid(cfg =>
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.ConfigureFonts(fonts =>
{
cfg.ApplyConfiguration(new TransactionsViewModelGridConfiguration());
});
fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular");
})
.ConfigureServices();

return builder.Build();
}
}
}
return builder.Build();
}
}
33 changes: 9 additions & 24 deletions NethereumExplorer.Maui/NethereumExplorer.Maui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<PropertyGroup>
<TargetFrameworks>net6.0-ios;net6.0-android;net6.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows')) and '$(MSBuildRuntimeType)' == 'Full'">$(TargetFrameworks);net6.0-windows10.0.19041</TargetFrameworks>
<!-- Uncomment to also build the tizen app. You will need to install tizen by following this: https://github.com/Samsung/Tizen.NET -->
<!-- <TargetFrameworks>$(TargetFrameworks);net6.0-tizen</TargetFrameworks> -->
<OutputType>Exe</OutputType>
<RootNamespace>NethereumExplorer.Maui</RootNamespace>
<UseMaui>true</UseMaui>
Expand All @@ -16,15 +18,18 @@
<ApplicationId>com.companyname.NethereumExplorer.Maui</ApplicationId>

<!-- Versions -->
<ApplicationDisplayVersion>1.0</ApplicationDisplayVersion>
<ApplicationVersion>1</ApplicationVersion>

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

<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="'$(TargetFramework)' == 'net6.0-android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$(TargetFramework.Contains('-windows'))">10.0.18362.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'ios'">14.2</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">14.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'android'">21.0</SupportedOSPlatformVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</SupportedOSPlatformVersion>
<TargetPlatformMinVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'windows'">10.0.17763.0</TargetPlatformMinVersion>
<SupportedOSPlatformVersion Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'tizen'">6.5</SupportedOSPlatformVersion>
</PropertyGroup>

<ItemGroup>
Expand All @@ -40,17 +45,6 @@
<!-- Custom Fonts -->
<MauiFont Include="Resources\Fonts\*" />
</ItemGroup>

<ItemGroup Condition="$(TargetFramework.Contains('-windows'))">
<!-- Required - WinUI does not yet have buildTransitive for everything -->
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.0.0-preview3" />
<PackageReference Include="Microsoft.Graphics.Win2D" Version="1.0.0.29-preview3" />
</ItemGroup>

<PropertyGroup Condition="$(TargetFramework.Contains('-windows'))">
<OutputType>WinExe</OutputType>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
</PropertyGroup>

<ItemGroup>
<BundleResource Remove="wwwroot\images\**" />
Expand All @@ -67,15 +61,6 @@
<Content Remove="wwwroot\logo192x118.png" />
</ItemGroup>

<ItemGroup>
<None Remove="Resources\appicon.svg" />
<None Remove="Resources\appiconfg.svg" />
<None Remove="Resources\Images\logoN.svg" />
<None Remove="Resources\logo512n.png" />
<None Remove="Resources\logoN.svg" />
<None Remove="Resources\logoNIcon.svg" />
</ItemGroup>

<ItemGroup>
<MauiImage Include="Resources\logo512n.png" />
<MauiImage Include="Resources\appicon.svg" />
Expand Down
11 changes: 5 additions & 6 deletions NethereumExplorer.Maui/Platforms/MacCatalyst/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
using Microsoft.Maui;
using Microsoft.Maui.Hosting;

namespace NethereumExplorer.Maui
namespace NethereumExplorer.Maui;

[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
17 changes: 8 additions & 9 deletions NethereumExplorer.Maui/Platforms/MacCatalyst/Program.cs
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
using UIKit;

namespace NethereumExplorer.Maui
namespace NethereumExplorer.Maui;

public class Program
{
public class Program
// This is the main entry point of the application.
static void Main(string[] args)
{
// This is the main entry point of the application.
static void Main(string[] args)
{
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main(args, null, typeof(AppDelegate));
}
// if you want to use a different Application Delegate class from "AppDelegate"
// you can specify it here.
UIApplication.Main(args, null, typeof(AppDelegate));
}
}
16 changes: 16 additions & 0 deletions NethereumExplorer.Maui/Platforms/Tizen/Main.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using Microsoft.Maui;
using Microsoft.Maui.Hosting;

namespace NethereumExplorer.Maui;

class Program : MauiApplication
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();

static void Main(string[] args)
{
var app = new Program();
app.Run(args);
}
}
15 changes: 15 additions & 0 deletions NethereumExplorer.Maui/Platforms/Tizen/tizen-manifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.nethereumexplorer.maui" version="1.0.0" api-version="7" xmlns="http://tizen.org/ns/packages">
<profile name="common" />
<ui-application appid="com.nethereumexplorer.maui" exec="MauiApp2.dll" multiple="false" nodisplay="false" taskmanage="true" type="dotnet" launch_mode="single">
<label>NethereumExplorer.Maui</label>
<icon>appicon.xhigh.png</icon>
<metadata key="http://tizen.org/metadata/prefer_dotnet_aot" value="true" />
</ui-application>
<shortcut-list />
<privileges>
<privilege>http://tizen.org/privilege/internet</privilege>
</privileges>
<dependencies />
<provides-appdefined-privileges />
</manifest>
3 changes: 1 addition & 2 deletions NethereumExplorer.Maui/Platforms/Windows/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
x:Class="NethereumExplorer.Maui.WinUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:maui="using:Microsoft.Maui"
xmlns:local="using:NethereumExplorer.Maui.WinUI">
xmlns:maui="using:Microsoft.Maui">

</maui:MauiWinUIApplication>
39 changes: 13 additions & 26 deletions NethereumExplorer.Maui/Platforms/Windows/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,34 +1,21 @@
using Microsoft.Maui;
using Microsoft.Maui.Hosting;
using Microsoft.UI.Xaml;
using Windows.ApplicationModel;

// To learn more about WinUI, the WinUI project structure,
// To learn more about WinUI, the WinUI project structure,
// and more about our project templates, see: http://aka.ms/winui-project-info.

namespace NethereumExplorer.Maui.WinUI
namespace NethereumExplorer.Maui.WinUI;

/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// </summary>
public partial class App : MauiWinUIApplication
{
/// <summary>
/// Provides application-specific behavior to supplement the default Application class.
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public partial class App : MauiWinUIApplication
public App()
{
/// <summary>
/// Initializes the singleton application object. This is the first line of authored code
/// executed, and as such is the logical equivalent of main() or WinMain().
/// </summary>
public App()
{
this.InitializeComponent();
}

protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();

protected override void OnLaunched(LaunchActivatedEventArgs args)
{
base.OnLaunched(args);

Microsoft.Maui.Essentials.Platform.OnLaunched(args);
}
this.InitializeComponent();
}

protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
24 changes: 2 additions & 22 deletions NethereumExplorer.Maui/Platforms/Windows/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
<Properties>
<DisplayName>NethereumExplorer.Maui</DisplayName>
<PublisherDisplayName>Microsoft</PublisherDisplayName>
<Logo>Assets\appiconStoreLogo.png</Logo>
</Properties>

<Dependencies>
Expand All @@ -27,27 +26,8 @@
</Resources>

<Applications>
<Application Id="App"
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">
<uap:VisualElements
DisplayName="NethereumExplorer.Maui"
Description="NethereumExplorer.Maui"
BackgroundColor="transparent"
Square150x150Logo="Assets\appiconMediumTile.png"
Square44x44Logo="Assets\appiconLogo.png">
<uap:DefaultTile
Wide310x150Logo="Assets\appiconWideTile.png"
Square71x71Logo="Assets\appiconSmallTile.png"
Square310x310Logo="Assets\appiconLargeTile.png"
ShortName="NethereumExplorer.Maui">
<uap:ShowNameOnTiles>
<uap:ShowOn Tile="square150x150Logo"/>
<uap:ShowOn Tile="wide310x150Logo"/>
</uap:ShowNameOnTiles>
</uap:DefaultTile >
<uap:SplashScreen Image="Assets\appiconfgSplashScreen.png" />
</uap:VisualElements>
<Application Id="App" Executable="$targetnametoken$.exe" EntryPoint="$targetentrypoint$">
<uap:VisualElements />
</Application>
</Applications>

Expand Down
11 changes: 5 additions & 6 deletions NethereumExplorer.Maui/Platforms/iOS/AppDelegate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
using Microsoft.Maui;
using Microsoft.Maui.Hosting;

namespace NethereumExplorer.Maui
namespace NethereumExplorer.Maui;

[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
[Register("AppDelegate")]
public class AppDelegate : MauiUIApplicationDelegate
{
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
protected override MauiApp CreateMauiApp() => MauiProgram.CreateMauiApp();
}
Loading