-Komplette view überarbeitet für Thunderstore mit mods suche, vorschau, markdown (readme) etc
todo: wenn neuer mod aufgerufen wird, soll die zurückfunktion deaktviert sein oder so das sie den mod mit aktualisiert zu dem der davor ausgewählt war (:
This commit is contained in:
35
Valheim Dashboard/ViewModels/StoreViewModel.cs
Normal file
35
Valheim Dashboard/ViewModels/StoreViewModel.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using Avalonia;
|
||||
using ReactiveUI;
|
||||
using System.ComponentModel;
|
||||
using System.Reactive;
|
||||
|
||||
namespace Valheim_Dashboard.ViewModels;
|
||||
|
||||
public class StoreViewModel : ViewModelBase
|
||||
{
|
||||
|
||||
public ViewModelBase CurrentStoreView { get; set; }
|
||||
public ReactiveCommand<Unit, Unit> BackCommand { get; }
|
||||
public ReactiveCommand<Unit, ViewModelBase> ShowThunderstoreCommand { get; }
|
||||
public ReactiveCommand<Unit, ViewModelBase> ShowNexusCommand { get; }
|
||||
|
||||
private readonly MainWindowViewModel _main;
|
||||
|
||||
public StoreViewModel(MainWindowViewModel main)
|
||||
{
|
||||
|
||||
_main = main;
|
||||
|
||||
BackCommand = ReactiveCommand.Create(() =>
|
||||
{
|
||||
_main.SwitchToServerDashboard();
|
||||
});
|
||||
|
||||
ShowThunderstoreCommand = ReactiveCommand.Create(() => CurrentStoreView = new ThunderstoreViewModel());
|
||||
ShowNexusCommand = ReactiveCommand.Create(() => CurrentStoreView = new NexusViewModel());
|
||||
|
||||
// Default → Thunderstore
|
||||
CurrentStoreView = new ThunderstoreViewModel();
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user