1234567891011121314151617181920212223242526272829303132333435 |
- 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();
- }
- }
|