Update README.md with project details, features, requirements, architecture, and data management for PLib video library manager.

This commit is contained in:
Leonid Pershin
2026-08-08 07:08:43 +03:00
parent e767e4a48c
commit ac05ea6b7f
59 changed files with 3010 additions and 0 deletions
+55
View File
@@ -0,0 +1,55 @@
using Avalonia;
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Markup.Xaml;
using Avalonia.Threading;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using PLib.Desktop.Controls;
using PLib.Desktop.Imaging;
using PLib.Desktop.ViewModels;
using PLib.Desktop.Views;
namespace PLib.Desktop;
// Fully qualified: the PLib.Application namespace shadows the Application type in this assembly.
public sealed class App : Avalonia.Application
{
private IHost? _host;
public override void Initialize() => AvaloniaXamlLoader.Load(this);
public override void OnFrameworkInitializationCompleted()
{
if (ApplicationLifetime is IClassicDesktopStyleApplicationLifetime desktop)
{
_host = AppHost.Create(desktop.Args ?? []);
_host.Start();
AsyncImage.Loader = _host.Services.GetRequiredService<ThumbnailCache>();
var viewModel = _host.Services.GetRequiredService<MainWindowViewModel>();
desktop.MainWindow = new MainWindow { DataContext = viewModel };
desktop.Exit += OnExit;
// Kick the first load off once the dispatcher is running, so a failure surfaces
// through the view model instead of disappearing into an unobserved task.
Dispatcher.UIThread.Post(
() => viewModel.InitializeCommand.Execute(null),
DispatcherPriority.Background);
}
base.OnFrameworkInitializationCompleted();
}
private void OnExit(object? sender, ControlledApplicationLifetimeExitEventArgs e)
{
if (_host is null)
{
return;
}
_host.StopAsync(TimeSpan.FromSeconds(3)).GetAwaiter().GetResult();
_host.Dispose();
_host = null;
}
}