Sample01 1.0.0.0
Sample01 사용 방법을 보여 주는 예제 프로젝트입니다.
로딩중...
검색중...
일치하는것 없음
Program.cs
이 파일의 문서화 페이지로 가기
1using Dreamine.Hybrid.Interfaces;
2using Dreamine.Hybrid.State;
3using Dreamine.Hybrid.Wpf.DependencyInjection;
4using Dreamine.Hybrid.Wpf.Hosting;
5using Microsoft.Extensions.DependencyInjection;
6using Microsoft.Extensions.Hosting;
10using Sample01.Views;
11
12namespace Sample01
13{
22 public static class Program
23 {
32 [STAThread]
33 public static void Main()
34 {
35 HostApplicationBuilder builder = Host.CreateApplicationBuilder();
36
37 builder.Services.AddDreamineHybridWpf();
38
39 builder.Services.AddSingleton<MainWindow>();
40 builder.Services.AddSingleton<MainWindowViewModel>();
41
42 builder.Services.AddSingleton<IHybridStateStore<CounterState>>(
43 new HybridStateStore<CounterState>(
44 new CounterState(
45 Count: 0,
46 LastSource: "-",
47 LastUpdated: null)));
48
49 builder.Services.AddDreamineBlazorServer<AppShell>(options =>
50 {
51 options.Port = 5000;
52
53 options.SharedServiceTypes.Add(
54 typeof(IHybridStateStore<CounterState>));
55 });
56
57 builder.Build().RunDreamineWpfApp<App>();
58 }
59 }
60}
record CounterState(int Count, string LastSource, DateTime? LastUpdated)
static void Main()
Definition Program.cs:33