Review requirement of Microsoft.Extensions.Hosting

This commit is contained in:
Jöran Malek 2024-02-08 01:19:26 +01:00
parent 2a7ff864bf
commit 29b0e78cc1
5 changed files with 22 additions and 31 deletions

View file

@ -3,19 +3,15 @@ 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 static readonly StyledProperty<IServiceProvider> ServiceProviderProperty = AvaloniaProperty.Register<App, IServiceProvider>(nameof(ServiceProvider));
public IHost Host => GetValue(HostProperty);
public IServiceProvider Services => Host.Services;
public IServiceProvider ServiceProvider => GetValue(ServiceProviderProperty);
public override void Initialize()
{