Submission wizard - Upload entry icon

Entry lists - Show entry icon
This commit is contained in:
Robert committed 2023-08-16 20:01:28 +02:00
1 parent 6014bb9e3c
commit 176a28761f
11 files changed
+214 -39

No files matched your search

@@ -23,8 +23,9 @@
VerticalAlignment="Center"
Margin="0 0 10 0"
Width="80"
Height="80">
<avalonia:MaterialIcon Kind="HandOkay" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Width="70" Height="70" />
Height="80"
ClipToBounds="True">
<Image Source="{CompiledBinding EntryIcon^}" Stretch="UniformToFill"/>
</Border>
<!-- Body -->
@@ -1,26 +1,34 @@
using System;
using System.Reactive;
using System.Reactive.Linq;
using System.Threading;
using System.Threading.Tasks;
using Artemis.UI.Shared;
using Artemis.UI.Shared.Routing;
using Artemis.WebClient.Workshop;
using Artemis.WebClient.Workshop.Services;
using Avalonia.Media.Imaging;
using ReactiveUI;
namespace Artemis.UI.Screens.Workshop.Entries;
public class EntryListViewModel : ViewModelBase
public class EntryListViewModel : ActivatableViewModelBase
{
private readonly IRouter _router;
private readonly ObservableAsPropertyHelper<Bitmap?> _entryIcon;
public EntryListViewModel(IGetEntries_Entries_Items entry, IRouter router)
public EntryListViewModel(IGetEntries_Entries_Items entry, IRouter router, IWorkshopService workshopService)
{
_router = router;
Entry = entry;
EntryIcon = workshopService.GetEntryIcon(entry.Id, CancellationToken.None);
NavigateToEntry = ReactiveCommand.CreateFromTask(ExecuteNavigateToEntry);
}
public IGetEntries_Entries_Items Entry { get; }
public ReactiveCommand<Unit,Unit> NavigateToEntry { get; }
public Task<Bitmap?> EntryIcon { get; }
public ReactiveCommand<Unit, Unit> NavigateToEntry { get; }
private async Task ExecuteNavigateToEntry()
{