using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using Microsoft.AspNetCore.Components.Web; using EnvelopeGenerator.ReceiverUI; using DevExpress.DataAccess.Web; using EnvelopeGenerator.ReceiverUI.Services; using DevExpress.XtraReports.Services; using DevExpress.Blazor.Reporting; using DevExpress.XtraReports.Web.Extensions; var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add("#app"); builder.RootComponents.Add("head::after"); builder.Services.AddScoped(sp => new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); builder.Services.AddDevExpressWebAssemblyBlazorReportViewer(); builder.Services.AddDevExpressBlazorReportingWebAssembly(configure => { configure.UseDevelopmentMode(); }); builder.Services.AddScoped(); builder.Services.AddScoped(); builder.Services.AddScoped(); DevExpress.Utils.DeserializationSettings.RegisterTrustedClass(typeof(EnvelopeGenerator.ReceiverUI.Data.DataItemList)); DevExpress.Utils.DeserializationSettings.RegisterTrustedClass(typeof(EnvelopeGenerator.ReceiverUI.PredefinedReports.Report)); builder.Services.AddSingleton(); builder.Services.AddSingleton(sp => sp.GetRequiredService()); builder.Services.AddScoped(); ReportStorageWebExtension.RegisterExtensionGlobal(new InMemoryReportStorageWebExtension()); var host = builder.Build(); await FontLoader.LoadFonts(host.Services.GetRequiredService(), new List { "opensans.ttf" }); await host.RunAsync();