-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMainWindow.xaml.cs
47 lines (38 loc) · 1.55 KB
/
MainWindow.xaml.cs
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// _____ _ _____ _ _____
// | _ |___| |_ ___ _____ ___ ___ | __|___ ___ _| | | |___ ___ ___ ___ ___ ___
// | __| . | '_| -_| | . | | | |__ .'| _| . | | | | | .'| | .'| . | -_| _|
// |__| |___|_,_|___|_|_|_|___|_|_| |_____|__,|_| |___| |_|_|_|__,|_|_|__,|_ |___|_|
// |___|
// MainWindow
//
using System;
using System.Windows;
using Microsoft.AspNetCore.Components.WebView.Wpf;
using Microsoft.Extensions.DependencyInjection;
using PokeCardManager.Classes;
using PokeCardManager.Classes.Events;
namespace PokeCardManager;
public partial class MainWindow : Window
{
public MainWindow()
{
Config.Init();
InitializeComponent();
Width = Config.Settings.WindowWidth;
Height = Config.Settings.WindowHeight;
var serviceCollection = new ServiceCollection();
serviceCollection.AddWpfBlazorWebView();
serviceCollection.AddSingleton<AddFolderEvent>();
serviceCollection.AddSingleton<UpdateFiltersEvent>();
serviceCollection.AddBlazorWebViewDeveloperTools();
serviceCollection.AddSingleton<MainWindow>();
// enable routing
Resources.Add("services", serviceCollection.BuildServiceProvider());
}
void Shutdown(object sender, EventArgs e)
{
Config.Settings.WindowWidth = (int)Width;
Config.Settings.WindowHeight = (int)Height;
Config.Settings.Save();
}
}