Show multiple releases and improve workshop routing

This commit is contained in:
Robert committed 2024-03-24 21:29:48 +01:00
1 parent da3d47d7b8
commit 9c04932afa
39 files changed
+419 -498

No files matched your search

@@ -12,7 +12,7 @@
<Border Classes="card" VerticalAlignment="Top">
<ContentControl Content="{CompiledBinding EntryInfoViewModel}" />
</Border>
<Border Classes="card" VerticalAlignment="Top" IsVisible="{CompiledBinding Entry.LatestRelease, Converter={x:Static ObjectConverters.IsNotNull}}">
<Border Classes="card" VerticalAlignment="Top" IsVisible="{CompiledBinding Entry.Releases.Count}">
<ContentControl Content="{CompiledBinding EntryReleasesViewModel}" />
</Border>
</StackPanel>
@@ -32,7 +32,13 @@
<TextBlock Theme="{StaticResource SubtitleTextBlockStyle}">Required plugins</TextBlock>
<Border Classes="card-separator" />
<ScrollViewer>
<ItemsControl ItemsSource="{CompiledBinding Dependencies}"></ItemsControl>
<ItemsControl ItemsSource="{CompiledBinding Dependencies}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Spacing="5"></StackPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
</ScrollViewer>
</StackPanel>
</Border>
@@ -0,0 +1,16 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:controls="clr-namespace:FluentAvalonia.UI.Controls;assembly=FluentAvalonia"
xmlns:ui="clr-namespace:Artemis.UI"
xmlns:profile="clr-namespace:Artemis.UI.Screens.Workshop.Profile"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="Artemis.UI.Screens.Workshop.Profile.ProfileListView"
x:DataType="profile:ProfileListViewModel">
<controls:Frame Name="RouterFrame" IsNavigationStackEnabled="False" CacheSize="0">
<controls:Frame.NavigationPageFactory>
<ui:PageFactory />
</controls:Frame.NavigationPageFactory>
</controls:Frame>
</UserControl>
@@ -0,0 +1,25 @@
using System;
using System.Reactive.Disposables;
using Artemis.UI.Shared.Routing;
using Avalonia.ReactiveUI;
using Avalonia.Threading;
using ReactiveUI;
namespace Artemis.UI.Screens.Workshop.Profile;
public partial class ProfileListView : ReactiveUserControl<ProfileListViewModel>
{
public ProfileListView()
{
InitializeComponent();
this.WhenActivated(d =>
{
ViewModel.WhenAnyValue(vm => vm.Screen).Subscribe(Navigate).DisposeWith(d);
});
}
private void Navigate(RoutableScreen? viewModel)
{
RouterFrame.NavigateFromObject(viewModel ?? ViewModel?.EntryListViewModel);
}
}
@@ -0,0 +1,16 @@
using Artemis.UI.Screens.Workshop.Entries.List;
using Artemis.UI.Shared.Routing;
using Artemis.WebClient.Workshop;
namespace Artemis.UI.Screens.Workshop.Profile;
public class ProfileListViewModel : RoutableHostScreen<RoutableScreen>
{
public EntryListViewModel EntryListViewModel { get; }
public ProfileListViewModel(EntryListViewModel entryListViewModel)
{
EntryListViewModel = entryListViewModel;
EntryListViewModel.EntryType = EntryType.Profile;
}
}