Tidy
This commit is contained in:
@@ -16,8 +16,10 @@ public partial class DropdownEntryViewModel :
|
||||
ItemEntryConfiguration configuration,
|
||||
string key,
|
||||
object value,
|
||||
bool isConcealed,
|
||||
bool isRevealed,
|
||||
double width,
|
||||
DropdownValueViewModel selectedItem) : base(provider, factory, mediator, publisher, subscriber, disposer, items, state, configuration, key, value, width)
|
||||
DropdownValueViewModel selectedItem) : base(provider, factory, mediator, publisher, subscriber, disposer, items, state, configuration, key, value, isConcealed, isRevealed, width)
|
||||
{
|
||||
SelectedItem = selectedItem;
|
||||
}
|
||||
@@ -33,7 +35,9 @@ public partial class DropdownEntryViewModel :
|
||||
ItemEntryConfiguration configuration,
|
||||
string key,
|
||||
object value,
|
||||
double width) : base(provider, factory, mediator, publisher, subscriber, disposer, items, state, configuration, key, value, width)
|
||||
bool isConcealed,
|
||||
bool isRevealed,
|
||||
double width) : base(provider, factory, mediator, publisher, subscriber, disposer, items, state, configuration, key, value, isConcealed, isRevealed, width)
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,7 @@ public class DropdownEntryViewModelHandler(IServiceFactory serviceFactory) :
|
||||
DropdownValueViewModel? selected = values.FirstOrDefault(x => x.Value is not null && x.Value.Equals($"{value}"));
|
||||
|
||||
if (serviceFactory.Create<DropdownEntryViewModel>(args => args.Initialize(),
|
||||
[values, .. args.Parameters, configuration, label, value, width, false, false, selected])
|
||||
[values, .. args.Parameters, configuration, label, value, false, false, width, selected ?? null])
|
||||
is DropdownEntryViewModel viewModel)
|
||||
{
|
||||
return Task.FromResult<IItemEntryViewModel?>(viewModel);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using Toolkit.Foundation;
|
||||
|
||||
namespace Wallet;
|
||||
@@ -27,14 +28,25 @@ public partial class ItemEntryCollectionViewModel<TItem> :
|
||||
ItemEntryConfiguration configuration,
|
||||
string key,
|
||||
object value,
|
||||
bool isConcealed,
|
||||
bool isRevealed,
|
||||
double width) : base(provider, factory, mediator, publisher, subscriber, disposer, key, value)
|
||||
{
|
||||
this.configuration = configuration;
|
||||
|
||||
State = state;
|
||||
IsConcealed = isConcealed;
|
||||
IsRevealed = isRevealed;
|
||||
Width = width;
|
||||
}
|
||||
|
||||
[ObservableProperty]
|
||||
private bool isConcealed;
|
||||
|
||||
[ObservableProperty]
|
||||
private bool isRevealed;
|
||||
|
||||
|
||||
[ObservableProperty]
|
||||
private double width;
|
||||
|
||||
@@ -50,6 +62,8 @@ public partial class ItemEntryCollectionViewModel<TItem> :
|
||||
ItemEntryConfiguration configuration,
|
||||
string key,
|
||||
object value,
|
||||
bool isConcealed,
|
||||
bool isRevealed,
|
||||
double width) : base(provider, factory, mediator, publisher, subscriber, disposer, items, key, value)
|
||||
{
|
||||
this.configuration = configuration;
|
||||
@@ -84,4 +98,14 @@ public partial class ItemEntryCollectionViewModel<TItem> :
|
||||
State = ItemState.Read;
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
|
||||
[RelayCommand]
|
||||
private void Hide() => IsRevealed = false;
|
||||
|
||||
[RelayCommand]
|
||||
private void Reveal() => IsRevealed = true;
|
||||
|
||||
[RelayCommand]
|
||||
private void Copy() => Publisher.Publish(Write.As(new Clipboard<object>($"{Value}")));
|
||||
}
|
||||
@@ -65,6 +65,5 @@ public partial class ItemEntryViewModel<TValue>(IServiceProvider provider,
|
||||
private void Reveal() => IsRevealed = true;
|
||||
|
||||
[RelayCommand]
|
||||
private void Copy() =>
|
||||
Publisher.Publish(Write.As(new Clipboard<object>($"{Value}")));
|
||||
private void Copy() => Publisher.Publish(Write.As(new Clipboard<object>($"{Value}")));
|
||||
}
|
||||
Reference in New Issue
Block a user