Added MultilineTextEntryView
This commit is contained in:
@@ -154,10 +154,11 @@ public partial class App : Application
|
||||
|
||||
services.AddTemplate<ItemSectionViewModel, ItemSectionView>();
|
||||
|
||||
services.AddTemplate<ItemTextEntryViewModel, ItemTextEntryView>();
|
||||
services.AddTemplate<ItemPasswordEntryViewModel, ItemPasswordEntryView>();
|
||||
services.AddTemplate<ItemMaskedTextEntryViewModel, ItemMaskedTextEntryView>();
|
||||
services.AddTemplate<ItemDropdownEntryViewModel, ItemDropdownEntryView>();
|
||||
services.AddTemplate<TextEntryViewModel, TextEntryView>();
|
||||
services.AddTemplate<MultilineTextEntryViewModel, MultilineTextEntryView>();
|
||||
services.AddTemplate<PasswordEntryViewModel, PasswordEntryView>();
|
||||
services.AddTemplate<MaskedTextEntryViewModel, MaskedTextEntryView>();
|
||||
services.AddTemplate<DropdownEntryViewModel, DropdownEntryView>();
|
||||
|
||||
services.AddTemplate<ItemCommandHeaderViewModel, ItemCommandHeaderView>("ItemCommandHeader");
|
||||
|
||||
@@ -177,10 +178,11 @@ public partial class App : Application
|
||||
services.AddHandler<FavouriteItemHandler>();
|
||||
services.AddHandler<UnfavouriteItemHandler>();
|
||||
|
||||
services.AddHandler<ItemTextEntryViewModelHandler>(nameof(TextEntryConfiguration));
|
||||
services.AddHandler<ItemPasswordEntryViewModelHandler>(nameof(PasswordEntryConfiguration));
|
||||
services.AddHandler<ItemMaskedTextEntryViewModelHandler>(nameof(MaskedTextEntryConfiguration));
|
||||
services.AddHandler<ItemDropdownEntryViewModelHandler>(nameof(DropdownEntryConfiguration));
|
||||
services.AddHandler<TextEntryViewModelHandler>(nameof(TextEntryConfiguration));
|
||||
services.AddHandler<MultilineTextEntryViewModelHandler>(nameof(MultilineTextEntryConfiguration));
|
||||
services.AddHandler<PasswordEntryViewModelHandler>(nameof(PasswordEntryConfiguration));
|
||||
services.AddHandler<MaskedTextEntryViewModelHandler>(nameof(MaskedTextEntryConfiguration));
|
||||
services.AddHandler<DropdownEntryViewModelHandler>(nameof(DropdownEntryConfiguration));
|
||||
|
||||
services.AddHandler<ItemCreatedHandler>(ServiceLifetime.Singleton);
|
||||
services.AddHandler<ItemModifiedHandler>(ServiceLifetime.Singleton);
|
||||
|
||||
@@ -67,12 +67,24 @@
|
||||
<Compile Update="DismissItemActionView.axaml.cs">
|
||||
<DependentUpon>DismissItemActionView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="DropdownEntryView.axaml.cs">
|
||||
<DependentUpon>DropdownEntryView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="ItemHeaderView.axaml.cs">
|
||||
<DependentUpon>ItemHeaderView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="ItemContentView.axaml.cs">
|
||||
<DependentUpon>ItemContentView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="TextEntryView.axaml.cs">
|
||||
<DependentUpon>TextEntryView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="PasswordEntryView.axaml.cs">
|
||||
<DependentUpon>PasswordEntryView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="MaskedTextEntryView.axaml.cs">
|
||||
<DependentUpon>MaskedTextEntryView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Update="OpenLockerView.axaml.cs">
|
||||
<DependentUpon>OpenLockerView.axaml</DependentUpon>
|
||||
</Compile>
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
<SettingsExpander
|
||||
x:Class="Bitvault.Avalonia.ItemDropdownEntryView"
|
||||
x:Class="Bitvault.Avalonia.DropdownEntryView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:ItemDropdownEntryViewModel"
|
||||
x:DataType="vm:DropdownEntryViewModel"
|
||||
Header="{Binding Key}">
|
||||
<SettingsExpander.Footer>
|
||||
<Grid>
|
||||
+2
-2
@@ -2,9 +2,9 @@ using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class ItemTextEntryView :
|
||||
public partial class DropdownEntryView :
|
||||
SettingsExpander
|
||||
{
|
||||
public ItemTextEntryView() =>
|
||||
public DropdownEntryView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
<SettingsExpander
|
||||
x:Class="Bitvault.Avalonia.ItemMaskedTextEntryView"
|
||||
x:Class="Bitvault.Avalonia.MaskedTextEntryView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:ItemMaskedTextEntryViewModel"
|
||||
x:DataType="vm:MaskedTextEntryViewModel"
|
||||
Header="{Binding Key}">
|
||||
<SettingsExpander.Footer>
|
||||
<MaskedTextBox Mask="{Binding Pattern}" Text="{Binding Value}">
|
||||
+2
-2
@@ -2,10 +2,10 @@ using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Bitvault.Avalonia
|
||||
{
|
||||
public partial class ItemMaskedTextEntryView :
|
||||
public partial class MaskedTextEntryView :
|
||||
SettingsExpander
|
||||
{
|
||||
public ItemMaskedTextEntryView() =>
|
||||
public MaskedTextEntryView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
<SettingsExpander
|
||||
x:Class="Bitvault.Avalonia.MultilineTextEntryView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:MultilineTextEntryViewModel"
|
||||
Header="{Binding Key}">
|
||||
<TextBox Text="{Binding Value}" TextWrapping="Wrap">
|
||||
<TextBox.Styles>
|
||||
<Style Selector="TextBox.Write">
|
||||
<Setter Property="Height" Value="216" />
|
||||
<Setter Property="AcceptsTab" Value="True" />
|
||||
<Setter Property="AcceptsReturn" Value="True" />
|
||||
</Style>
|
||||
<Style Selector="TextBox.Read">
|
||||
<Setter Property="Height" Value="216" />
|
||||
<Setter Property="IsReadOnly" Value="True" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style Selector="^:pointerover">
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style Selector="^ /template/ Border#PART_BorderElement">
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
</Style>
|
||||
</Style>
|
||||
<Style Selector="^:focus">
|
||||
<Setter Property="Foreground">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0.7" Color="{DynamicResource TextFillColorPrimary}" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style Selector="^ /template/ Border#PART_BorderElement">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
</Style>
|
||||
</Style>
|
||||
</Style>
|
||||
</TextBox.Styles>
|
||||
<Interaction.Behaviors>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Read}">
|
||||
<AddClassAction ClassName="Read" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Write" />
|
||||
</DataTriggerBehavior>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.New}">
|
||||
<AddClassAction ClassName="Write" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Read" />
|
||||
</DataTriggerBehavior>
|
||||
<DataTriggerBehavior Binding="{Binding State}" Value="{x:Static vm:ItemState.Write}">
|
||||
<AddClassAction ClassName="Write" RemoveIfExists="True" />
|
||||
<RemoveClassAction ClassName="Read" />
|
||||
</DataTriggerBehavior>
|
||||
</Interaction.Behaviors>
|
||||
</TextBox>
|
||||
</SettingsExpander>
|
||||
@@ -0,0 +1,10 @@
|
||||
using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class MultilineTextEntryView :
|
||||
SettingsExpander
|
||||
{
|
||||
public MultilineTextEntryView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
<SettingsExpander
|
||||
x:Class="Bitvault.Avalonia.ItemPasswordEntryView"
|
||||
x:Class="Bitvault.Avalonia.PasswordEntryView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:ItemPasswordEntryViewModel"
|
||||
x:DataType="vm:PasswordEntryViewModel"
|
||||
Header="{Binding Key}">
|
||||
<SettingsExpander.Footer>
|
||||
<TextBox
|
||||
+2
-2
@@ -2,9 +2,9 @@ using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class ItemPasswordEntryView :
|
||||
public partial class PasswordEntryView :
|
||||
SettingsExpander
|
||||
{
|
||||
public ItemPasswordEntryView() =>
|
||||
public PasswordEntryView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
<SettingsExpander
|
||||
x:Class="Bitvault.Avalonia.ItemTextEntryView"
|
||||
x:Class="Bitvault.Avalonia.TextEntryView"
|
||||
xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:vm="using:Bitvault"
|
||||
x:DataType="vm:ItemTextEntryViewModel"
|
||||
x:DataType="vm:TextEntryViewModel"
|
||||
Header="{Binding Key}">
|
||||
<SettingsExpander.Footer>
|
||||
<TextBox Text="{Binding Value}">
|
||||
+2
-2
@@ -2,9 +2,9 @@ using Toolkit.UI.Controls.Avalonia;
|
||||
|
||||
namespace Bitvault.Avalonia;
|
||||
|
||||
public partial class ItemDropdownEntryView :
|
||||
public partial class TextEntryView :
|
||||
SettingsExpander
|
||||
{
|
||||
public ItemDropdownEntryView() =>
|
||||
public TextEntryView() =>
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -2,32 +2,32 @@
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class ItemDropdownEntryViewModel :
|
||||
ItemEntryCollectionViewModel<ItemDropdownValueViewModel>
|
||||
public partial class DropdownEntryViewModel :
|
||||
ItemEntryCollectionViewModel<DropdownValueViewModel>
|
||||
{
|
||||
public ItemDropdownEntryViewModel(IServiceProvider provider,
|
||||
public DropdownEntryViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscription subscriber,
|
||||
IDisposer disposer,
|
||||
IEnumerable<ItemDropdownValueViewModel> items,
|
||||
IEnumerable<DropdownValueViewModel> items,
|
||||
ItemState state,
|
||||
ItemEntryConfiguration configuration,
|
||||
string key,
|
||||
object value,
|
||||
ItemDropdownValueViewModel selectedItem) : base(provider, factory, mediator, publisher, subscriber, disposer, items, state, configuration, key, value)
|
||||
DropdownValueViewModel selectedItem) : base(provider, factory, mediator, publisher, subscriber, disposer, items, state, configuration, key, value)
|
||||
{
|
||||
SelectedItem = selectedItem;
|
||||
}
|
||||
|
||||
public ItemDropdownEntryViewModel(IServiceProvider provider,
|
||||
public DropdownEntryViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscription subscriber,
|
||||
IDisposer disposer,
|
||||
IEnumerable<ItemDropdownValueViewModel> items,
|
||||
IEnumerable<DropdownValueViewModel> items,
|
||||
ItemState state,
|
||||
ItemEntryConfiguration configuration,
|
||||
string key,
|
||||
+6
-6
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public class ItemDropdownEntryViewModelHandler(IServiceFactory serviceFactory) :
|
||||
public class DropdownEntryViewModelHandler(IServiceFactory serviceFactory) :
|
||||
IHandler<CreateEventArgs<DropdownEntryConfiguration>, IItemEntryViewModel?>
|
||||
{
|
||||
public Task<IItemEntryViewModel?> Handle(CreateEventArgs<DropdownEntryConfiguration> args,
|
||||
@@ -10,19 +10,19 @@ public class ItemDropdownEntryViewModelHandler(IServiceFactory serviceFactory) :
|
||||
{
|
||||
if (args.Value is DropdownEntryConfiguration configuration)
|
||||
{
|
||||
List<ItemDropdownValueViewModel> values = [];
|
||||
List<DropdownValueViewModel> values = [];
|
||||
foreach (string item in configuration.Values)
|
||||
{
|
||||
values.Add(serviceFactory.Create<ItemDropdownValueViewModel>(item));
|
||||
values.Add(serviceFactory.Create<DropdownValueViewModel>(item));
|
||||
}
|
||||
|
||||
string? label = configuration.Label;
|
||||
object? value = configuration.Value;
|
||||
|
||||
ItemDropdownValueViewModel? selected = values.FirstOrDefault(x => x.Value is not null && x.Value.Equals($"{value}"));
|
||||
DropdownValueViewModel? selected = values.FirstOrDefault(x => x.Value is not null && x.Value.Equals($"{value}"));
|
||||
|
||||
if (serviceFactory.Create<ItemDropdownEntryViewModel>([values, .. args.Parameters, configuration, label, value ?? "", selected])
|
||||
is ItemDropdownEntryViewModel viewModel)
|
||||
if (serviceFactory.Create<DropdownEntryViewModel>([values, .. args.Parameters, configuration, label, value ?? "", selected])
|
||||
is DropdownEntryViewModel viewModel)
|
||||
{
|
||||
return Task.FromResult<IItemEntryViewModel?>(viewModel);
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class ItemDropdownValueViewModel(IServiceProvider provider,
|
||||
public partial class DropdownValueViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
@@ -157,7 +157,7 @@ public record ItemConfiguration
|
||||
{
|
||||
Entries = new List<ItemEntryConfiguration>
|
||||
{
|
||||
new NumberEntryConfiguration
|
||||
new MultilineTextEntryConfiguration
|
||||
{
|
||||
Label = "Notes"
|
||||
}
|
||||
@@ -170,19 +170,24 @@ public record ItemConfiguration
|
||||
{
|
||||
Sections = new List<ItemSectionConfiguration>
|
||||
{
|
||||
new()
|
||||
new ()
|
||||
{
|
||||
Entries = new List<ItemEntryConfiguration>
|
||||
{
|
||||
new TextEntryConfiguration
|
||||
{
|
||||
Label = "Description",
|
||||
},
|
||||
new AttachmentEntryConfiguration
|
||||
{
|
||||
Label = "Attachments"
|
||||
Label = "Attachments",
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
public static ItemConfiguration DrivingLicence => new()
|
||||
{
|
||||
Sections = new List<ItemSectionConfiguration>
|
||||
|
||||
@@ -4,7 +4,6 @@ namespace Bitvault;
|
||||
|
||||
[JsonDerivedType(typeof(DropdownEntryConfiguration), typeDiscriminator: "Dropdown")]
|
||||
[JsonDerivedType(typeof(MaskedTextEntryConfiguration), typeDiscriminator: "MaskedText")]
|
||||
[JsonDerivedType(typeof(NoteEntryConfiguration), typeDiscriminator: "Note")]
|
||||
[JsonDerivedType(typeof(NumberEntryConfiguration), typeDiscriminator: "Number")]
|
||||
[JsonDerivedType(typeof(PasswordEntryConfiguration), typeDiscriminator: "Password")]
|
||||
[JsonDerivedType(typeof(TextEntryConfiguration), typeDiscriminator: "Text")]
|
||||
|
||||
@@ -3,7 +3,7 @@ using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class ItemMaskedTextEntryViewModel(IServiceProvider provider,
|
||||
public partial class MaskedTextEntryViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
+3
-3
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public class ItemMaskedTextEntryViewModelHandler(IServiceFactory serviceFactory) :
|
||||
public class MaskedTextEntryViewModelHandler(IServiceFactory serviceFactory) :
|
||||
IHandler<CreateEventArgs<MaskedTextEntryConfiguration>, IItemEntryViewModel?>
|
||||
{
|
||||
public Task<IItemEntryViewModel?> Handle(CreateEventArgs<MaskedTextEntryConfiguration> args,
|
||||
@@ -10,8 +10,8 @@ public class ItemMaskedTextEntryViewModelHandler(IServiceFactory serviceFactory)
|
||||
{
|
||||
if (args.Value is MaskedTextEntryConfiguration configuration)
|
||||
{
|
||||
if (serviceFactory.Create<ItemMaskedTextEntryViewModel>([.. args.Parameters, configuration, configuration.Pattern, configuration.Label, configuration.Value])
|
||||
is ItemMaskedTextEntryViewModel viewModel)
|
||||
if (serviceFactory.Create<MaskedTextEntryViewModel>([.. args.Parameters, configuration, configuration.Pattern, configuration.Label, configuration.Value])
|
||||
is MaskedTextEntryViewModel viewModel)
|
||||
{
|
||||
return Task.FromResult<IItemEntryViewModel?>(viewModel);
|
||||
}
|
||||
@@ -4,5 +4,4 @@ public record MultilineTextEntryConfiguration :
|
||||
ItemEntryConfiguration
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class MultilineTextEntryViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscription subscriber,
|
||||
IDisposer disposer,
|
||||
ItemState state,
|
||||
ItemEntryConfiguration configuration,
|
||||
string key,
|
||||
object value) : ItemEntryViewModel(provider, factory, mediator, publisher, subscriber, disposer, state, configuration, key, value);
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public class MultilineTextEntryViewModelHandler(IServiceFactory serviceFactory) :
|
||||
IHandler<CreateEventArgs<MultilineTextEntryConfiguration>, IItemEntryViewModel?>
|
||||
{
|
||||
public Task<IItemEntryViewModel?> Handle(CreateEventArgs<MultilineTextEntryConfiguration> args,
|
||||
CancellationToken cancellationToken)
|
||||
{
|
||||
if (args.Value is MultilineTextEntryConfiguration configuration)
|
||||
{
|
||||
if (serviceFactory.Create<MultilineTextEntryViewModel>([.. args.Parameters, configuration, configuration.Label, configuration.Value ?? ""])
|
||||
is MultilineTextEntryViewModel viewModel)
|
||||
{
|
||||
return Task.FromResult<IItemEntryViewModel?>(viewModel);
|
||||
}
|
||||
}
|
||||
|
||||
return Task.FromResult<IItemEntryViewModel?>(default);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
namespace Bitvault;
|
||||
|
||||
public record NoteEntryConfiguration :
|
||||
ItemEntryConfiguration
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class NoteViewModel : Observable
|
||||
{
|
||||
public NoteViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscription subscriber,
|
||||
IDisposer disposer) : base(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class ItemTextEntryViewModel(IServiceProvider provider,
|
||||
public partial class PasswordEntryViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
+3
-3
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public class ItemPasswordEntryViewModelHandler(IServiceFactory serviceFactory) :
|
||||
public class PasswordEntryViewModelHandler(IServiceFactory serviceFactory) :
|
||||
IHandler<CreateEventArgs<PasswordEntryConfiguration>, IItemEntryViewModel?>
|
||||
{
|
||||
public Task<IItemEntryViewModel?> Handle(CreateEventArgs<PasswordEntryConfiguration> args,
|
||||
@@ -10,8 +10,8 @@ public class ItemPasswordEntryViewModelHandler(IServiceFactory serviceFactory) :
|
||||
{
|
||||
if (args.Value is PasswordEntryConfiguration configuration)
|
||||
{
|
||||
if (serviceFactory.Create<ItemPasswordEntryViewModel>([.. args.Parameters, configuration, configuration.Label, configuration.Value ?? ""])
|
||||
is ItemPasswordEntryViewModel viewModel)
|
||||
if (serviceFactory.Create<PasswordEntryViewModel>([.. args.Parameters, configuration, configuration.Label, configuration.Value ?? ""])
|
||||
is PasswordEntryViewModel viewModel)
|
||||
{
|
||||
return Task.FromResult<IItemEntryViewModel?>(viewModel);
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
namespace Bitvault;
|
||||
|
||||
public class SystemIdleTimer;
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class ItemPasswordEntryViewModel(IServiceProvider provider,
|
||||
public partial class TextEntryViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public class ItemTextEntryViewModelHandler(IServiceFactory serviceFactory) :
|
||||
public class TextEntryViewModelHandler(IServiceFactory serviceFactory) :
|
||||
IHandler<CreateEventArgs<TextEntryConfiguration>, IItemEntryViewModel?>
|
||||
{
|
||||
public Task<IItemEntryViewModel?> Handle(CreateEventArgs<TextEntryConfiguration> args,
|
||||
@@ -10,8 +10,8 @@ public class ItemTextEntryViewModelHandler(IServiceFactory serviceFactory) :
|
||||
{
|
||||
if (args.Value is TextEntryConfiguration configuration)
|
||||
{
|
||||
if (serviceFactory.Create<ItemTextEntryViewModel>([.. args.Parameters, configuration, configuration.Label, configuration.Value ?? ""])
|
||||
is ItemTextEntryViewModel viewModel)
|
||||
if (serviceFactory.Create<TextEntryViewModel>([.. args.Parameters, configuration, configuration.Label, configuration.Value ?? ""])
|
||||
is TextEntryViewModel viewModel)
|
||||
{
|
||||
return Task.FromResult<IItemEntryViewModel?>(viewModel);
|
||||
}
|
||||
@@ -1,15 +0,0 @@
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Bitvault;
|
||||
|
||||
public partial class TextViewModel : Observable
|
||||
{
|
||||
public TextViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscription subscriber,
|
||||
IDisposer disposer) : base(provider, factory, mediator, publisher, subscriber, disposer)
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user