38 lines
917 B
C#
38 lines
917 B
C#
|
using Avalonia;
|
||
|
using Avalonia.Controls.ApplicationLifetimes;
|
||
|
using Avalonia.Markup.Xaml;
|
||
|
using Notes.ViewModels;
|
||
|
using Notes.UI;
|
||
|
|
||
|
|
||
|
namespace Notes;
|
||
|
|
||
|
public partial class App : Application
|
||
|
{
|
||
|
public static IServices services { get; set; }
|
||
|
|
||
|
public override void Initialize()
|
||
|
{
|
||
|
AvaloniaXamlLoader.Load(this);
|
||
|
FileSystem.fileService = services?.Get<IFileService>();
|
||
|
}
|
||
|
|
||
|
public override void OnFrameworkInitializationCompleted()
|
||
|
{
|
||
|
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
|
||
|
{
|
||
|
desktop.MainWindow = new MainWindow
|
||
|
{
|
||
|
};
|
||
|
}
|
||
|
else if (ApplicationLifetime is ISingleViewApplicationLifetime singleViewPlatform)
|
||
|
{
|
||
|
singleViewPlatform.MainView = new MainView
|
||
|
{
|
||
|
|
||
|
};
|
||
|
}
|
||
|
|
||
|
base.OnFrameworkInitializationCompleted();
|
||
|
}
|
||
|
}
|