Codemaid
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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<IConfigurationDescriptor<ItemConfiguration>>().OrderBy(x => x.Name) ??
|
||||
Enumerable.Empty<IConfigurationDescriptor<ItemConfiguration>>();
|
||||
|
||||
return new ItemConfigurationCollection(items.ToDictionary(x => x.Name,
|
||||
return new ItemConfigurationCollection(items.ToDictionary(x => x.Name,
|
||||
x => (Func<ItemConfiguration>)(() => x.Value)));
|
||||
});
|
||||
|
||||
services.TryAddSingleton<IDecoratorService<ProfileImage<IImageDescriptor>>,
|
||||
services.TryAddSingleton<IDecoratorService<ProfileImage<IImageDescriptor>>,
|
||||
DecoratorService<ProfileImage<IImageDescriptor>>>();
|
||||
|
||||
services.TryAddSingleton<IDecoratorService<SecurityKey>, DecoratorService<SecurityKey>>();
|
||||
@@ -115,7 +114,7 @@ public partial class App : Application
|
||||
|
||||
services.AddHandler<ItemHandler>();
|
||||
services.AddHandler<ItemImageHandler>();
|
||||
|
||||
|
||||
services.AddHandler<CreateItemHandler>();
|
||||
services.AddHandler<DeleteItemHandler>();
|
||||
services.AddHandler<UpdateItemHander>();
|
||||
@@ -160,7 +159,7 @@ public partial class App : Application
|
||||
|
||||
services.AddTemplate<ItemNavigationViewModel, ItemNavigationView>();
|
||||
services.AddHandler<ItemNavigationViewModelActivatedHandler>();
|
||||
|
||||
|
||||
services.AddTemplate<EmptyItemCollectionViewModel, EmptyItemCollectionView>("EmptyItemCollection");
|
||||
|
||||
services.AddScoped<IDecoratorService<ItemHeaderConfiguration>, DecoratorService<ItemHeaderConfiguration>>();
|
||||
@@ -202,7 +201,7 @@ public partial class App : Application
|
||||
services.AddHandler<ConfirmUpdateItemHandler>(nameof(ItemState.Write));
|
||||
services.AddHandler<ConfirmCreateItemHandler>(nameof(ItemState.New));
|
||||
services.AddHandler<ConfirmDeleteItemHandler>();
|
||||
|
||||
|
||||
services.AddHandler<HyperlinkHandler>();
|
||||
|
||||
services.AddHandler<ItemChangedHandler>(ServiceLifetime.Singleton);
|
||||
|
||||
@@ -16,6 +16,6 @@ public class ApplicationSplashScreen :
|
||||
|
||||
public int MinimumShowTime => 2000;
|
||||
|
||||
public Task RunTasks(CancellationToken cancellationToken) =>
|
||||
public Task RunTasks(CancellationToken cancellationToken) =>
|
||||
Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,6 @@ namespace Wallet.Avalonia;
|
||||
public partial class ArchiveNavigationView :
|
||||
NavigationViewItem
|
||||
{
|
||||
public ArchiveNavigationView() =>
|
||||
public ArchiveNavigationView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -6,4 +6,4 @@ public partial class BackActionView : UserControl
|
||||
{
|
||||
public BackActionView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
@@ -7,4 +7,4 @@ public partial class CategoryNavigationView :
|
||||
{
|
||||
public CategoryNavigationView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class CommentEntryCollectionView :
|
||||
public partial class CommentEntryCollectionView :
|
||||
SettingsExpander
|
||||
{
|
||||
public CommentEntryCollectionView() =>
|
||||
|
||||
@@ -2,10 +2,10 @@ using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia
|
||||
{
|
||||
public partial class CommentEntryView :
|
||||
public partial class CommentEntryView :
|
||||
SettingsExpanderItem
|
||||
{
|
||||
public CommentEntryView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,6 @@ namespace Wallet.Avalonia;
|
||||
public partial class CreateItemNavigationView :
|
||||
NavigationViewItem
|
||||
{
|
||||
public CreateItemNavigationView() =>
|
||||
public CreateItemNavigationView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -4,6 +4,6 @@ namespace Wallet.Avalonia;
|
||||
|
||||
public partial class CreateWalletNavigationView : SettingsExpander
|
||||
{
|
||||
public CreateWalletNavigationView() =>
|
||||
public CreateWalletNavigationView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,9 @@ using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class EmptyItemCollectionView :
|
||||
public partial class EmptyItemCollectionView :
|
||||
UserControl
|
||||
{
|
||||
public EmptyItemCollectionView() =>
|
||||
public EmptyItemCollectionView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@ using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class FavouritesNavigationView :
|
||||
public partial class FavouritesNavigationView :
|
||||
NavigationViewItem
|
||||
{
|
||||
public FavouritesNavigationView() => InitializeComponent();
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -2,9 +2,9 @@ using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class ItemCategoryNavigationCollectionView :
|
||||
public partial class ItemCategoryNavigationCollectionView :
|
||||
UserControl
|
||||
{
|
||||
public ItemCategoryNavigationCollectionView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -6,4 +6,4 @@ public partial class ItemCategoryNavigationView : ListBoxItem
|
||||
{
|
||||
public ItemCategoryNavigationView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,6 @@ namespace Wallet.Avalonia;
|
||||
|
||||
public partial class ItemContentView : UserControl
|
||||
{
|
||||
public ItemContentView() =>
|
||||
public ItemContentView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -9,4 +9,4 @@ namespace Wallet.Avalonia
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,4 +6,4 @@ public partial class ItemNavigationCollectionView :
|
||||
UserControl
|
||||
{
|
||||
public ItemNavigationCollectionView() => InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -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 =>
|
||||
|
||||
@@ -5,6 +5,6 @@ namespace Wallet.Avalonia;
|
||||
public partial class ItemSectionView :
|
||||
UserControl
|
||||
{
|
||||
public ItemSectionView() =>
|
||||
public ItemSectionView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
MenuItemsSource="{Binding}"
|
||||
SelectedItem="{Binding SelectedItem}">
|
||||
<Interaction.Behaviors>
|
||||
<DataTriggerBehavior Binding="{ReflectionBinding SelectedItem.IsOpened, Mode=TwoWay}" Value="True">
|
||||
<DataTriggerBehavior Binding="{ReflectionBinding SelectedItem.IsOpened}" Value="True">
|
||||
<InvokeNavigationViewItemAction SelectedIndex="1" />
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
|
||||
@@ -5,7 +5,7 @@ namespace Wallet.Avalonia
|
||||
public partial class MaskedTextEntryView :
|
||||
SettingsExpander
|
||||
{
|
||||
public MaskedTextEntryView() =>
|
||||
public MaskedTextEntryView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,6 @@ namespace Wallet.Avalonia;
|
||||
|
||||
public partial class OpenWalletView : UserControl
|
||||
{
|
||||
public OpenWalletView() =>
|
||||
public OpenWalletView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -2,9 +2,9 @@ using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class PasswordEntryView :
|
||||
public partial class PasswordEntryView :
|
||||
SettingsExpander
|
||||
{
|
||||
public PasswordEntryView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -4,6 +4,6 @@ namespace Wallet.Avalonia;
|
||||
|
||||
public partial class SearchWalletActionView : UserControl
|
||||
{
|
||||
public SearchWalletActionView() =>
|
||||
public SearchWalletActionView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -9,4 +9,4 @@ namespace Wallet.Avalonia
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -2,8 +2,8 @@ using Avalonia.Controls;
|
||||
|
||||
namespace Wallet.Avalonia;
|
||||
|
||||
public partial class WalletNavigationCollectionView :
|
||||
public partial class WalletNavigationCollectionView :
|
||||
UserControl
|
||||
{
|
||||
public WalletNavigationCollectionView() => InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -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}">
|
||||
<OverflowItem.Resources>
|
||||
|
||||
@@ -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 =>
|
||||
|
||||
@@ -23,5 +23,5 @@ public record ItemEntity
|
||||
|
||||
public ICollection<TagEntity> Tags { get; set; } = new List<TagEntity>();
|
||||
|
||||
public ICollection<BlobEntity> Blobs { get; set; } = new List<BlobEntity>();
|
||||
public ICollection<BlobEntity> Blobs { get; set; } = new List<BlobEntity>();
|
||||
}
|
||||
@@ -24,11 +24,10 @@ public class ArchiveItemHandler(IDecoratorService<Item<(Guid, string)>> decorato
|
||||
cache.Remove(item);
|
||||
publisher.Publish(Changed.As<Item>());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,4 +14,4 @@ public partial class AttachmentEntryCollectionViewModel(IServiceProvider provide
|
||||
ICollection<Comment> value,
|
||||
bool isConcealed,
|
||||
bool isRevealed,
|
||||
double width) : ItemEntryCollectionViewModel<AttachmentEntryViewModel, ICollection<Comment>>(provider, factory, mediator, publisher, subscriber, disposer, state, configuration, key, value, isConcealed, isRevealed, width);
|
||||
double width) : ItemEntryCollectionViewModel<AttachmentEntryViewModel, ICollection<Comment>>(provider, factory, mediator, publisher, subscriber, disposer, state, configuration, key, value, isConcealed, isRevealed, width);
|
||||
@@ -25,4 +25,4 @@ public class CategoriesNavigationViewModelActivationHandler(IMediator mediator,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,10 +5,10 @@ namespace Wallet;
|
||||
public class CloseWalletHandler(IDecoratorService<WalletConnection> walletConnectionDecorator) :
|
||||
IHandler<CloseEventArgs<Wallet>, bool>
|
||||
{
|
||||
public Task<bool> Handle(CloseEventArgs<Wallet> args,
|
||||
public Task<bool> Handle(CloseEventArgs<Wallet> args,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
walletConnectionDecorator.Set(null);
|
||||
return Task.FromResult(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
+1
-3
@@ -1,6 +1,4 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Wallet;
|
||||
namespace Wallet;
|
||||
|
||||
public record Closed
|
||||
{
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@ public record Comment
|
||||
public DateTimeOffset DateTime { get; set; }
|
||||
|
||||
public string? Text { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -39,8 +39,10 @@ public partial class CommentEntryCollectionViewModel(IServiceProvider provider,
|
||||
}
|
||||
else
|
||||
{
|
||||
RemoveAt(Count - 1);
|
||||
if (Count > 0)
|
||||
{
|
||||
RemoveAt(Count - 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -14,7 +14,7 @@ public class CommentEntryCollectionViewModelHandler(IServiceFactory serviceFacto
|
||||
List<Comment> values = configuration.Value is not null ? new List<Comment>(configuration.Value) : [];
|
||||
double? width = configuration.Width;
|
||||
|
||||
if (serviceFactory.Create<CommentEntryCollectionViewModel>(args => args.Initialize(),
|
||||
if (serviceFactory.Create<CommentEntryCollectionViewModel>(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<IItemEntryViewModel?>(default);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -20,7 +20,7 @@ public class ConfirmCreateItemHandler(IMediator mediator,
|
||||
Guid id = Guid.NewGuid();
|
||||
|
||||
await mediator.Handle<CreateEventArgs<(Guid, string, string, IImageDescriptor?,
|
||||
ItemConfiguration)>, 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,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -25,9 +25,9 @@ public class ConfirmUpdateItemHandler(IDecoratorService<Item<(Guid, string)>> it
|
||||
|
||||
(Guid id, _) = item.Value;
|
||||
|
||||
await mediator.Handle<UpdateEventArgs<Item<(Guid, string, string, IImageDescriptor?,
|
||||
await mediator.Handle<UpdateEventArgs<Item<(Guid, string, string, IImageDescriptor?,
|
||||
ItemConfiguration)>>, bool>(new UpdateEventArgs<Item<(Guid, string, string, IImageDescriptor?,
|
||||
ItemConfiguration)>>(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));
|
||||
|
||||
@@ -4,10 +4,10 @@ using Wallet.Data;
|
||||
|
||||
namespace Wallet;
|
||||
|
||||
public class CountCategoriesHandler(IDbContextFactory<WalletContext> dbContextFactory) :
|
||||
public class CountCategoriesHandler(IDbContextFactory<WalletContext> dbContextFactory) :
|
||||
IHandler<CountEventArgs<Item>, IReadOnlyCollection<(string, int)>>
|
||||
{
|
||||
public async Task<IReadOnlyCollection<(string, int)>> Handle(CountEventArgs<Item> args,
|
||||
public async Task<IReadOnlyCollection<(string, int)>> Handle(CountEventArgs<Item> args,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
using WalletContext context = await dbContextFactory.CreateDbContextAsync(cancellationToken);
|
||||
@@ -49,4 +49,4 @@ public class CountCategoriesHandler(IDbContextFactory<WalletContext> dbContextFa
|
||||
|
||||
return combinedCounts;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
|
||||
namespace Wallet;
|
||||
|
||||
public class CreateProfileImageHandler(IFileProvider fileProvider,
|
||||
IImageReader imageReader) :
|
||||
public class CreateProfileImageHandler(IFileProvider fileProvider,
|
||||
IImageReader imageReader) :
|
||||
IHandler<CreateEventArgs<ProfileImage>, IImageDescriptor?>
|
||||
{
|
||||
public async Task<IImageDescriptor?> Handle(CreateEventArgs<ProfileImage> args,
|
||||
@@ -21,4 +21,4 @@ public class CreateProfileImageHandler(IFileProvider fileProvider,
|
||||
|
||||
return default;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,4 +14,4 @@ public partial class DateEntryViewModel(IServiceProvider provider,
|
||||
DateTimeOffset? value,
|
||||
bool isConcealed,
|
||||
bool isRevealed,
|
||||
double width) : ItemEntryViewModel<DateTimeOffset?>(provider, factory, mediator, publisher, subscriber, disposer, state, configuration, key, value, isConcealed, isRevealed, width);
|
||||
double width) : ItemEntryViewModel<DateTimeOffset?>(provider, factory, mediator, publisher, subscriber, disposer, state, configuration, key, value, isConcealed, isRevealed, width);
|
||||
@@ -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<DateEntryViewModel>(args => args.Initialize(),
|
||||
if (serviceFactory.Create<DateEntryViewModel>(args => args.Initialize(),
|
||||
[.. args.Parameters, configuration, label, value, false, false, width])
|
||||
is DateEntryViewModel viewModel)
|
||||
{
|
||||
|
||||
+2
-2
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Wallet;
|
||||
|
||||
public partial class DiversityBonusRule :
|
||||
public partial class DiversityBonusRule :
|
||||
IPasswordRule
|
||||
{
|
||||
public int CalculateScore(string password)
|
||||
|
||||
@@ -7,4 +7,4 @@ public record DropdownEntryCollectionConfiguration :
|
||||
{
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
public IList<string> Values { get; set; } = new List<string>();
|
||||
}
|
||||
}
|
||||
@@ -2,18 +2,18 @@
|
||||
|
||||
namespace Wallet;
|
||||
|
||||
public partial class DropdownEntryCollectionViewModel :
|
||||
public partial class DropdownEntryCollectionViewModel :
|
||||
ItemEntryCollectionViewModel<DropdownEntryViewModel, object>
|
||||
{
|
||||
public DropdownEntryCollectionViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer,
|
||||
IDisposer disposer,
|
||||
IEnumerable<DropdownEntryViewModel> items,
|
||||
ItemState state,
|
||||
DropdownEntryCollectionConfiguration configuration,
|
||||
DropdownEntryCollectionConfiguration configuration,
|
||||
string key,
|
||||
object value,
|
||||
bool isConcealed,
|
||||
|
||||
@@ -34,4 +34,4 @@ public class DropdownEntryCollectionViewModelHandler(IServiceFactory serviceFact
|
||||
|
||||
return Task.FromResult<IItemEntryViewModel?>(default);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,5 +7,5 @@ public partial class DropdownEntryViewModel(IServiceProvider provider,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer,
|
||||
string? value = default) : Observable<string>(provider, factory, mediator, publisher, subscriber, disposer, value);
|
||||
IDisposer disposer,
|
||||
string? value = default) : Observable<string>(provider, factory, mediator, publisher, subscriber, disposer, value);
|
||||
@@ -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}";
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,7 @@ public abstract partial class FilterNavigationViewModel(IServiceProvider provide
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer,
|
||||
int key,
|
||||
string value) :
|
||||
string value) :
|
||||
ObservableCollection<INavigationViewModel, int, string>(provider, factory, mediator, publisher, subscriber, disposer, key, value),
|
||||
INavigationViewModel,
|
||||
INotificationHandler<ActivatedEventArgs<Wallet>>,
|
||||
@@ -74,7 +74,7 @@ public abstract partial class FilterNavigationViewModel<TWalletNavigation>(IServ
|
||||
public Task Handle(DeactivatedEventArgs<Wallet> args)
|
||||
{
|
||||
IsSelected = false;
|
||||
IsActivated = false;
|
||||
IsActivated = false;
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
namespace Wallet;
|
||||
|
||||
public record Hyperlink(string? Value);
|
||||
public record Hyperlink(string? Value);
|
||||
@@ -14,7 +14,7 @@ public class HyperlinkEntryViewModelHandler(IServiceFactory serviceFactory) :
|
||||
string? value = $"{configuration.Value}" ?? "";
|
||||
double? width = configuration.Width;
|
||||
|
||||
if (serviceFactory.Create<HyperlinkEntryViewModel>(args => args.Initialize(),
|
||||
if (serviceFactory.Create<HyperlinkEntryViewModel>(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<IItemEntryViewModel?>(default);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@ using Toolkit.Foundation;
|
||||
|
||||
namespace Wallet;
|
||||
|
||||
public class HyperlinkHandler :
|
||||
public class HyperlinkHandler :
|
||||
INotificationHandler<CreateEventArgs<Hyperlink>>
|
||||
{
|
||||
public Task Handle(CreateEventArgs<Hyperlink> args)
|
||||
@@ -16,10 +16,9 @@ public class HyperlinkHandler :
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
namespace Wallet;
|
||||
|
||||
public interface ICommentEntryViewModel : IItemEntryViewModel;
|
||||
public interface ICommentEntryViewModel : IItemEntryViewModel;
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Wallet;
|
||||
|
||||
public interface IItemConfigurationCollection :
|
||||
IReadOnlyDictionary<string, Func<ItemConfiguration>>;
|
||||
IReadOnlyDictionary<string, Func<ItemConfiguration>>;
|
||||
@@ -34,4 +34,4 @@ public interface IItemEntryConfiguration<TValue> :
|
||||
[JsonDerivedType(typeof(DateEntryConfiguration), typeDiscriminator: "Date")]
|
||||
[JsonDerivedType(typeof(HyperlinkEntryConfiguration), typeDiscriminator: "Hyperlink")]
|
||||
[JsonDerivedType(typeof(PinEntryConfiguration), typeDiscriminator: "Pin")]
|
||||
public interface IItemEntryConfiguration;
|
||||
public interface IItemEntryConfiguration;
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Wallet;
|
||||
|
||||
public interface IItemViewModel :
|
||||
public interface IItemViewModel :
|
||||
IDisposable;
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Wallet;
|
||||
|
||||
public interface INavigationViewModel :
|
||||
public interface INavigationViewModel :
|
||||
IDisposable;
|
||||
@@ -3,4 +3,4 @@
|
||||
public interface IPasswordRule
|
||||
{
|
||||
int CalculateScore(string password);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,4 @@
|
||||
|
||||
namespace Wallet
|
||||
namespace Wallet
|
||||
{
|
||||
public interface IWalletConnectionFactory
|
||||
{
|
||||
|
||||
@@ -4,7 +4,7 @@ namespace Wallet;
|
||||
|
||||
public interface IWalletFactory
|
||||
{
|
||||
Task<bool> Create(string name,
|
||||
Task<bool> Create(string name,
|
||||
string password,
|
||||
IImageDescriptor? imageDescriptor);
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Wallet;
|
||||
|
||||
public record ImageEntryConfiguration :
|
||||
ItemEntryConfiguration<string>;
|
||||
ItemEntryConfiguration<string>;
|
||||
@@ -25,4 +25,4 @@ public partial class ItemCategoryNavigationCollectionViewModel(IServiceProvider
|
||||
|
||||
return base.OnActivated();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -24,4 +24,4 @@ public partial class ItemCategoryNavigationViewModel(IServiceProvider provider,
|
||||
|
||||
[RelayCommand]
|
||||
private void Invoke() => Publisher.Publish(Notify.As(new ItemCategory<string>(Name)));
|
||||
}
|
||||
}
|
||||
@@ -12,7 +12,7 @@ public class ItemCategoryViewModelActivatedHandler(IItemConfigurationCollection
|
||||
bool selected = true;
|
||||
foreach (KeyValuePair<string, Func<ItemConfiguration>> configuration in configurations)
|
||||
{
|
||||
if (serviceFactory.Create<ItemCategoryNavigationViewModel>(args => args.Initialize(),
|
||||
if (serviceFactory.Create<ItemCategoryNavigationViewModel>(args => args.Initialize(),
|
||||
configuration.Key, selected)
|
||||
is ItemCategoryNavigationViewModel viewModel)
|
||||
{
|
||||
@@ -23,4 +23,4 @@ public class ItemCategoryViewModelActivatedHandler(IItemConfigurationCollection
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,15 +3,15 @@
|
||||
namespace Wallet;
|
||||
|
||||
public class ItemChangedHandler(IMediator mediator,
|
||||
IPublisher publisher) :
|
||||
IPublisher publisher) :
|
||||
INotificationHandler<ChangedEventArgs<Item>>
|
||||
{
|
||||
public async Task Handle(ChangedEventArgs<Item> args)
|
||||
{
|
||||
IReadOnlyCollection<(string, int)>? counts = await mediator.Handle<CountEventArgs<Item>,
|
||||
IReadOnlyCollection<(string, int)>? counts = await mediator.Handle<CountEventArgs<Item>,
|
||||
IReadOnlyCollection<(string, int)>>(Count.As<Item>());
|
||||
|
||||
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,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3,4 +3,4 @@
|
||||
namespace Wallet;
|
||||
|
||||
public class ItemCommandHeaderCollection(IList<IDisposable> list) :
|
||||
ReadOnlyCollection<IDisposable>(list);
|
||||
ReadOnlyCollection<IDisposable>(list);
|
||||
@@ -26,7 +26,7 @@ public partial class ItemCommandHeaderViewModel(IServiceProvider provider,
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,7 @@ public record ItemConfiguration
|
||||
Label = "Name on account"
|
||||
},
|
||||
new DropdownEntryCollectionConfiguration
|
||||
{
|
||||
{
|
||||
Label = "Type",
|
||||
Values = [
|
||||
"Checking Account",
|
||||
|
||||
@@ -2,6 +2,6 @@
|
||||
|
||||
namespace Wallet;
|
||||
|
||||
public class ItemConfigurationCollection(IDictionary<string, Func<ItemConfiguration>> dictionary) :
|
||||
public class ItemConfigurationCollection(IDictionary<string, Func<ItemConfiguration>> dictionary) :
|
||||
ReadOnlyDictionary<string, Func<ItemConfiguration>>(dictionary),
|
||||
IItemConfigurationCollection;
|
||||
IItemConfigurationCollection;
|
||||
@@ -46,4 +46,4 @@ public class ItemContentFromCategoryViewModelActivationHandler(IItemConfiguratio
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,7 +18,7 @@ public partial class ItemContentViewModel(IServiceProvider provider,
|
||||
|
||||
public Task Handle(NotifyEventArgs<ItemCategory<string>> args)
|
||||
{
|
||||
if (args.Sender is ItemCategory<string> category
|
||||
if (args.Sender is ItemCategory<string> category
|
||||
&& category.Value is string value)
|
||||
{
|
||||
Activate(() => new ActivationBuilder(new ActivationEventArgs<IItemEntryViewModel,
|
||||
@@ -27,4 +27,4 @@ public partial class ItemContentViewModel(IServiceProvider provider,
|
||||
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ public class ItemContentViewModelActivationHandler(IDecoratorService<Item<(Guid,
|
||||
{
|
||||
if (item.Value is (Guid Id, _))
|
||||
{
|
||||
(_, _, _, _, ItemConfiguration? configuration) = await mediator.Handle<RequestEventArgs<Item<Guid>>,
|
||||
(_, _, _, _, ItemConfiguration? configuration) = await mediator.Handle<RequestEventArgs<Item<Guid>>,
|
||||
(Guid, string, string?, string, ItemConfiguration?)>(Request.As(new Item<Guid>(Id)));
|
||||
|
||||
if (configuration is not null)
|
||||
@@ -49,4 +49,4 @@ public class ItemContentViewModelActivationHandler(IDecoratorService<Item<(Guid,
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -28,7 +28,7 @@ public class ItemCreatedHandler(IServiceProvider serviceProvider,
|
||||
int index = cache.IndexOf(cachedItem);
|
||||
decoratorService.Set(cachedItem);
|
||||
|
||||
publisher.Publish(Insert.As(index, viewModel),
|
||||
publisher.Publish(Insert.As(index, viewModel),
|
||||
nameof(ItemNavigationCollectionViewModel));
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
namespace Wallet;
|
||||
|
||||
public record ItemEntry;
|
||||
public record ItemEntry;
|
||||
@@ -4,7 +4,7 @@ using Toolkit.Foundation;
|
||||
|
||||
namespace Wallet;
|
||||
|
||||
public partial class ItemEntryCollectionViewModel<TItem, TValue> :
|
||||
public partial class ItemEntryCollectionViewModel<TItem, TValue> :
|
||||
ObservableCollection<TItem, string, TValue>,
|
||||
IItemEntryViewModel,
|
||||
IHandler<ValidateEventArgs<ItemEntry>, bool>,
|
||||
@@ -97,7 +97,6 @@ public partial class ItemEntryCollectionViewModel<TItem, TValue> :
|
||||
|
||||
protected virtual void OnStateChanged()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public Task Handle(ConfirmEventArgs<Item> args)
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Wallet;
|
||||
[JsonDerivedType(typeof(DateEntryConfiguration), typeDiscriminator: "Date")]
|
||||
[JsonDerivedType(typeof(HyperlinkEntryConfiguration), typeDiscriminator: "Hyperlink")]
|
||||
[JsonDerivedType(typeof(PinEntryConfiguration), typeDiscriminator: "Pin")]
|
||||
public record ItemEntryConfiguration<TValue> :
|
||||
public record ItemEntryConfiguration<TValue> :
|
||||
IItemEntryConfiguration<TValue>
|
||||
{
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)]
|
||||
|
||||
@@ -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<WalletContext> dbContextFactory) :
|
||||
public class ItemHandler(IDbContextFactory<WalletContext> dbContextFactory) :
|
||||
IHandler<RequestEventArgs<Item<Guid>>, (Guid, string, string?, string, ItemConfiguration?)>
|
||||
{
|
||||
public async Task<(Guid, string, string?, string, ItemConfiguration?)> Handle(RequestEventArgs<Item<Guid>> args,
|
||||
public async Task<(Guid, string, string?, string, ItemConfiguration?)> Handle(RequestEventArgs<Item<Guid>> args,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
if (args.Sender is Item<Guid> item)
|
||||
@@ -43,7 +43,6 @@ public class ItemHandler(IDbContextFactory<WalletContext> dbContextFactory) :
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,4 +52,4 @@ public class ItemHandler(IDbContextFactory<WalletContext> dbContextFactory) :
|
||||
|
||||
return default;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
public record ItemHeader<TValue>(TValue Value);
|
||||
|
||||
public record ItemHeader;
|
||||
public record ItemHeader;
|
||||
@@ -4,7 +4,7 @@ using Toolkit.Foundation;
|
||||
|
||||
namespace Wallet;
|
||||
|
||||
public partial class ItemHeaderViewModel :
|
||||
public partial class ItemHeaderViewModel :
|
||||
Observable<string>,
|
||||
IHandler<ValidateEventArgs<ItemEntry>, bool>,
|
||||
INotificationHandler<UpdateEventArgs<ItemEntry>>,
|
||||
@@ -110,7 +110,7 @@ public partial class ItemHeaderViewModel :
|
||||
private async Task Import() => ImageDescriptor = await Mediator.Handle<CreateEventArgs<ProfileImage>,
|
||||
IImageDescriptor>(Create.As<ProfileImage>());
|
||||
|
||||
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)
|
||||
|
||||
@@ -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<WalletContext> 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<WalletContext> dbContextFactory,
|
||||
|
||||
return default;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -71,4 +71,4 @@ public partial class ItemNavigationCollectionViewModel :
|
||||
|
||||
protected override ActivationBuilder ActivationBuilder() =>
|
||||
new(Activation.As<ItemNavigationViewModel, ItemNavigationCollectionConfiguration>(configuration));
|
||||
}
|
||||
}
|
||||
@@ -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<QueryEventArgs<Wallet<(string?, string?)>>,
|
||||
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<Item<(Guid, string)>> decoratorService = serviceScope.ServiceProvider
|
||||
.GetRequiredService<IDecoratorService<Item<(Guid, string)>>>();
|
||||
|
||||
if (serviceFactory.Create<ItemNavigationViewModel>(args => args.Initialize(), configuration.Filter,
|
||||
Id, Name, "Description", Category, selected, Favourite, Archived)
|
||||
if (serviceFactory.Create<ItemNavigationViewModel>(args => args.Initialize(), configuration.Filter,
|
||||
Id, Name, "Description", Category, selected, Favourite, Archived)
|
||||
is ItemNavigationViewModel viewModel)
|
||||
{
|
||||
Item<(Guid, string)> item = new((Id, Name));
|
||||
|
||||
@@ -17,4 +17,4 @@ public class ItemNavigationViewModelActivatedHandler(IMediator mediator,
|
||||
publisher.Publish(Notify.As(new Item<IImageDescriptor>(imageDescriptor)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,4 +16,4 @@ public partial class ItemSectionViewModel(IServiceProvider provider,
|
||||
public string Id => id;
|
||||
|
||||
public IContentTemplate Template { get; set; } = template;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -5,4 +5,4 @@ public enum ItemState
|
||||
New,
|
||||
Read,
|
||||
Write
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Toolkit.Foundation;
|
||||
using Wallet.Data;
|
||||
|
||||
namespace Wallet;
|
||||
|
||||
|
||||
@@ -3,6 +3,6 @@
|
||||
public class LengthRule :
|
||||
IPasswordRule
|
||||
{
|
||||
public int CalculateScore(string password) =>
|
||||
public int CalculateScore(string password) =>
|
||||
password.Length >= 8 ? 5 : 0;
|
||||
}
|
||||
}
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -32,7 +32,6 @@ public partial class MainViewModel :
|
||||
Reset(args =>
|
||||
{
|
||||
args.SetSource(wallet, () => wallet);
|
||||
SelectedItem = wallet;
|
||||
}, false);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -7,4 +7,4 @@ public record MaskedTextEntryConfiguration :
|
||||
{
|
||||
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
|
||||
public string? Pattern { get; set; }
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user