Massive improvements to notes/commenting

This commit is contained in:
TheXamlGuy
2024-07-15 21:51:13 +01:00
parent d93fc66e59
commit b84e3abef6
3 changed files with 34 additions and 5 deletions
@@ -11,15 +11,18 @@ public class CommentEntryCollectionViewModelHandler(IServiceFactory serviceFacto
if (args.Sender is CommentEntryCollectionConfiguration configuration)
{
string? label = configuration.Label;
List<Comment> value = new List<Comment>();
List<Comment> values = configuration.Value is not null ? new List<Comment>(configuration.Value) : [];
double? width = configuration.Width;
if (serviceFactory.Create<CommentEntryCollectionViewModel>(args => args.Initialize(),
[.. args.Parameters, configuration, label, value, false, false, width])
[.. args.Parameters, configuration, label, values, false, false, width])
is CommentEntryCollectionViewModel viewModel)
{
foreach (Comment value in values.OrderByDescending(x => x.DateTime))
{
viewModel.Add<CommentEntryViewModel>(value.DateTime, value.Text);
}
viewModel.Add<CreateCommentEntryViewModel>();
return Task.FromResult<IItemEntryViewModel?>(viewModel);
}
}