-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.axaml.cs
45 lines (40 loc) · 1.27 KB
/
App.axaml.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
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Data.Core.Plugins;
using Avalonia.Markup.Xaml;
using Serilog;
using Serilog.Sinks.SystemConsole.Themes;
using TestingEO.ViewModels;
using TestingEO.Views;
namespace TestingEO
{
public class App : Application
{
public override void Initialize()
{
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Verbose()
.WriteTo.Async(w =>
{
// write to file
w.File("TestingEO.log", rollingInterval: RollingInterval.Day);
// write to console
w.Console(theme: AnsiConsoleTheme.Code);
})
.CreateLogger();
AvaloniaXamlLoader.Load(this);
}
public override void OnFrameworkInitializationCompleted()
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
BindingPlugins.DataValidators.RemoveAt(0);
desktop.MainWindow = new MainWindow
{
DataContext = new MainWindowViewModel(),
};
}
base.OnFrameworkInitializationCompleted();
}
}
}