Review requirement of Microsoft.Extensions.Hosting
This commit is contained in:
parent
2a7ff864bf
commit
29b0e78cc1
5 changed files with 22 additions and 31 deletions
|
|
@ -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()
|
||||
{
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
<ItemGroup>
|
||||
<PackageReference Include="Avalonia.ReactiveUI" />
|
||||
<PackageReference Include="Avalonia.Themes.Fluent" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" />
|
||||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" />
|
||||
<PackageReference Include="Microsoft.Extensions.Http" />
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue