Add suport for adding new items which are sorted without reloading the entrie list

This commit is contained in:
TheXamlGuy
2024-05-12 22:02:51 +01:00
parent 55d3971bfc
commit 3136a6458c
6 changed files with 37 additions and 18 deletions
+6 -1
View File
@@ -9,6 +9,8 @@ using Toolkit.Foundation;
using Microsoft.Extensions.DependencyInjection.Extensions;
using HotAvalonia;
using Bitvault.Data;
using System.Collections;
using System.Collections.Generic;
namespace Bitvault.Avalonia;
@@ -41,6 +43,9 @@ public partial class App : Application
{
args.AddServices(services =>
{
services.AddTransient<IComparer<Item>>(provider => Comparer<Item>.Create((x, z) => x.Name!.CompareTo(z.Name)));
services.AddCache<Item>();
services.AddTransient<IKeyGenerator, KeyGenerator>();
services.AddTransient<IEncryptor, AesEncryptor>();
services.AddTransient<IDecryptor, AesDecryptor>();
@@ -89,7 +94,7 @@ public partial class App : Application
services.AddTemplate<ItemHeaderViewModel, ItemHeaderView>();
services.AddHandler<CreateItemHandler>();
services.AddHandler<CreateItemHandler>(ServiceLifetime.Singleton);
services.AddHandler<ItemActivatedHandler>();
});
})!);