Recent Items

This commit is contained in:
Jöran Malek 2024-02-10 23:47:45 +01:00
parent 2529b728ba
commit f703567aed
10 changed files with 62 additions and 12 deletions

View file

@ -1,3 +1,4 @@
using InkForge.Common.Controllers;
using InkForge.Common.ReactiveUI;
using ReactiveUI;
@ -8,7 +9,15 @@ public class CreateWorkspaceViewModel : LandingViewModelBase
{
public override string? UrlPathSegment => null;
public CreateWorkspaceViewModel(LandingViewModel landing) : base(landing)
private string workspaceName;
public string WorkspaceName
{
get => workspaceName;
set => this.RaiseAndSetIfChanged(ref workspaceName, value);
}
public CreateWorkspaceViewModel(LandingViewModel landing, WorkspaceController workspace) : base(landing)
{
}
}

View file

@ -1,3 +1,5 @@
using System.Collections.ObjectModel;
using InkForge.Common.ReactiveUI;
namespace InkForge.Common.ViewModels.Landing;
@ -5,6 +7,9 @@ namespace InkForge.Common.ViewModels.Landing;
public class OpenRecentViewModel : LandingViewModelBase
{
public override string? UrlPathSegment => null;
private readonly ReadOnlyObservableCollection<RecentItemViewModel> recentItems;
public ReadOnlyObservableCollection<RecentItemViewModel> RecentItems => recentItems;
public OpenRecentViewModel(LandingViewModel landing) : base(landing)
{

View file

@ -0,0 +1,9 @@
using ReactiveUI;
namespace InkForge.Common.ViewModels.Landing;
public record class RecentItemViewModel(
DateTimeOffset Created,
string Name,
DateTimeOffset LastUsed
) : ReactiveRecord;