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+ }
0 commit comments