Update avalonia
This commit is contained in:
@@ -2,23 +2,29 @@
|
||||
|
||||
namespace Wallet;
|
||||
|
||||
public partial class CommentEntryCollectionViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer,
|
||||
IContentTemplate template,
|
||||
ItemState state,
|
||||
ItemEntryConfiguration<ICollection<Comment>> configuration,
|
||||
string key,
|
||||
ICollection<Comment> value,
|
||||
bool isConcealed,
|
||||
bool isRevealed,
|
||||
double width) : ItemEntryCollectionViewModel<ICommentEntryViewModel, ICollection<Comment>>(provider, factory, mediator, publisher, subscriber, disposer, state, configuration, key, value, isConcealed, isRevealed, width),
|
||||
public partial class CommentEntryCollectionViewModel : ItemEntryCollectionViewModel<ICommentEntryViewModel, ICollection<Comment>>,
|
||||
INotificationHandler<CreateEventArgs<Comment>>
|
||||
{
|
||||
public IContentTemplate Template { get; set; } = template;
|
||||
public CommentEntryCollectionViewModel(IServiceProvider provider,
|
||||
IServiceFactory factory,
|
||||
IMediator mediator,
|
||||
IPublisher publisher,
|
||||
ISubscriber subscriber,
|
||||
IDisposer disposer,
|
||||
IContentTemplate template,
|
||||
ItemState state,
|
||||
ItemEntryConfiguration<ICollection<Comment>> configuration,
|
||||
string key,
|
||||
ICollection<Comment> value,
|
||||
bool isConcealed,
|
||||
bool isRevealed,
|
||||
double width) : base(provider, factory, mediator, publisher, subscriber, disposer, state, configuration, key, value, isConcealed, isRevealed, width)
|
||||
{
|
||||
Template = template;
|
||||
UpdateState();
|
||||
}
|
||||
|
||||
public IContentTemplate Template { get; set; }
|
||||
|
||||
public Task Handle(CreateEventArgs<Comment> args)
|
||||
{
|
||||
@@ -31,9 +37,12 @@ public partial class CommentEntryCollectionViewModel(IServiceProvider provider,
|
||||
return Task.CompletedTask;
|
||||
}
|
||||
|
||||
protected override void OnStateChanged()
|
||||
protected override void OnStateChanged() =>
|
||||
UpdateState();
|
||||
|
||||
private void UpdateState()
|
||||
{
|
||||
if (State is ItemState.Write)
|
||||
if (State is ItemState.Write or ItemState.New)
|
||||
{
|
||||
Add<CreateCommentEntryViewModel>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user