forked from MarcusWichelmann/MarcusW.VncClient
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.xaml.cs
34 lines (30 loc) · 1012 Bytes
/
App.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
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
using AvaloniaVncClient.Services;
using AvaloniaVncClient.ViewModels;
using AvaloniaVncClient.Views;
using Splat;
namespace AvaloniaVncClient
{
public class App : Application
{
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
// Register dependencies
Locator.CurrentMutable.RegisterLazySingleton(() => new ConnectionManager());
Locator.CurrentMutable.RegisterLazySingleton(() => new InteractiveAuthenticationHandler());
}
public override void OnFrameworkInitializationCompleted()
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
desktop.MainWindow = new MainWindow {
DataContext = new MainWindowViewModel()
};
}
base.OnFrameworkInitializationCompleted();
}
}
}