-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathForm1.cs
More file actions
25 lines (24 loc) · 791 Bytes
/
Form1.cs
File metadata and controls
25 lines (24 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
namespace WinFormsBlazorHybridApp;
using Microsoft.AspNetCore.Components.WebView.WindowsForms;
using Microsoft.Extensions.DependencyInjection;
using Syncfusion.Blazor;
using WinFormsBlazorHybridApp.Components;
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
var services = new ServiceCollection();
services.AddWindowsFormsBlazorWebView();
services.AddMemoryCache();
services.AddSyncfusionBlazor();
var blazorWebView = new BlazorWebView()
{
HostPage = "wwwroot\\index.html",
Services = services.BuildServiceProvider(),
Dock = DockStyle.Fill
};
blazorWebView.RootComponents.Add<PDFViewer>("#app");
this.Controls.Add(blazorWebView);
}
}