diff --git a/Wallet.Avalonia/AddItemNavigationView.axaml.cs b/Wallet.Avalonia/AddItemNavigationView.axaml.cs index 3c06794..d86b739 100644 --- a/Wallet.Avalonia/AddItemNavigationView.axaml.cs +++ b/Wallet.Avalonia/AddItemNavigationView.axaml.cs @@ -2,9 +2,9 @@ using Toolkit.UI.Controls.Avalonia; namespace Wallet.Avalonia; -public partial class AddItemNavigationView : +public partial class AddItemNavigationView : SettingsExpander { - public AddItemNavigationView() => + public AddItemNavigationView() => InitializeComponent(); -} +} \ No newline at end of file diff --git a/Wallet.Avalonia/App.axaml.cs b/Wallet.Avalonia/App.axaml.cs index bb9f5f0..7e990e2 100644 --- a/Wallet.Avalonia/App.axaml.cs +++ b/Wallet.Avalonia/App.axaml.cs @@ -1,7 +1,7 @@ using Avalonia; using Avalonia.Controls.ApplicationLifetimes; using Avalonia.Markup.Xaml; -using Wallet.Data; +using FluentAvalonia.Core; using HotAvalonia; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; @@ -11,8 +11,7 @@ using System.Collections.Generic; using System.Linq; using Toolkit.Avalonia; using Toolkit.Foundation; -using FluentAvalonia.Core; -using Avalonia.Controls; +using Wallet.Data; namespace Wallet.Avalonia; @@ -50,7 +49,7 @@ public partial class App : Application .AddConfiguration("Item:Server", ItemConfiguration.Server) .AddConfiguration("Item:Education Record", ItemConfiguration.EducationRecord) .AddConfiguration("Item:Travel Documents", ItemConfiguration.TravelDocuments) - .AddConfiguration("Item:Concert Ticket", ItemConfiguration.ConcertTicket) + .AddConfiguration("Item:Concert Ticket", ItemConfiguration.ConcertTicket) .ConfigureServices((context, services) => { services.AddAvalonia(); @@ -95,11 +94,11 @@ public partial class App : Application provider.GetServices>().OrderBy(x => x.Name) ?? Enumerable.Empty>(); - return new ItemConfigurationCollection(items.ToDictionary(x => x.Name, + return new ItemConfigurationCollection(items.ToDictionary(x => x.Name, x => (Func)(() => x.Value))); }); - services.TryAddSingleton>, + services.TryAddSingleton>, DecoratorService>>(); services.TryAddSingleton, DecoratorService>(); @@ -115,7 +114,7 @@ public partial class App : Application services.AddHandler(); services.AddHandler(); - + services.AddHandler(); services.AddHandler(); services.AddHandler(); @@ -160,7 +159,7 @@ public partial class App : Application services.AddTemplate(); services.AddHandler(); - + services.AddTemplate("EmptyItemCollection"); services.AddScoped, DecoratorService>(); @@ -202,7 +201,7 @@ public partial class App : Application services.AddHandler(nameof(ItemState.Write)); services.AddHandler(nameof(ItemState.New)); services.AddHandler(); - + services.AddHandler(); services.AddHandler(ServiceLifetime.Singleton); diff --git a/Wallet.Avalonia/ApplicationSplashScreen.cs b/Wallet.Avalonia/ApplicationSplashScreen.cs index 4e2a654..4b04294 100644 --- a/Wallet.Avalonia/ApplicationSplashScreen.cs +++ b/Wallet.Avalonia/ApplicationSplashScreen.cs @@ -16,6 +16,6 @@ public class ApplicationSplashScreen : public int MinimumShowTime => 2000; - public Task RunTasks(CancellationToken cancellationToken) => + public Task RunTasks(CancellationToken cancellationToken) => Task.CompletedTask; -} +} \ No newline at end of file diff --git a/Wallet.Avalonia/ArchiveNavigationView.axaml.cs b/Wallet.Avalonia/ArchiveNavigationView.axaml.cs index d22244e..1bd257b 100644 --- a/Wallet.Avalonia/ArchiveNavigationView.axaml.cs +++ b/Wallet.Avalonia/ArchiveNavigationView.axaml.cs @@ -5,6 +5,6 @@ namespace Wallet.Avalonia; public partial class ArchiveNavigationView : NavigationViewItem { - public ArchiveNavigationView() => + public ArchiveNavigationView() => InitializeComponent(); } \ No newline at end of file diff --git a/Wallet.Avalonia/BackActionView.axaml.cs b/Wallet.Avalonia/BackActionView.axaml.cs index cb4d577..f6e7e78 100644 --- a/Wallet.Avalonia/BackActionView.axaml.cs +++ b/Wallet.Avalonia/BackActionView.axaml.cs @@ -6,4 +6,4 @@ public partial class BackActionView : UserControl { public BackActionView() => InitializeComponent(); -} +} \ No newline at end of file diff --git a/Wallet.Avalonia/CategoriesNavigationView.axaml.cs b/Wallet.Avalonia/CategoriesNavigationView.axaml.cs index 0635bf2..c1ce730 100644 --- a/Wallet.Avalonia/CategoriesNavigationView.axaml.cs +++ b/Wallet.Avalonia/CategoriesNavigationView.axaml.cs @@ -2,9 +2,9 @@ using Toolkit.UI.Controls.Avalonia; namespace Wallet.Avalonia; -public partial class CategoriesNavigationView : +public partial class CategoriesNavigationView : NavigationViewItem { - public CategoriesNavigationView() => + public CategoriesNavigationView() => InitializeComponent(); } \ No newline at end of file diff --git a/Wallet.Avalonia/CategoryNavigationView.axaml.cs b/Wallet.Avalonia/CategoryNavigationView.axaml.cs index ea7e8de..a38c876 100644 --- a/Wallet.Avalonia/CategoryNavigationView.axaml.cs +++ b/Wallet.Avalonia/CategoryNavigationView.axaml.cs @@ -7,4 +7,4 @@ public partial class CategoryNavigationView : { public CategoryNavigationView() => InitializeComponent(); -} +} \ No newline at end of file diff --git a/Wallet.Avalonia/CommentEntryCollectionView.axaml.cs b/Wallet.Avalonia/CommentEntryCollectionView.axaml.cs index eaacf3d..072ccfc 100644 --- a/Wallet.Avalonia/CommentEntryCollectionView.axaml.cs +++ b/Wallet.Avalonia/CommentEntryCollectionView.axaml.cs @@ -2,7 +2,7 @@ using Toolkit.UI.Controls.Avalonia; namespace Wallet.Avalonia; -public partial class CommentEntryCollectionView : +public partial class CommentEntryCollectionView : SettingsExpander { public CommentEntryCollectionView() => diff --git a/Wallet.Avalonia/CommentEntryView.axaml.cs b/Wallet.Avalonia/CommentEntryView.axaml.cs index 7c78922..66bf8c0 100644 --- a/Wallet.Avalonia/CommentEntryView.axaml.cs +++ b/Wallet.Avalonia/CommentEntryView.axaml.cs @@ -2,10 +2,10 @@ using Toolkit.UI.Controls.Avalonia; namespace Wallet.Avalonia { - public partial class CommentEntryView : + public partial class CommentEntryView : SettingsExpanderItem { public CommentEntryView() => InitializeComponent(); } -} +} \ No newline at end of file diff --git a/Wallet.Avalonia/CreateCommentEntryView.axaml.cs b/Wallet.Avalonia/CreateCommentEntryView.axaml.cs index 25b22df..ffb342b 100644 --- a/Wallet.Avalonia/CreateCommentEntryView.axaml.cs +++ b/Wallet.Avalonia/CreateCommentEntryView.axaml.cs @@ -2,9 +2,9 @@ using Toolkit.UI.Controls.Avalonia; namespace Wallet.Avalonia; -public partial class CreateCommentEntryView : +public partial class CreateCommentEntryView : SettingsExpanderItem { - public CreateCommentEntryView() => + public CreateCommentEntryView() => InitializeComponent(); -} +} \ No newline at end of file diff --git a/Wallet.Avalonia/CreateItemNavigationView.axaml.cs b/Wallet.Avalonia/CreateItemNavigationView.axaml.cs index 910f51d..be74759 100644 --- a/Wallet.Avalonia/CreateItemNavigationView.axaml.cs +++ b/Wallet.Avalonia/CreateItemNavigationView.axaml.cs @@ -5,6 +5,6 @@ namespace Wallet.Avalonia; public partial class CreateItemNavigationView : NavigationViewItem { - public CreateItemNavigationView() => + public CreateItemNavigationView() => InitializeComponent(); } \ No newline at end of file diff --git a/Wallet.Avalonia/CreateWalletNavigationView.axaml.cs b/Wallet.Avalonia/CreateWalletNavigationView.axaml.cs index d3666e5..1744c7b 100644 --- a/Wallet.Avalonia/CreateWalletNavigationView.axaml.cs +++ b/Wallet.Avalonia/CreateWalletNavigationView.axaml.cs @@ -4,6 +4,6 @@ namespace Wallet.Avalonia; public partial class CreateWalletNavigationView : SettingsExpander { - public CreateWalletNavigationView() => + public CreateWalletNavigationView() => InitializeComponent(); } \ No newline at end of file diff --git a/Wallet.Avalonia/DateEntryView.axaml.cs b/Wallet.Avalonia/DateEntryView.axaml.cs index beb2766..e784f23 100644 --- a/Wallet.Avalonia/DateEntryView.axaml.cs +++ b/Wallet.Avalonia/DateEntryView.axaml.cs @@ -2,9 +2,9 @@ using Toolkit.UI.Controls.Avalonia; namespace Wallet.Avalonia; -public partial class DateEntryView : +public partial class DateEntryView : SettingsExpander { - public DateEntryView() => + public DateEntryView() => InitializeComponent(); -} +} \ No newline at end of file diff --git a/Wallet.Avalonia/DropdownEntryCollectionView.axaml.cs b/Wallet.Avalonia/DropdownEntryCollectionView.axaml.cs index 24c6010..2a0335a 100644 --- a/Wallet.Avalonia/DropdownEntryCollectionView.axaml.cs +++ b/Wallet.Avalonia/DropdownEntryCollectionView.axaml.cs @@ -2,9 +2,9 @@ using Toolkit.UI.Controls.Avalonia; namespace Wallet.Avalonia; -public partial class DropdownEntryCollectionView : +public partial class DropdownEntryCollectionView : SettingsExpander { - public DropdownEntryCollectionView() => + public DropdownEntryCollectionView() => InitializeComponent(); -} +} \ No newline at end of file diff --git a/Wallet.Avalonia/EmptyItemCollectionView.axaml.cs b/Wallet.Avalonia/EmptyItemCollectionView.axaml.cs index 88b86d1..cf82eed 100644 --- a/Wallet.Avalonia/EmptyItemCollectionView.axaml.cs +++ b/Wallet.Avalonia/EmptyItemCollectionView.axaml.cs @@ -2,9 +2,9 @@ using Avalonia.Controls; namespace Wallet.Avalonia; -public partial class EmptyItemCollectionView : +public partial class EmptyItemCollectionView : UserControl { - public EmptyItemCollectionView() => + public EmptyItemCollectionView() => InitializeComponent(); -} +} \ No newline at end of file diff --git a/Wallet.Avalonia/FavouritesNavigationView.axaml.cs b/Wallet.Avalonia/FavouritesNavigationView.axaml.cs index f9367f3..f11bb1b 100644 --- a/Wallet.Avalonia/FavouritesNavigationView.axaml.cs +++ b/Wallet.Avalonia/FavouritesNavigationView.axaml.cs @@ -2,7 +2,7 @@ using Toolkit.UI.Controls.Avalonia; namespace Wallet.Avalonia; -public partial class FavouritesNavigationView : +public partial class FavouritesNavigationView : NavigationViewItem { public FavouritesNavigationView() => InitializeComponent(); diff --git a/Wallet.Avalonia/HyperlinkEntryView.axaml.cs b/Wallet.Avalonia/HyperlinkEntryView.axaml.cs index f7886cf..1635cd1 100644 --- a/Wallet.Avalonia/HyperlinkEntryView.axaml.cs +++ b/Wallet.Avalonia/HyperlinkEntryView.axaml.cs @@ -2,9 +2,9 @@ using Toolkit.UI.Controls.Avalonia; namespace Wallet.Avalonia; -public partial class HyperlinkEntryView : +public partial class HyperlinkEntryView : SettingsExpander { - public HyperlinkEntryView() => + public HyperlinkEntryView() => InitializeComponent(); -} +} \ No newline at end of file diff --git a/Wallet.Avalonia/ItemCategoryNavigationCollectionView.axaml.cs b/Wallet.Avalonia/ItemCategoryNavigationCollectionView.axaml.cs index bbe6dfa..be0e641 100644 --- a/Wallet.Avalonia/ItemCategoryNavigationCollectionView.axaml.cs +++ b/Wallet.Avalonia/ItemCategoryNavigationCollectionView.axaml.cs @@ -2,9 +2,9 @@ using Avalonia.Controls; namespace Wallet.Avalonia; -public partial class ItemCategoryNavigationCollectionView : +public partial class ItemCategoryNavigationCollectionView : UserControl { public ItemCategoryNavigationCollectionView() => InitializeComponent(); -} +} \ No newline at end of file diff --git a/Wallet.Avalonia/ItemCategoryNavigationView.axaml.cs b/Wallet.Avalonia/ItemCategoryNavigationView.axaml.cs index 937d538..7a547be 100644 --- a/Wallet.Avalonia/ItemCategoryNavigationView.axaml.cs +++ b/Wallet.Avalonia/ItemCategoryNavigationView.axaml.cs @@ -6,4 +6,4 @@ public partial class ItemCategoryNavigationView : ListBoxItem { public ItemCategoryNavigationView() => InitializeComponent(); -} +} \ No newline at end of file diff --git a/Wallet.Avalonia/ItemContentView.axaml.cs b/Wallet.Avalonia/ItemContentView.axaml.cs index 1a35510..6f15224 100644 --- a/Wallet.Avalonia/ItemContentView.axaml.cs +++ b/Wallet.Avalonia/ItemContentView.axaml.cs @@ -4,6 +4,6 @@ namespace Wallet.Avalonia; public partial class ItemContentView : UserControl { - public ItemContentView() => + public ItemContentView() => InitializeComponent(); -} +} \ No newline at end of file diff --git a/Wallet.Avalonia/ItemEntryActionView.axaml.cs b/Wallet.Avalonia/ItemEntryActionView.axaml.cs index 3271531..9945ace 100644 --- a/Wallet.Avalonia/ItemEntryActionView.axaml.cs +++ b/Wallet.Avalonia/ItemEntryActionView.axaml.cs @@ -9,4 +9,4 @@ namespace Wallet.Avalonia InitializeComponent(); } } -} +} \ No newline at end of file diff --git a/Wallet.Avalonia/ItemNavigationCollectionView.axaml.cs b/Wallet.Avalonia/ItemNavigationCollectionView.axaml.cs index 2024c76..4dc2306 100644 --- a/Wallet.Avalonia/ItemNavigationCollectionView.axaml.cs +++ b/Wallet.Avalonia/ItemNavigationCollectionView.axaml.cs @@ -6,4 +6,4 @@ public partial class ItemNavigationCollectionView : UserControl { public ItemNavigationCollectionView() => InitializeComponent(); -} +} \ No newline at end of file diff --git a/Wallet.Avalonia/ItemNavigationView.axaml.cs b/Wallet.Avalonia/ItemNavigationView.axaml.cs index bf5d52d..d86a520 100644 --- a/Wallet.Avalonia/ItemNavigationView.axaml.cs +++ b/Wallet.Avalonia/ItemNavigationView.axaml.cs @@ -3,10 +3,10 @@ using System; namespace Wallet.Avalonia; -public partial class ItemNavigationView : +public partial class ItemNavigationView : ListBoxItem { - public ItemNavigationView() => + public ItemNavigationView() => InitializeComponent(); protected override Type StyleKeyOverride => diff --git a/Wallet.Avalonia/ItemSectionView.axaml.cs b/Wallet.Avalonia/ItemSectionView.axaml.cs index 9a124a1..d55a709 100644 --- a/Wallet.Avalonia/ItemSectionView.axaml.cs +++ b/Wallet.Avalonia/ItemSectionView.axaml.cs @@ -5,6 +5,6 @@ namespace Wallet.Avalonia; public partial class ItemSectionView : UserControl { - public ItemSectionView() => + public ItemSectionView() => InitializeComponent(); -} +} \ No newline at end of file diff --git a/Wallet.Avalonia/MainView.axaml b/Wallet.Avalonia/MainView.axaml index 3daaf9f..363fa14 100644 --- a/Wallet.Avalonia/MainView.axaml +++ b/Wallet.Avalonia/MainView.axaml @@ -13,7 +13,7 @@ MenuItemsSource="{Binding}" SelectedItem="{Binding SelectedItem}"> - + diff --git a/Wallet.Avalonia/MaskedTextEntryView.axaml.cs b/Wallet.Avalonia/MaskedTextEntryView.axaml.cs index bfcb666..26d567f 100644 --- a/Wallet.Avalonia/MaskedTextEntryView.axaml.cs +++ b/Wallet.Avalonia/MaskedTextEntryView.axaml.cs @@ -5,7 +5,7 @@ namespace Wallet.Avalonia public partial class MaskedTextEntryView : SettingsExpander { - public MaskedTextEntryView() => + public MaskedTextEntryView() => InitializeComponent(); } -} +} \ No newline at end of file diff --git a/Wallet.Avalonia/OpenWalletView.axaml.cs b/Wallet.Avalonia/OpenWalletView.axaml.cs index 2c40ff5..7e28c85 100644 --- a/Wallet.Avalonia/OpenWalletView.axaml.cs +++ b/Wallet.Avalonia/OpenWalletView.axaml.cs @@ -4,6 +4,6 @@ namespace Wallet.Avalonia; public partial class OpenWalletView : UserControl { - public OpenWalletView() => + public OpenWalletView() => InitializeComponent(); } \ No newline at end of file diff --git a/Wallet.Avalonia/PasswordEntryView.axaml.cs b/Wallet.Avalonia/PasswordEntryView.axaml.cs index ee086ac..8fb36dc 100644 --- a/Wallet.Avalonia/PasswordEntryView.axaml.cs +++ b/Wallet.Avalonia/PasswordEntryView.axaml.cs @@ -2,9 +2,9 @@ using Toolkit.UI.Controls.Avalonia; namespace Wallet.Avalonia; -public partial class PasswordEntryView : +public partial class PasswordEntryView : SettingsExpander { public PasswordEntryView() => InitializeComponent(); -} +} \ No newline at end of file diff --git a/Wallet.Avalonia/PinEntryView.axaml.cs b/Wallet.Avalonia/PinEntryView.axaml.cs index d1f8e0e..a9e771d 100644 --- a/Wallet.Avalonia/PinEntryView.axaml.cs +++ b/Wallet.Avalonia/PinEntryView.axaml.cs @@ -2,9 +2,9 @@ using Toolkit.UI.Controls.Avalonia; namespace Wallet.Avalonia; -public partial class PinEntryView : +public partial class PinEntryView : SettingsExpander { - public PinEntryView() => + public PinEntryView() => InitializeComponent(); -} +} \ No newline at end of file diff --git a/Wallet.Avalonia/SearchWalletActionView.axaml.cs b/Wallet.Avalonia/SearchWalletActionView.axaml.cs index c8efc88..f091137 100644 --- a/Wallet.Avalonia/SearchWalletActionView.axaml.cs +++ b/Wallet.Avalonia/SearchWalletActionView.axaml.cs @@ -4,6 +4,6 @@ namespace Wallet.Avalonia; public partial class SearchWalletActionView : UserControl { - public SearchWalletActionView() => + public SearchWalletActionView() => InitializeComponent(); } \ No newline at end of file diff --git a/Wallet.Avalonia/SplashView.axaml.cs b/Wallet.Avalonia/SplashView.axaml.cs index 50446f1..31c5452 100644 --- a/Wallet.Avalonia/SplashView.axaml.cs +++ b/Wallet.Avalonia/SplashView.axaml.cs @@ -9,4 +9,4 @@ namespace Wallet.Avalonia InitializeComponent(); } } -} +} \ No newline at end of file diff --git a/Wallet.Avalonia/TextEntryView.axaml.cs b/Wallet.Avalonia/TextEntryView.axaml.cs index f192d08..852fd7c 100644 --- a/Wallet.Avalonia/TextEntryView.axaml.cs +++ b/Wallet.Avalonia/TextEntryView.axaml.cs @@ -2,9 +2,9 @@ using Toolkit.UI.Controls.Avalonia; namespace Wallet.Avalonia; -public partial class TextEntryView : +public partial class TextEntryView : SettingsExpander { - public TextEntryView() => + public TextEntryView() => InitializeComponent(); -} +} \ No newline at end of file diff --git a/Wallet.Avalonia/WalletNavigationCollectionView.axaml.cs b/Wallet.Avalonia/WalletNavigationCollectionView.axaml.cs index ae64aaf..96a0b5f 100644 --- a/Wallet.Avalonia/WalletNavigationCollectionView.axaml.cs +++ b/Wallet.Avalonia/WalletNavigationCollectionView.axaml.cs @@ -2,8 +2,8 @@ using Avalonia.Controls; namespace Wallet.Avalonia; -public partial class WalletNavigationCollectionView : +public partial class WalletNavigationCollectionView : UserControl { public WalletNavigationCollectionView() => InitializeComponent(); -} +} \ No newline at end of file diff --git a/Wallet.Avalonia/WalletNavigationView.axaml b/Wallet.Avalonia/WalletNavigationView.axaml index b1dd90d..b988352 100644 --- a/Wallet.Avalonia/WalletNavigationView.axaml +++ b/Wallet.Avalonia/WalletNavigationView.axaml @@ -5,12 +5,13 @@ xmlns:ui="using:FluentAvalonia.UI.Controls" xmlns:vm="using:Wallet" x:DataType="vm:WalletNavigationViewModel" + BadgeBrush="{DynamicResource SystemFillColorAttentionBrush}" BadgePath="F1 M 10 3.799999 C 8.559999 3.799999 7.226666 4.16 6 4.879999 C 4.773333 5.6 3.8 6.573334 3.08 7.799999 C 2.36 9.026667 2 10.360001 2 11.799999 C 2 13.24 2.36 14.573334 3.08 15.799999 C 3.8 17.026667 4.773333 18 6 18.719999 C 7.226666 19.439999 8.559999 19.799999 10 19.799999 C 11.439999 19.799999 12.773333 19.439999 14 18.719999 C 15.226665 18 16.199999 17.026667 16.92 15.799999 C 17.639999 14.573334 18 13.24 18 11.799999 C 18 10.360001 17.639999 9.026667 16.92 7.799999 C 16.199999 6.573334 15.226665 5.6 14 4.879999 C 12.773333 4.16 11.439999 3.799999 10 3.799999 Z " BadgePlacement="BottomRight" BadgeSize="10" ContentTemplate="{x:Null}" Foreground="#4CAF50" - IsBadgeVisible="True" + IsBadgeVisible="{Binding IsOpened}" ListBoxExtension.IsItemInvokedEnabled="True" ToolTip.Tip="{Binding Name}"> diff --git a/Wallet.Avalonia/WalletNavigationView.axaml.cs b/Wallet.Avalonia/WalletNavigationView.axaml.cs index 225423c..5873b64 100644 --- a/Wallet.Avalonia/WalletNavigationView.axaml.cs +++ b/Wallet.Avalonia/WalletNavigationView.axaml.cs @@ -1,4 +1,3 @@ -using Avalonia.Controls; using System; using Toolkit.UI.Controls.Avalonia; @@ -7,7 +6,7 @@ namespace Wallet.Avalonia; public partial class WalletNavigationView : OverflowItem { - public WalletNavigationView() => + public WalletNavigationView() => InitializeComponent(); protected override Type StyleKeyOverride => diff --git a/Wallet.Data/ItemEntity.cs b/Wallet.Data/ItemEntity.cs index 1014d03..c14784a 100644 --- a/Wallet.Data/ItemEntity.cs +++ b/Wallet.Data/ItemEntity.cs @@ -23,5 +23,5 @@ public record ItemEntity public ICollection Tags { get; set; } = new List(); - public ICollection Blobs { get; set; } = new List(); + public ICollection Blobs { get; set; } = new List(); } \ No newline at end of file diff --git a/Wallet/ArchiveItemHandler.cs b/Wallet/ArchiveItemHandler.cs index d45c746..04a455d 100644 --- a/Wallet/ArchiveItemHandler.cs +++ b/Wallet/ArchiveItemHandler.cs @@ -24,11 +24,10 @@ public class ArchiveItemHandler(IDecoratorService> decorato cache.Remove(item); publisher.Publish(Changed.As()); } - } + } } catch { - } } } \ No newline at end of file diff --git a/Wallet/AttachmentEntryCollectionViewModel.cs b/Wallet/AttachmentEntryCollectionViewModel.cs index 29d8326..9754357 100644 --- a/Wallet/AttachmentEntryCollectionViewModel.cs +++ b/Wallet/AttachmentEntryCollectionViewModel.cs @@ -14,4 +14,4 @@ public partial class AttachmentEntryCollectionViewModel(IServiceProvider provide ICollection value, bool isConcealed, bool isRevealed, - double width) : ItemEntryCollectionViewModel>(provider, factory, mediator, publisher, subscriber, disposer, state, configuration, key, value, isConcealed, isRevealed, width); + double width) : ItemEntryCollectionViewModel>(provider, factory, mediator, publisher, subscriber, disposer, state, configuration, key, value, isConcealed, isRevealed, width); \ No newline at end of file diff --git a/Wallet/CategoriesNavigationViewModelActivationHandler.cs b/Wallet/CategoriesNavigationViewModelActivationHandler.cs index 2b9fc86..b5f817d 100644 --- a/Wallet/CategoriesNavigationViewModelActivationHandler.cs +++ b/Wallet/CategoriesNavigationViewModelActivationHandler.cs @@ -25,4 +25,4 @@ public class CategoriesNavigationViewModelActivationHandler(IMediator mediator, } } } -} +} \ No newline at end of file diff --git a/Wallet/CloseWalletHandler.cs b/Wallet/CloseWalletHandler.cs index a3855c6..f8bab6a 100644 --- a/Wallet/CloseWalletHandler.cs +++ b/Wallet/CloseWalletHandler.cs @@ -5,10 +5,10 @@ namespace Wallet; public class CloseWalletHandler(IDecoratorService walletConnectionDecorator) : IHandler, bool> { - public Task Handle(CloseEventArgs args, + public Task Handle(CloseEventArgs args, CancellationToken cancellationToken) { walletConnectionDecorator.Set(null); return Task.FromResult(true); } -} +} \ No newline at end of file diff --git a/Wallet/Closed.cs b/Wallet/Closed.cs index d2e21ff..a23018f 100644 --- a/Wallet/Closed.cs +++ b/Wallet/Closed.cs @@ -1,6 +1,4 @@ -using Toolkit.Foundation; - -namespace Wallet; +namespace Wallet; public record Closed { diff --git a/Wallet/Comment.cs b/Wallet/Comment.cs index 6330f80..4a1e675 100644 --- a/Wallet/Comment.cs +++ b/Wallet/Comment.cs @@ -5,4 +5,4 @@ public record Comment public DateTimeOffset DateTime { get; set; } public string? Text { get; set; } -} +} \ No newline at end of file diff --git a/Wallet/CommentEntryCollectionViewModel.cs b/Wallet/CommentEntryCollectionViewModel.cs index 69c0320..eac7f24 100644 --- a/Wallet/CommentEntryCollectionViewModel.cs +++ b/Wallet/CommentEntryCollectionViewModel.cs @@ -39,8 +39,10 @@ public partial class CommentEntryCollectionViewModel(IServiceProvider provider, } else { - RemoveAt(Count - 1); + if (Count > 0) + { + RemoveAt(Count - 1); + } } } -} - +} \ No newline at end of file diff --git a/Wallet/CommentEntryCollectionViewModelHandler.cs b/Wallet/CommentEntryCollectionViewModelHandler.cs index c82514c..6c1c6fc 100644 --- a/Wallet/CommentEntryCollectionViewModelHandler.cs +++ b/Wallet/CommentEntryCollectionViewModelHandler.cs @@ -14,7 +14,7 @@ public class CommentEntryCollectionViewModelHandler(IServiceFactory serviceFacto List values = configuration.Value is not null ? new List(configuration.Value) : []; double? width = configuration.Width; - if (serviceFactory.Create(args => args.Initialize(), + if (serviceFactory.Create(args => args.Initialize(), [.. args.Parameters, configuration, label, values, false, false, width]) is CommentEntryCollectionViewModel viewModel) { @@ -29,5 +29,4 @@ public class CommentEntryCollectionViewModelHandler(IServiceFactory serviceFacto return Task.FromResult(default); } -} - +} \ No newline at end of file diff --git a/Wallet/ConfirmCreateItemHandler.cs b/Wallet/ConfirmCreateItemHandler.cs index 5a4ecd9..575abeb 100644 --- a/Wallet/ConfirmCreateItemHandler.cs +++ b/Wallet/ConfirmCreateItemHandler.cs @@ -20,7 +20,7 @@ public class ConfirmCreateItemHandler(IMediator mediator, Guid id = Guid.NewGuid(); await mediator.Handle, bool>(new CreateEventArgs<(Guid, string, string, IImageDescriptor?, + ItemConfiguration)>, bool>(new CreateEventArgs<(Guid, string, string, IImageDescriptor?, ItemConfiguration)>((id, name, category, imageDescriptor ?? default, itemConfiguration))); Item<(Guid, string, string)> item = new((id, name, category)); @@ -30,4 +30,4 @@ public class ConfirmCreateItemHandler(IMediator mediator, } } } -} +} \ No newline at end of file diff --git a/Wallet/ConfirmUpdateItemHandler.cs b/Wallet/ConfirmUpdateItemHandler.cs index 43bd8d3..9b2bdc1 100644 --- a/Wallet/ConfirmUpdateItemHandler.cs +++ b/Wallet/ConfirmUpdateItemHandler.cs @@ -25,9 +25,9 @@ public class ConfirmUpdateItemHandler(IDecoratorService> it (Guid id, _) = item.Value; - await mediator.Handle>, bool>(new UpdateEventArgs>(new Item<(Guid, string, string, IImageDescriptor?, ItemConfiguration)>((id, + ItemConfiguration)>>(new Item<(Guid, string, string, IImageDescriptor?, ItemConfiguration)>((id, name, category, imageDescriptor, itemConfiguration)))); Item<(Guid, string)> newItem = new((id, name)); diff --git a/Wallet/CountCategoriesHandler.cs b/Wallet/CountCategoriesHandler.cs index 1431971..198a771 100644 --- a/Wallet/CountCategoriesHandler.cs +++ b/Wallet/CountCategoriesHandler.cs @@ -4,10 +4,10 @@ using Wallet.Data; namespace Wallet; -public class CountCategoriesHandler(IDbContextFactory dbContextFactory) : +public class CountCategoriesHandler(IDbContextFactory dbContextFactory) : IHandler, IReadOnlyCollection<(string, int)>> { - public async Task> Handle(CountEventArgs args, + public async Task> Handle(CountEventArgs args, CancellationToken cancellationToken) { using WalletContext context = await dbContextFactory.CreateDbContextAsync(cancellationToken); @@ -49,4 +49,4 @@ public class CountCategoriesHandler(IDbContextFactory dbContextFa return combinedCounts; } -} +} \ No newline at end of file diff --git a/Wallet/CreateItemHandler.cs b/Wallet/CreateItemHandler.cs index 75bc4c1..b1bcd4f 100644 --- a/Wallet/CreateItemHandler.cs +++ b/Wallet/CreateItemHandler.cs @@ -1,9 +1,9 @@ -using Wallet.Data; -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.ChangeTracking; using System.Text; using System.Text.Json; using Toolkit.Foundation; +using Wallet.Data; namespace Wallet; @@ -15,7 +15,7 @@ public class CreateItemHandler(IImageWriter imageWriter, CancellationToken cancellationToken) { (Guid id, string name, string category, IImageDescriptor? imageDescriptor, ItemConfiguration configuration) = args.Sender; - + try { string content = JsonSerializer.Serialize(configuration); diff --git a/Wallet/CreateProfileImageHandler.cs b/Wallet/CreateProfileImageHandler.cs index d155347..f182287 100644 --- a/Wallet/CreateProfileImageHandler.cs +++ b/Wallet/CreateProfileImageHandler.cs @@ -2,8 +2,8 @@ namespace Wallet; -public class CreateProfileImageHandler(IFileProvider fileProvider, - IImageReader imageReader) : +public class CreateProfileImageHandler(IFileProvider fileProvider, + IImageReader imageReader) : IHandler, IImageDescriptor?> { public async Task Handle(CreateEventArgs args, @@ -21,4 +21,4 @@ public class CreateProfileImageHandler(IFileProvider fileProvider, return default; } -} +} \ No newline at end of file diff --git a/Wallet/DateEntryViewModel.cs b/Wallet/DateEntryViewModel.cs index e2e6b17..c3ca329 100644 --- a/Wallet/DateEntryViewModel.cs +++ b/Wallet/DateEntryViewModel.cs @@ -14,4 +14,4 @@ public partial class DateEntryViewModel(IServiceProvider provider, DateTimeOffset? value, bool isConcealed, bool isRevealed, - double width) : ItemEntryViewModel(provider, factory, mediator, publisher, subscriber, disposer, state, configuration, key, value, isConcealed, isRevealed, width); + double width) : ItemEntryViewModel(provider, factory, mediator, publisher, subscriber, disposer, state, configuration, key, value, isConcealed, isRevealed, width); \ No newline at end of file diff --git a/Wallet/DateEntryViewModelHandler.cs b/Wallet/DateEntryViewModelHandler.cs index 6eeb4b8..50ab552 100644 --- a/Wallet/DateEntryViewModelHandler.cs +++ b/Wallet/DateEntryViewModelHandler.cs @@ -15,7 +15,7 @@ public class DateEntryViewModelHandler(IServiceFactory serviceFactory) : DateTimeOffset? value = configuration.Value is not null ? configuration.Value : DateTimeOffset.Now; double? width = configuration.Width; - if (serviceFactory.Create(args => args.Initialize(), + if (serviceFactory.Create(args => args.Initialize(), [.. args.Parameters, configuration, label, value, false, false, width]) is DateEntryViewModel viewModel) { diff --git a/Wallet/DigitRule.cs b/Wallet/DigitRule.cs index b120ac0..8c4da96 100644 --- a/Wallet/DigitRule.cs +++ b/Wallet/DigitRule.cs @@ -2,7 +2,7 @@ namespace Wallet; -public partial class DigitRule : +public partial class DigitRule : IPasswordRule { public int CalculateScore(string password) => @@ -10,4 +10,4 @@ public partial class DigitRule : [GeneratedRegex(@"\d")] private static partial Regex Regex(); -} +} \ No newline at end of file diff --git a/Wallet/DiversityBonusRule.cs b/Wallet/DiversityBonusRule.cs index f188081..c8afe40 100644 --- a/Wallet/DiversityBonusRule.cs +++ b/Wallet/DiversityBonusRule.cs @@ -2,7 +2,7 @@ namespace Wallet; -public partial class DiversityBonusRule : +public partial class DiversityBonusRule : IPasswordRule { public int CalculateScore(string password) diff --git a/Wallet/DropdownEntryCollectionConfiguration.cs b/Wallet/DropdownEntryCollectionConfiguration.cs index 137ff17..1469569 100644 --- a/Wallet/DropdownEntryCollectionConfiguration.cs +++ b/Wallet/DropdownEntryCollectionConfiguration.cs @@ -7,4 +7,4 @@ public record DropdownEntryCollectionConfiguration : { [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] public IList Values { get; set; } = new List(); -} +} \ No newline at end of file diff --git a/Wallet/DropdownEntryCollectionViewModel.cs b/Wallet/DropdownEntryCollectionViewModel.cs index f95763d..09aaf12 100644 --- a/Wallet/DropdownEntryCollectionViewModel.cs +++ b/Wallet/DropdownEntryCollectionViewModel.cs @@ -2,18 +2,18 @@ namespace Wallet; -public partial class DropdownEntryCollectionViewModel : +public partial class DropdownEntryCollectionViewModel : ItemEntryCollectionViewModel { public DropdownEntryCollectionViewModel(IServiceProvider provider, - IServiceFactory factory, + IServiceFactory factory, IMediator mediator, IPublisher publisher, ISubscriber subscriber, - IDisposer disposer, + IDisposer disposer, IEnumerable items, ItemState state, - DropdownEntryCollectionConfiguration configuration, + DropdownEntryCollectionConfiguration configuration, string key, object value, bool isConcealed, diff --git a/Wallet/DropdownEntryCollectionViewModelHandler.cs b/Wallet/DropdownEntryCollectionViewModelHandler.cs index a67c28b..9f845dc 100644 --- a/Wallet/DropdownEntryCollectionViewModelHandler.cs +++ b/Wallet/DropdownEntryCollectionViewModelHandler.cs @@ -34,4 +34,4 @@ public class DropdownEntryCollectionViewModelHandler(IServiceFactory serviceFact return Task.FromResult(default); } -} +} \ No newline at end of file diff --git a/Wallet/DropdownEntryViewModel.cs b/Wallet/DropdownEntryViewModel.cs index 5199bfa..b1aee4e 100644 --- a/Wallet/DropdownEntryViewModel.cs +++ b/Wallet/DropdownEntryViewModel.cs @@ -7,5 +7,5 @@ public partial class DropdownEntryViewModel(IServiceProvider provider, IMediator mediator, IPublisher publisher, ISubscriber subscriber, - IDisposer disposer, - string? value = default) : Observable(provider, factory, mediator, publisher, subscriber, disposer, value); + IDisposer disposer, + string? value = default) : Observable(provider, factory, mediator, publisher, subscriber, disposer, value); \ No newline at end of file diff --git a/Wallet/EmptyItemCollectionViewModel.cs b/Wallet/EmptyItemCollectionViewModel.cs index dd91b57..412d794 100644 --- a/Wallet/EmptyItemCollectionViewModel.cs +++ b/Wallet/EmptyItemCollectionViewModel.cs @@ -4,13 +4,13 @@ using Toolkit.Foundation; namespace Wallet; public partial class EmptyItemCollectionViewModel(IServiceProvider provider, - IServiceFactory factory, - IMediator mediator, + IServiceFactory factory, + IMediator mediator, IPublisher publisher, - ISubscriber subscriber, + ISubscriber subscriber, IDisposer disposer, NamedComponent named) : Observable(provider, factory, mediator, publisher, subscriber, disposer) { [ObservableProperty] private string named = $"{named}"; -} +} \ No newline at end of file diff --git a/Wallet/FilterNavigationViewModel.cs b/Wallet/FilterNavigationViewModel.cs index 21bfe1a..a21a221 100644 --- a/Wallet/FilterNavigationViewModel.cs +++ b/Wallet/FilterNavigationViewModel.cs @@ -11,7 +11,7 @@ public abstract partial class FilterNavigationViewModel(IServiceProvider provide ISubscriber subscriber, IDisposer disposer, int key, - string value) : + string value) : ObservableCollection(provider, factory, mediator, publisher, subscriber, disposer, key, value), INavigationViewModel, INotificationHandler>, @@ -74,7 +74,7 @@ public abstract partial class FilterNavigationViewModel(IServ public Task Handle(DeactivatedEventArgs args) { IsSelected = false; - IsActivated = false; + IsActivated = false; return Task.CompletedTask; } diff --git a/Wallet/Hyperlink.cs b/Wallet/Hyperlink.cs index 35e0b5c..8ecc40c 100644 --- a/Wallet/Hyperlink.cs +++ b/Wallet/Hyperlink.cs @@ -1,3 +1,3 @@ namespace Wallet; -public record Hyperlink(string? Value); +public record Hyperlink(string? Value); \ No newline at end of file diff --git a/Wallet/HyperlinkEntryViewModelHandler.cs b/Wallet/HyperlinkEntryViewModelHandler.cs index 2f68931..93911d4 100644 --- a/Wallet/HyperlinkEntryViewModelHandler.cs +++ b/Wallet/HyperlinkEntryViewModelHandler.cs @@ -14,7 +14,7 @@ public class HyperlinkEntryViewModelHandler(IServiceFactory serviceFactory) : string? value = $"{configuration.Value}" ?? ""; double? width = configuration.Width; - if (serviceFactory.Create(args => args.Initialize(), + if (serviceFactory.Create(args => args.Initialize(), [.. args.Parameters, configuration, label, value, false, false, width]) is HyperlinkEntryViewModel viewModel) { @@ -24,4 +24,4 @@ public class HyperlinkEntryViewModelHandler(IServiceFactory serviceFactory) : return Task.FromResult(default); } -} +} \ No newline at end of file diff --git a/Wallet/HyperlinkHandler.cs b/Wallet/HyperlinkHandler.cs index a333ff6..e591529 100644 --- a/Wallet/HyperlinkHandler.cs +++ b/Wallet/HyperlinkHandler.cs @@ -3,7 +3,7 @@ using Toolkit.Foundation; namespace Wallet; -public class HyperlinkHandler : +public class HyperlinkHandler : INotificationHandler> { public Task Handle(CreateEventArgs args) @@ -16,10 +16,9 @@ public class HyperlinkHandler : } catch { - } } return Task.CompletedTask; } -} +} \ No newline at end of file diff --git a/Wallet/ICommentEntryViewModel.cs b/Wallet/ICommentEntryViewModel.cs index 17c86a7..2a320d3 100644 --- a/Wallet/ICommentEntryViewModel.cs +++ b/Wallet/ICommentEntryViewModel.cs @@ -1,3 +1,3 @@ namespace Wallet; -public interface ICommentEntryViewModel : IItemEntryViewModel; +public interface ICommentEntryViewModel : IItemEntryViewModel; \ No newline at end of file diff --git a/Wallet/IItemConfigurationCollection.cs b/Wallet/IItemConfigurationCollection.cs index cb02ad2..a6156a7 100644 --- a/Wallet/IItemConfigurationCollection.cs +++ b/Wallet/IItemConfigurationCollection.cs @@ -1,4 +1,4 @@ namespace Wallet; public interface IItemConfigurationCollection : - IReadOnlyDictionary>; + IReadOnlyDictionary>; \ No newline at end of file diff --git a/Wallet/IItemEntryConfiguration.cs b/Wallet/IItemEntryConfiguration.cs index 1cd3a74..58b9659 100644 --- a/Wallet/IItemEntryConfiguration.cs +++ b/Wallet/IItemEntryConfiguration.cs @@ -34,4 +34,4 @@ public interface IItemEntryConfiguration : [JsonDerivedType(typeof(DateEntryConfiguration), typeDiscriminator: "Date")] [JsonDerivedType(typeof(HyperlinkEntryConfiguration), typeDiscriminator: "Hyperlink")] [JsonDerivedType(typeof(PinEntryConfiguration), typeDiscriminator: "Pin")] -public interface IItemEntryConfiguration; +public interface IItemEntryConfiguration; \ No newline at end of file diff --git a/Wallet/IItemViewModel.cs b/Wallet/IItemViewModel.cs index b2e1c4d..9614c0c 100644 --- a/Wallet/IItemViewModel.cs +++ b/Wallet/IItemViewModel.cs @@ -1,4 +1,4 @@ namespace Wallet; -public interface IItemViewModel : +public interface IItemViewModel : IDisposable; \ No newline at end of file diff --git a/Wallet/INavigationViewModel.cs b/Wallet/INavigationViewModel.cs index 3572f36..da3e0fe 100644 --- a/Wallet/INavigationViewModel.cs +++ b/Wallet/INavigationViewModel.cs @@ -1,4 +1,4 @@ namespace Wallet; -public interface INavigationViewModel : +public interface INavigationViewModel : IDisposable; \ No newline at end of file diff --git a/Wallet/IPasswordRule.cs b/Wallet/IPasswordRule.cs index 4b1c707..8aefde4 100644 --- a/Wallet/IPasswordRule.cs +++ b/Wallet/IPasswordRule.cs @@ -3,4 +3,4 @@ public interface IPasswordRule { int CalculateScore(string password); -} +} \ No newline at end of file diff --git a/Wallet/IWalletConnectionFactory.cs b/Wallet/IWalletConnectionFactory.cs index ffcfb54..35e5024 100644 --- a/Wallet/IWalletConnectionFactory.cs +++ b/Wallet/IWalletConnectionFactory.cs @@ -1,5 +1,4 @@ - -namespace Wallet +namespace Wallet { public interface IWalletConnectionFactory { diff --git a/Wallet/IWalletFactory.cs b/Wallet/IWalletFactory.cs index ba6ab95..10bee15 100644 --- a/Wallet/IWalletFactory.cs +++ b/Wallet/IWalletFactory.cs @@ -4,7 +4,7 @@ namespace Wallet; public interface IWalletFactory { - Task Create(string name, + Task Create(string name, string password, IImageDescriptor? imageDescriptor); -} +} \ No newline at end of file diff --git a/Wallet/ImageEntryConfiguration.cs b/Wallet/ImageEntryConfiguration.cs index abf7335..ba60b45 100644 --- a/Wallet/ImageEntryConfiguration.cs +++ b/Wallet/ImageEntryConfiguration.cs @@ -1,4 +1,4 @@ namespace Wallet; public record ImageEntryConfiguration : - ItemEntryConfiguration; + ItemEntryConfiguration; \ No newline at end of file diff --git a/Wallet/ItemCategoryNavigationCollectionViewModel.cs b/Wallet/ItemCategoryNavigationCollectionViewModel.cs index 56fc66e..03b2322 100644 --- a/Wallet/ItemCategoryNavigationCollectionViewModel.cs +++ b/Wallet/ItemCategoryNavigationCollectionViewModel.cs @@ -25,4 +25,4 @@ public partial class ItemCategoryNavigationCollectionViewModel(IServiceProvider return base.OnActivated(); } -} +} \ No newline at end of file diff --git a/Wallet/ItemCategoryNavigationViewModel.cs b/Wallet/ItemCategoryNavigationViewModel.cs index da0b84c..7f5134d 100644 --- a/Wallet/ItemCategoryNavigationViewModel.cs +++ b/Wallet/ItemCategoryNavigationViewModel.cs @@ -24,4 +24,4 @@ public partial class ItemCategoryNavigationViewModel(IServiceProvider provider, [RelayCommand] private void Invoke() => Publisher.Publish(Notify.As(new ItemCategory(Name))); -} +} \ No newline at end of file diff --git a/Wallet/ItemCategoryViewModelActivatedHandler.cs b/Wallet/ItemCategoryViewModelActivatedHandler.cs index 02fa5f8..e6dc66a 100644 --- a/Wallet/ItemCategoryViewModelActivatedHandler.cs +++ b/Wallet/ItemCategoryViewModelActivatedHandler.cs @@ -12,7 +12,7 @@ public class ItemCategoryViewModelActivatedHandler(IItemConfigurationCollection bool selected = true; foreach (KeyValuePair> configuration in configurations) { - if (serviceFactory.Create(args => args.Initialize(), + if (serviceFactory.Create(args => args.Initialize(), configuration.Key, selected) is ItemCategoryNavigationViewModel viewModel) { @@ -23,4 +23,4 @@ public class ItemCategoryViewModelActivatedHandler(IItemConfigurationCollection return Task.CompletedTask; } -} +} \ No newline at end of file diff --git a/Wallet/ItemChangedHandler.cs b/Wallet/ItemChangedHandler.cs index 805bdb4..540c56d 100644 --- a/Wallet/ItemChangedHandler.cs +++ b/Wallet/ItemChangedHandler.cs @@ -3,15 +3,15 @@ namespace Wallet; public class ItemChangedHandler(IMediator mediator, - IPublisher publisher) : + IPublisher publisher) : INotificationHandler> { public async Task Handle(ChangedEventArgs args) { - IReadOnlyCollection<(string, int)>? counts = await mediator.Handle, + IReadOnlyCollection<(string, int)>? counts = await mediator.Handle, IReadOnlyCollection<(string, int)>>(Count.As()); - if (counts is { Count: > 0 } ) + if (counts is { Count: > 0 }) { foreach ((string key, int count) in counts) { @@ -19,4 +19,4 @@ public class ItemChangedHandler(IMediator mediator, } } } -} +} \ No newline at end of file diff --git a/Wallet/ItemCommandHeaderCollection.cs b/Wallet/ItemCommandHeaderCollection.cs index 70459ca..7f47bc7 100644 --- a/Wallet/ItemCommandHeaderCollection.cs +++ b/Wallet/ItemCommandHeaderCollection.cs @@ -3,4 +3,4 @@ namespace Wallet; public class ItemCommandHeaderCollection(IList list) : - ReadOnlyCollection(list); + ReadOnlyCollection(list); \ No newline at end of file diff --git a/Wallet/ItemCommandHeaderViewModel.cs b/Wallet/ItemCommandHeaderViewModel.cs index 33c93f4..80d6f23 100644 --- a/Wallet/ItemCommandHeaderViewModel.cs +++ b/Wallet/ItemCommandHeaderViewModel.cs @@ -26,7 +26,7 @@ public partial class ItemCommandHeaderViewModel(IServiceProvider provider, } }); } - + return Task.CompletedTask; } } \ No newline at end of file diff --git a/Wallet/ItemConfiguration.cs b/Wallet/ItemConfiguration.cs index 2c71916..436e4e4 100644 --- a/Wallet/ItemConfiguration.cs +++ b/Wallet/ItemConfiguration.cs @@ -83,7 +83,7 @@ public record ItemConfiguration Label = "Name on account" }, new DropdownEntryCollectionConfiguration - { + { Label = "Type", Values = [ "Checking Account", diff --git a/Wallet/ItemConfigurationCollection.cs b/Wallet/ItemConfigurationCollection.cs index f3cf712..381fb8a 100644 --- a/Wallet/ItemConfigurationCollection.cs +++ b/Wallet/ItemConfigurationCollection.cs @@ -2,6 +2,6 @@ namespace Wallet; -public class ItemConfigurationCollection(IDictionary> dictionary) : +public class ItemConfigurationCollection(IDictionary> dictionary) : ReadOnlyDictionary>(dictionary), - IItemConfigurationCollection; + IItemConfigurationCollection; \ No newline at end of file diff --git a/Wallet/ItemContentFromCategoryViewModelActivationHandler.cs b/Wallet/ItemContentFromCategoryViewModelActivationHandler.cs index bde3ced..505ee2d 100644 --- a/Wallet/ItemContentFromCategoryViewModelActivationHandler.cs +++ b/Wallet/ItemContentFromCategoryViewModelActivationHandler.cs @@ -46,4 +46,4 @@ public class ItemContentFromCategoryViewModelActivationHandler(IItemConfiguratio } } } -} +} \ No newline at end of file diff --git a/Wallet/ItemContentViewModel.cs b/Wallet/ItemContentViewModel.cs index 292092e..e98d8ff 100644 --- a/Wallet/ItemContentViewModel.cs +++ b/Wallet/ItemContentViewModel.cs @@ -18,7 +18,7 @@ public partial class ItemContentViewModel(IServiceProvider provider, public Task Handle(NotifyEventArgs> args) { - if (args.Sender is ItemCategory category + if (args.Sender is ItemCategory category && category.Value is string value) { Activate(() => new ActivationBuilder(new ActivationEventArgs>, + (_, _, _, _, ItemConfiguration? configuration) = await mediator.Handle>, (Guid, string, string?, string, ItemConfiguration?)>(Request.As(new Item(Id))); if (configuration is not null) @@ -49,4 +49,4 @@ public class ItemContentViewModelActivationHandler(IDecoratorService : +public partial class ItemEntryCollectionViewModel : ObservableCollection, IItemEntryViewModel, IHandler, bool>, @@ -97,7 +97,6 @@ public partial class ItemEntryCollectionViewModel : protected virtual void OnStateChanged() { - } public Task Handle(ConfirmEventArgs args) diff --git a/Wallet/ItemEntryConfiguration.cs b/Wallet/ItemEntryConfiguration.cs index 77a1e0f..d01599f 100644 --- a/Wallet/ItemEntryConfiguration.cs +++ b/Wallet/ItemEntryConfiguration.cs @@ -14,7 +14,7 @@ namespace Wallet; [JsonDerivedType(typeof(DateEntryConfiguration), typeDiscriminator: "Date")] [JsonDerivedType(typeof(HyperlinkEntryConfiguration), typeDiscriminator: "Hyperlink")] [JsonDerivedType(typeof(PinEntryConfiguration), typeDiscriminator: "Pin")] -public record ItemEntryConfiguration : +public record ItemEntryConfiguration : IItemEntryConfiguration { [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] diff --git a/Wallet/ItemHandler.cs b/Wallet/ItemHandler.cs index c7b3a62..478a59f 100644 --- a/Wallet/ItemHandler.cs +++ b/Wallet/ItemHandler.cs @@ -1,14 +1,14 @@ -using Wallet.Data; -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using System.Text.Json; using Toolkit.Foundation; +using Wallet.Data; namespace Wallet; -public class ItemHandler(IDbContextFactory dbContextFactory) : +public class ItemHandler(IDbContextFactory dbContextFactory) : IHandler>, (Guid, string, string?, string, ItemConfiguration?)> { - public async Task<(Guid, string, string?, string, ItemConfiguration?)> Handle(RequestEventArgs> args, + public async Task<(Guid, string, string?, string, ItemConfiguration?)> Handle(RequestEventArgs> args, CancellationToken cancellationToken) { if (args.Sender is Item item) @@ -43,7 +43,6 @@ public class ItemHandler(IDbContextFactory dbContextFactory) : } catch { - } } @@ -53,4 +52,4 @@ public class ItemHandler(IDbContextFactory dbContextFactory) : return default; } -} +} \ No newline at end of file diff --git a/Wallet/ItemHeader.cs b/Wallet/ItemHeader.cs index 43ad3f0..7276eda 100644 --- a/Wallet/ItemHeader.cs +++ b/Wallet/ItemHeader.cs @@ -2,4 +2,4 @@ public record ItemHeader(TValue Value); -public record ItemHeader; +public record ItemHeader; \ No newline at end of file diff --git a/Wallet/ItemHeaderViewModel.cs b/Wallet/ItemHeaderViewModel.cs index 8c7ad5a..21713a3 100644 --- a/Wallet/ItemHeaderViewModel.cs +++ b/Wallet/ItemHeaderViewModel.cs @@ -4,7 +4,7 @@ using Toolkit.Foundation; namespace Wallet; -public partial class ItemHeaderViewModel : +public partial class ItemHeaderViewModel : Observable, IHandler, bool>, INotificationHandler>, @@ -110,7 +110,7 @@ public partial class ItemHeaderViewModel : private async Task Import() => ImageDescriptor = await Mediator.Handle, IImageDescriptor>(Create.As()); - partial void OnImageDescriptorChanged(IImageDescriptor? value) + private partial void OnImageDescriptorChanged(IImageDescriptor? value) { if (configuration is not null) { @@ -118,7 +118,7 @@ public partial class ItemHeaderViewModel : } } - partial void OnImageDescriptorChanged(IImageDescriptor? oldValue, + private partial void OnImageDescriptorChanged(IImageDescriptor? oldValue, IImageDescriptor? newValue) { if (configuration is not null) diff --git a/Wallet/ItemImageHandler.cs b/Wallet/ItemImageHandler.cs index e839dce..7e7b101 100644 --- a/Wallet/ItemImageHandler.cs +++ b/Wallet/ItemImageHandler.cs @@ -1,6 +1,6 @@ -using Wallet.Data; -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using Toolkit.Foundation; +using Wallet.Data; namespace Wallet; @@ -24,7 +24,7 @@ public class ItemImageHandler(IDbContextFactory dbContextFactory, }) .FirstOrDefaultAsync(cancellationToken); - if (result is not null && + if (result is not null && result.Image is BlobEntity image && image.Data is { Length: > 0 } data) { @@ -35,4 +35,4 @@ public class ItemImageHandler(IDbContextFactory dbContextFactory, return default; } -} +} \ No newline at end of file diff --git a/Wallet/ItemNavigationCollectionViewModel.cs b/Wallet/ItemNavigationCollectionViewModel.cs index 4c6bc24..3e90660 100644 --- a/Wallet/ItemNavigationCollectionViewModel.cs +++ b/Wallet/ItemNavigationCollectionViewModel.cs @@ -71,4 +71,4 @@ public partial class ItemNavigationCollectionViewModel : protected override ActivationBuilder ActivationBuilder() => new(Activation.As(configuration)); -} +} \ No newline at end of file diff --git a/Wallet/ItemNavigationCollectionViewModelActivatedHandler.cs b/Wallet/ItemNavigationCollectionViewModelActivatedHandler.cs index 6d47e20..0a4c5d5 100644 --- a/Wallet/ItemNavigationCollectionViewModelActivatedHandler.cs +++ b/Wallet/ItemNavigationCollectionViewModelActivatedHandler.cs @@ -17,7 +17,7 @@ public class ItemNavigationCollectionViewModelActivatedHandler(IMediator mediato cache.Clear(); bool selected = true; - IReadOnlyCollection<(Guid Id, string Name, string Category, bool Favourite, bool Archived)>? results = + IReadOnlyCollection<(Guid Id, string Name, string Category, bool Favourite, bool Archived)>? results = await mediator.Handle>, IReadOnlyCollection<(Guid Id, string Name, string Category, bool Favourite, bool Archived)>>(Query.As(new Wallet<(string?, string?)>((configuration.Filter, configuration.Query)))); @@ -31,8 +31,8 @@ public class ItemNavigationCollectionViewModelActivatedHandler(IMediator mediato IDecoratorService> decoratorService = serviceScope.ServiceProvider .GetRequiredService>>(); - if (serviceFactory.Create(args => args.Initialize(), configuration.Filter, - Id, Name, "Description", Category, selected, Favourite, Archived) + if (serviceFactory.Create(args => args.Initialize(), configuration.Filter, + Id, Name, "Description", Category, selected, Favourite, Archived) is ItemNavigationViewModel viewModel) { Item<(Guid, string)> item = new((Id, Name)); diff --git a/Wallet/ItemNavigationViewModelActivatedHandler.cs b/Wallet/ItemNavigationViewModelActivatedHandler.cs index dda1096..9019786 100644 --- a/Wallet/ItemNavigationViewModelActivatedHandler.cs +++ b/Wallet/ItemNavigationViewModelActivatedHandler.cs @@ -17,4 +17,4 @@ public class ItemNavigationViewModelActivatedHandler(IMediator mediator, publisher.Publish(Notify.As(new Item(imageDescriptor))); } } -} +} \ No newline at end of file diff --git a/Wallet/ItemSectionViewModel.cs b/Wallet/ItemSectionViewModel.cs index 2c3f4d2..e32fd07 100644 --- a/Wallet/ItemSectionViewModel.cs +++ b/Wallet/ItemSectionViewModel.cs @@ -16,4 +16,4 @@ public partial class ItemSectionViewModel(IServiceProvider provider, public string Id => id; public IContentTemplate Template { get; set; } = template; -} +} \ No newline at end of file diff --git a/Wallet/ItemState.cs b/Wallet/ItemState.cs index 929c935..11178a2 100644 --- a/Wallet/ItemState.cs +++ b/Wallet/ItemState.cs @@ -5,4 +5,4 @@ public enum ItemState New, Read, Write -} +} \ No newline at end of file diff --git a/Wallet/ItemViewModel.cs b/Wallet/ItemViewModel.cs index 6663b3a..54c54b0 100644 --- a/Wallet/ItemViewModel.cs +++ b/Wallet/ItemViewModel.cs @@ -1,6 +1,5 @@ using CommunityToolkit.Mvvm.ComponentModel; using Toolkit.Foundation; -using Wallet.Data; namespace Wallet; diff --git a/Wallet/LengthRule.cs b/Wallet/LengthRule.cs index 0d708aa..db90037 100644 --- a/Wallet/LengthRule.cs +++ b/Wallet/LengthRule.cs @@ -3,6 +3,6 @@ public class LengthRule : IPasswordRule { - public int CalculateScore(string password) => + public int CalculateScore(string password) => password.Length >= 8 ? 5 : 0; -} +} \ No newline at end of file diff --git a/Wallet/LowercaseRule.cs b/Wallet/LowercaseRule.cs index 618e1a2..6405121 100644 --- a/Wallet/LowercaseRule.cs +++ b/Wallet/LowercaseRule.cs @@ -2,13 +2,12 @@ namespace Wallet; -public partial class LowercaseRule : +public partial class LowercaseRule : IPasswordRule { public int CalculateScore(string password) => Regex().IsMatch(password) ? 2 : 0; - [GeneratedRegex(@"[a-z]")] private static partial Regex Regex(); -} +} \ No newline at end of file diff --git a/Wallet/MainViewModel.cs b/Wallet/MainViewModel.cs index 74ff033..262617d 100644 --- a/Wallet/MainViewModel.cs +++ b/Wallet/MainViewModel.cs @@ -32,7 +32,6 @@ public partial class MainViewModel : Reset(args => { args.SetSource(wallet, () => wallet); - SelectedItem = wallet; }, false); } else diff --git a/Wallet/MaskedTextEntryConfiguration.cs b/Wallet/MaskedTextEntryConfiguration.cs index d66e1b7..634316d 100644 --- a/Wallet/MaskedTextEntryConfiguration.cs +++ b/Wallet/MaskedTextEntryConfiguration.cs @@ -7,4 +7,4 @@ public record MaskedTextEntryConfiguration : { [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] public string? Pattern { get; set; } -} +} \ No newline at end of file diff --git a/Wallet/MaskedTextEntryViewModelHandler.cs b/Wallet/MaskedTextEntryViewModelHandler.cs index d7f1013..c6fcd38 100644 --- a/Wallet/MaskedTextEntryViewModelHandler.cs +++ b/Wallet/MaskedTextEntryViewModelHandler.cs @@ -14,7 +14,7 @@ public class MaskedTextEntryViewModelHandler(IServiceFactory serviceFactory) : string? value = $"{configuration.Value}" ?? ""; double? width = configuration.Width; - if (serviceFactory.Create(args => args.Initialize(), + if (serviceFactory.Create(args => args.Initialize(), [.. args.Parameters, configuration, configuration.Pattern, label, value, false, false, width]) is MaskedTextEntryViewModel viewModel) { @@ -24,4 +24,4 @@ public class MaskedTextEntryViewModelHandler(IServiceFactory serviceFactory) : return Task.FromResult(default); } -} +} \ No newline at end of file diff --git a/Wallet/NumberEntryConfiguration.cs b/Wallet/NumberEntryConfiguration.cs index bf13e3d..4059da4 100644 --- a/Wallet/NumberEntryConfiguration.cs +++ b/Wallet/NumberEntryConfiguration.cs @@ -1,6 +1,6 @@ namespace Wallet; -public record NumberEntryConfiguration : +public record NumberEntryConfiguration : ItemEntryConfiguration { public int MinLength { get; set; } diff --git a/Wallet/OpenWalletHandler.cs b/Wallet/OpenWalletHandler.cs index a25052d..208c138 100644 --- a/Wallet/OpenWalletHandler.cs +++ b/Wallet/OpenWalletHandler.cs @@ -12,7 +12,7 @@ public class OpenWalletHandler(IConfigurationDescriptor des public async Task Handle(OpenEventArgs> args, CancellationToken cancellationToken) { - if (args.Sender is Wallet Wallet && + if (args.Sender is Wallet Wallet && descriptor.Name is { Length: > 0 } name && Wallet.Value is { Length: > 0 } password) { @@ -22,10 +22,10 @@ public class OpenWalletHandler(IConfigurationDescriptor des byte[]? salt = Convert.FromBase64String(keyPart[0]); byte[]? encryptedKey = Convert.FromBase64String(keyPart[1]); - if (securityKeyFactory.Create(Encoding.UTF8.GetBytes(password), + if (securityKeyFactory.Create(Encoding.UTF8.GetBytes(password), encryptedKey, salt) is SecurityKey securityKey) { - if (await walletConnectionFactory.Create(name, Convert.ToBase64String(securityKey.DecryptedKey)) + if (await walletConnectionFactory.Create(name, Convert.ToBase64String(securityKey.DecryptedKey)) is WalletConnection connection) { walletConnectionDecorator.Set(connection); diff --git a/Wallet/OpenWalletViewModel.cs b/Wallet/OpenWalletViewModel.cs index 33ca83e..f5e1ff3 100644 --- a/Wallet/OpenWalletViewModel.cs +++ b/Wallet/OpenWalletViewModel.cs @@ -5,7 +5,7 @@ using Toolkit.Foundation; namespace Wallet; -public partial class OpenWalletViewModel : +public partial class OpenWalletViewModel : Observable { [ObservableProperty] @@ -22,10 +22,10 @@ public partial class OpenWalletViewModel : private string password; public OpenWalletViewModel(IValidation validation, - IServiceProvider provider, + IServiceProvider provider, IServiceFactory factory, - IMediator mediator, - IPublisher publisher, + IMediator mediator, + IPublisher publisher, ISubscriber subscriber, IDisposer disposer, string name, @@ -42,8 +42,8 @@ public partial class OpenWalletViewModel : { using (await new ActivityLock(this)) { - if (await Validation.Validate(() => Password, [new ValidationRule(async () => - await Mediator.Handle>, bool>(Open.As(new Wallet(Password))), + if (await Validation.Validate(() => Password, [new ValidationRule(async () => + await Mediator.Handle>, bool>(Open.As(new Wallet(Password))), "The password is incorrect, please try again.")])) { Publisher.Publish(Opened.As()); diff --git a/Wallet/PasswordEntryViewModelHandler.cs b/Wallet/PasswordEntryViewModelHandler.cs index 8af74de..fe93cc7 100644 --- a/Wallet/PasswordEntryViewModelHandler.cs +++ b/Wallet/PasswordEntryViewModelHandler.cs @@ -14,7 +14,7 @@ public class PasswordEntryViewModelHandler(IServiceFactory serviceFactory) : string? value = $"{configuration.Value}" ?? ""; double? width = configuration.Width; - if (serviceFactory.Create(args => args.Initialize(), + if (serviceFactory.Create(args => args.Initialize(), [.. args.Parameters, configuration, label, value, true, false, width]) is PasswordEntryViewModel viewModel) { @@ -24,4 +24,4 @@ public class PasswordEntryViewModelHandler(IServiceFactory serviceFactory) : return Task.FromResult(default); } -} +} \ No newline at end of file diff --git a/Wallet/PinEntryConfiguration.cs b/Wallet/PinEntryConfiguration.cs index 2eae0fb..9a6c0e7 100644 --- a/Wallet/PinEntryConfiguration.cs +++ b/Wallet/PinEntryConfiguration.cs @@ -6,4 +6,4 @@ public record PinEntryConfiguration : public int Minimum { get; set; } public int Maximum { get; set; } -} +} \ No newline at end of file diff --git a/Wallet/PinEntryViewModelHandler.cs b/Wallet/PinEntryViewModelHandler.cs index 683d330..b4ded3c 100644 --- a/Wallet/PinEntryViewModelHandler.cs +++ b/Wallet/PinEntryViewModelHandler.cs @@ -14,7 +14,7 @@ public class PinEntryViewModelHandler(IServiceFactory serviceFactory) : string? value = $"{configuration.Value}" ?? ""; double? width = configuration.Width; - if (serviceFactory.Create(args => args.Initialize(), + if (serviceFactory.Create(args => args.Initialize(), [.. args.Parameters, configuration, label, value, true, false, width]) is PinEntryViewModel viewModel) { @@ -24,4 +24,4 @@ public class PinEntryViewModelHandler(IServiceFactory serviceFactory) : return Task.FromResult(default); } -} +} \ No newline at end of file diff --git a/Wallet/ProfileImage.cs b/Wallet/ProfileImage.cs index 3787b87..8e5e3b0 100644 --- a/Wallet/ProfileImage.cs +++ b/Wallet/ProfileImage.cs @@ -2,5 +2,4 @@ public record ProfileImage; -public record ProfileImage(TValue Value); - +public record ProfileImage(TValue Value); \ No newline at end of file diff --git a/Wallet/QueryWalletHandler.cs b/Wallet/QueryWalletHandler.cs index 81c856e..9b51cec 100644 --- a/Wallet/QueryWalletHandler.cs +++ b/Wallet/QueryWalletHandler.cs @@ -1,15 +1,15 @@ -using Wallet.Data; -using LinqKit; +using LinqKit; using Microsoft.EntityFrameworkCore; using Toolkit.Foundation; +using Wallet.Data; namespace Wallet; public class QueryWalletHandler(IDbContextFactory dbContextFactory) : IHandler>, IReadOnlyCollection<(Guid Id, string? Name, string Category, bool Favourite, bool Archived)>> { - public async Task> - Handle(QueryEventArgs> args,CancellationToken cancellationToken) + public async Task> + Handle(QueryEventArgs> args, CancellationToken cancellationToken) { List<(Guid Id, string? Name, string Category, bool Favourite, bool Archived)> items = []; if (args.Sender is Wallet<(string, string)> Wallet) @@ -42,7 +42,6 @@ public class QueryWalletHandler(IDbContextFactory dbContextFactor .And(x => EF.Functions.Like(x.Category, $"%{filter}%")); } - if (text is { Length: > 0 }) { predicate = predicate.And(x => EF.Functions.Like(x.Name, $"%{text}%")); diff --git a/Wallet/SpecialCharRule.cs b/Wallet/SpecialCharRule.cs index 63cf993..b5c9afe 100644 --- a/Wallet/SpecialCharRule.cs +++ b/Wallet/SpecialCharRule.cs @@ -4,7 +4,7 @@ namespace Wallet; public partial class SpecialCharRule : IPasswordRule { - public int CalculateScore(string password) => + public int CalculateScore(string password) => Regex().IsMatch(password) ? 2 : 0; [GeneratedRegex(@"[^a-zA-Z0-9]")] diff --git a/Wallet/TextEntryViewModel.cs b/Wallet/TextEntryViewModel.cs index e5d3cbc..b12985f 100644 --- a/Wallet/TextEntryViewModel.cs +++ b/Wallet/TextEntryViewModel.cs @@ -14,4 +14,4 @@ public partial class TextEntryViewModel(IServiceProvider provider, string value, bool isConcealed, bool isRevealed, - double width) : ItemEntryViewModel(provider, factory, mediator, publisher, subscriber, disposer, state, configuration, key, value, isConcealed, isRevealed, width); + double width) : ItemEntryViewModel(provider, factory, mediator, publisher, subscriber, disposer, state, configuration, key, value, isConcealed, isRevealed, width); \ No newline at end of file diff --git a/Wallet/TextEntryViewModelHandler.cs b/Wallet/TextEntryViewModelHandler.cs index 032e5e1..3f80169 100644 --- a/Wallet/TextEntryViewModelHandler.cs +++ b/Wallet/TextEntryViewModelHandler.cs @@ -2,7 +2,7 @@ namespace Wallet; -public class TextEntryViewModelHandler(IServiceFactory serviceFactory) : +public class TextEntryViewModelHandler(IServiceFactory serviceFactory) : IHandler, IItemEntryViewModel?> { public Task Handle(CreateEventArgs args, @@ -14,7 +14,7 @@ public class TextEntryViewModelHandler(IServiceFactory serviceFactory) : string? value = $"{configuration.Value}" ?? ""; double? width = configuration.Width; - if (serviceFactory.Create(args => args.Initialize(), + if (serviceFactory.Create(args => args.Initialize(), [.. args.Parameters, configuration, label, value, false, false, width]) is TextEntryViewModel viewModel) { @@ -24,4 +24,4 @@ public class TextEntryViewModelHandler(IServiceFactory serviceFactory) : return Task.FromResult(default); } -} +} \ No newline at end of file diff --git a/Wallet/UpdateItemHander.cs b/Wallet/UpdateItemHander.cs index e660ed1..2962b58 100644 --- a/Wallet/UpdateItemHander.cs +++ b/Wallet/UpdateItemHander.cs @@ -1,8 +1,8 @@ -using Wallet.Data; -using Microsoft.EntityFrameworkCore; -using System.Text.Json; +using Microsoft.EntityFrameworkCore; using System.Text; +using System.Text.Json; using Toolkit.Foundation; +using Wallet.Data; namespace Wallet; diff --git a/Wallet/UpdateItemStateHandler.cs b/Wallet/UpdateItemStateHandler.cs index 677b905..5643638 100644 --- a/Wallet/UpdateItemStateHandler.cs +++ b/Wallet/UpdateItemStateHandler.cs @@ -1,13 +1,13 @@ -using Wallet.Data; -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using Toolkit.Foundation; +using Wallet.Data; namespace Wallet; -public class UpdateItemStateHandler(IDbContextFactory dbContextFactory) : +public class UpdateItemStateHandler(IDbContextFactory dbContextFactory) : IHandler, bool> { - public async Task Handle(UpdateEventArgs<(Guid, int)> args, + public async Task Handle(UpdateEventArgs<(Guid, int)> args, CancellationToken cancellationToken) { if (args.Sender is (Guid id, int state)) @@ -22,4 +22,4 @@ public class UpdateItemStateHandler(IDbContextFactory dbContextFa return false; } -} +} \ No newline at end of file diff --git a/Wallet/UppercaseRule.cs b/Wallet/UppercaseRule.cs index c81ff5a..2d2ff3e 100644 --- a/Wallet/UppercaseRule.cs +++ b/Wallet/UppercaseRule.cs @@ -10,4 +10,4 @@ public partial class UppercaseRule : [GeneratedRegex(@"[A-Z]")] private static partial Regex Regex(); -} +} \ No newline at end of file diff --git a/Wallet/WalletActivatedHandler.cs b/Wallet/WalletActivatedHandler.cs index a5cb67a..c945785 100644 --- a/Wallet/WalletActivatedHandler.cs +++ b/Wallet/WalletActivatedHandler.cs @@ -35,17 +35,17 @@ public class WalletActivatedHandler(IWalletHostCollection wallets, int index = sortedWallets.IndexOf(host); - if (host.Services.GetRequiredService>() is + if (host.Services.GetRequiredService>() is ConfigurationDescriptor descriptor) { if (host.Services.GetRequiredService() is IServiceFactory serviceFactory) { IDecoratorService> profileImageDecorator = host.Services.GetRequiredService>>(); - + ProfileImage? profileImage = profileImageDecorator.Value; - if (serviceFactory.Create(args => args.Initialize(), - descriptor.Name, profileImage?.Value, false) + if (serviceFactory.Create(args => args.Initialize(), + descriptor.Name, profileImage?.Value, false) is WalletNavigationViewModel viewModel) { publisher.Publish(Insert.As(index, viewModel), diff --git a/Wallet/WalletCollectionInitializer.cs b/Wallet/WalletCollectionInitializer.cs index bfa2546..0148078 100644 --- a/Wallet/WalletCollectionInitializer.cs +++ b/Wallet/WalletCollectionInitializer.cs @@ -3,9 +3,9 @@ using Toolkit.Foundation; namespace Wallet; -public class WalletCollectionInitializer(IHostEnvironment environment, +public class WalletCollectionInitializer(IHostEnvironment environment, IComponentFactory componentFactory, - IWalletHostCollection wallets) : + IWalletHostCollection wallets) : IInitialization { public void Initialize() diff --git a/Wallet/WalletComponent.cs b/Wallet/WalletComponent.cs index 5f99655..9acbd93 100644 --- a/Wallet/WalletComponent.cs +++ b/Wallet/WalletComponent.cs @@ -1,6 +1,4 @@ using Microsoft.Extensions.Hosting; -using System.Linq; -using System.Xml.Linq; using Toolkit.Foundation; namespace Wallet; diff --git a/Wallet/WalletConnection.cs b/Wallet/WalletConnection.cs index 3ba3098..323ffb1 100644 --- a/Wallet/WalletConnection.cs +++ b/Wallet/WalletConnection.cs @@ -2,7 +2,7 @@ namespace Wallet; -public record WalletConnection(string Value) : +public record WalletConnection(string Value) : IConnection { public override string ToString() => Value; diff --git a/Wallet/WalletConnectionFactory.cs b/Wallet/WalletConnectionFactory.cs index d8a419c..6f4eb3e 100644 --- a/Wallet/WalletConnectionFactory.cs +++ b/Wallet/WalletConnectionFactory.cs @@ -1,6 +1,6 @@ -using Wallet.Data; -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Hosting; +using Wallet.Data; namespace Wallet; @@ -32,4 +32,4 @@ public class WalletConnectionFactory(IHostEnvironment environment) : return null; } -} +} \ No newline at end of file diff --git a/Wallet/WalletDatabaseFactory.cs b/Wallet/WalletDatabaseFactory.cs index 8a51571..91fe5da 100644 --- a/Wallet/WalletDatabaseFactory.cs +++ b/Wallet/WalletDatabaseFactory.cs @@ -1,6 +1,6 @@ -using Wallet.Data; -using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Hosting; +using Wallet.Data; namespace Wallet; diff --git a/Wallet/WalletFactory.cs b/Wallet/WalletFactory.cs index a9f92a9..b3b8691 100644 --- a/Wallet/WalletFactory.cs +++ b/Wallet/WalletFactory.cs @@ -12,7 +12,7 @@ public class WalletFactory(ISecurityKeyFactory securityKeyFactory, IWalletFactory { public async Task Create(string name, - string password, + string password, IImageDescriptor? imageDescriptor) { if (securityKeyFactory.Create(Encoding.UTF8.GetBytes(password)) is SecurityKey key) @@ -36,4 +36,4 @@ public class WalletFactory(ISecurityKeyFactory securityKeyFactory, return false; } -} +} \ No newline at end of file diff --git a/Wallet/WalletNavigationCollectionViewModel.cs b/Wallet/WalletNavigationCollectionViewModel.cs index f7ca0b3..c6ea079 100644 --- a/Wallet/WalletNavigationCollectionViewModel.cs +++ b/Wallet/WalletNavigationCollectionViewModel.cs @@ -8,11 +8,11 @@ public partial class WalletNavigationCollectionViewModel : ObservableCollection, INotificationHandler> { - public WalletNavigationCollectionViewModel(IServiceProvider provider, + public WalletNavigationCollectionViewModel(IServiceProvider provider, IServiceFactory factory, IMediator mediator, IPublisher publisher, - ISubscriber subscriber, + ISubscriber subscriber, IDisposer disposer, IContentTemplate template) : base(provider, factory, mediator, publisher, subscriber, disposer) { @@ -30,4 +30,4 @@ public partial class WalletNavigationCollectionViewModel : return Task.CompletedTask; } -} +} \ No newline at end of file diff --git a/Wallet/WalletProfileImageInitializer.cs b/Wallet/WalletProfileImageInitializer.cs index d41aabf..91d676a 100644 --- a/Wallet/WalletProfileImageInitializer.cs +++ b/Wallet/WalletProfileImageInitializer.cs @@ -3,7 +3,7 @@ using Toolkit.Foundation; namespace Wallet; -public class WalletProfileImageInitializer(IHostEnvironment environment, +public class WalletProfileImageInitializer(IHostEnvironment environment, IImageReader reader, IDecoratorService> profileImageDecorator) : IInitialization @@ -19,4 +19,4 @@ public class WalletProfileImageInitializer(IHostEnvironment environment, profileImageDecorator.Set(new ProfileImage(imageDescriptor)); } } -} +} \ No newline at end of file