Families.Web 1.0.0.0
사진, 동영상, 글, 댓글과 반응을 가족끼리만 공유하는 비공개 앨범·타임라인 서비스입니다.
로딩중...
검색중...
일치하는것 없음
App.xaml.cs
이 파일의 문서화 페이지로 가기
1using Dreamine.Hybrid.Wpf.Hosting;
2using Dreamine.Hybrid.Wpf.Interfaces;
3using Microsoft.Extensions.DependencyInjection;
4using System.Windows;
5
6namespace FamiliesApp;
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
static ? IServiceProvider ServiceProvider
Definition App.xaml.cs:26
void SetServiceProvider(IServiceProvider serviceProvider)
Definition App.xaml.cs:52