Add core UI
This commit is contained in:
parent
500d6df113
commit
2a7ff864bf
8 changed files with 181 additions and 19 deletions
45
app/InkForge.Common/App.axaml.cs
Normal file
45
app/InkForge.Common/App.axaml.cs
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.ApplicationLifetimes;
|
||||
using Avalonia.Markup.Xaml;
|
||||
|
||||
using Microsoft.Extensions.Hosting;
|
||||
|
||||
using ReactiveUI;
|
||||
|
||||
namespace InkForge.Common;
|
||||
|
||||
public partial class App : Application
|
||||
{
|
||||
public static readonly StyledProperty<IHost> HostProperty = AvaloniaProperty.Register<App, IHost>("Host");
|
||||
|
||||
public IHost Host => GetValue(HostProperty);
|
||||
|
||||
public IServiceProvider Services => Host.Services;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
AvaloniaXamlLoader.Load(this);
|
||||
}
|
||||
|
||||
public override void OnFrameworkInitializationCompleted()
|
||||
{
|
||||
// var viewModel = Services.Activate<MainViewModel>();
|
||||
// var view = ViewLocator.Current.ResolveView(viewModel);
|
||||
// switch (ApplicationLifetime)
|
||||
// {
|
||||
// case IClassicDesktopStyleApplicationLifetime desktop:
|
||||
// desktop.MainWindow = view as Window;
|
||||
// break;
|
||||
|
||||
// case ISingleViewApplicationLifetime singleView:
|
||||
// singleView.MainView = view as Control;
|
||||
// break;
|
||||
|
||||
// default:
|
||||
// throw new NotSupportedException();
|
||||
// }
|
||||
|
||||
base.OnFrameworkInitializationCompleted();
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue