Dreamine.Web 1.0.0.0
WPF와 Blazor를 한 코드 흐름으로 연결하고 반복적인 MVVM 코드를 줄이는 오픈소스 FullKit 공식 웹 애플리케이션입니다.
로딩중...
검색중...
일치하는것 없음
App.xaml.cs
이 파일의 문서화 페이지로 가기
1using Dreamine.Hybrid.Wpf.Hosting;
2using Dreamine.Hybrid.Wpf.Interfaces;
3using Microsoft.Extensions.DependencyInjection;
4using System.Windows;
5
6namespace DreamineWeb;
7
16public partial class App : Application, IDreamineServiceProviderAware
17{
26 public static IServiceProvider? ServiceProvider { get; private set; }
27
52 public void SetServiceProvider(IServiceProvider serviceProvider)
53 {
54 ServiceProvider = serviceProvider ?? throw new ArgumentNullException(nameof(serviceProvider));
55 }
56
81 protected override void OnStartup(StartupEventArgs e)
82 {
83 base.OnStartup(e);
84
85 if (ServiceProvider is null)
86 throw new InvalidOperationException("ServiceProvider was not initialized before WPF startup.");
87
88 var window = ServiceProvider.GetRequiredService<Views.MainWindow>();
89 MainWindow = window;
90 window.Show();
91 }
92}
override void OnStartup(StartupEventArgs e)
Definition App.xaml.cs:81
void SetServiceProvider(IServiceProvider serviceProvider)
Definition App.xaml.cs:52
static ? IServiceProvider ServiceProvider
Definition App.xaml.cs:26