You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kev/Drawer/AI/App.axaml.cs

30 lines
939 B
C#

using Avalonia;
using Avalonia.Data.Core.Plugins;
using Avalonia.Markup.Xaml;
using Microsoft.Extensions.DependencyInjection;
namespace AI
{
public partial class App : Application
{
public IServiceProvider? ServiceProvider { get; private set; }
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);
}
public override void OnFrameworkInitializationCompleted()
{
// Line below is needed to remove Avalonia data validation.
// Without this line you will get duplicate validations from both Avalonia and CT
BindingPlugins.DataValidators.RemoveAt(0);
var collection = new ServiceCollection();
collection.AddCommonServices();
var services = collection.BuildServiceProvider();
ServiceProvider = services;
base.OnFrameworkInitializationCompleted();
}
}
}