using Avalonia; using Avalonia.Controls.ApplicationLifetimes; using Microsoft.EntityFrameworkCore; using Avalonia.Markup.Xaml; using AvaloniaApplication2.Models; using AvaloniaApplication2.ViewModels; using AvaloniaApplication2.Views; using Microsoft.Extensions.DependencyInjection; using Avalonia.Data.Core.Plugins; namespace AvaloniaApplication2; public partial class App : Application { public override void Initialize() { AvaloniaXamlLoader.Load(this); } public override void OnFrameworkInitializationCompleted() { if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop) { //Открываем окно авторизации при запуске приложения BindingPlugins.DataValidators.RemoveAt(0); desktop.MainWindow = new MainWindow { DataContext = new MainWindowViewModel(), }; } base.OnFrameworkInitializationCompleted(); } }