feat(ui): scaffold islands shell and child VMs
This commit is contained in:
33
src/ClaudeDo.Ui/ViewModels/IslandsShellViewModel.cs
Normal file
33
src/ClaudeDo.Ui/ViewModels/IslandsShellViewModel.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using ClaudeDo.Ui.ViewModels.Islands;
|
||||
|
||||
namespace ClaudeDo.Ui.ViewModels;
|
||||
|
||||
public sealed partial class IslandsShellViewModel : ViewModelBase
|
||||
{
|
||||
public ListsIslandViewModel Lists { get; }
|
||||
public TasksIslandViewModel Tasks { get; }
|
||||
public DetailsIslandViewModel Details { get; }
|
||||
|
||||
[ObservableProperty]
|
||||
private double _windowWidth = 1280;
|
||||
|
||||
public bool ShowDetails => WindowWidth >= 1100;
|
||||
public bool ShowLists => WindowWidth >= 780;
|
||||
|
||||
partial void OnWindowWidthChanged(double value)
|
||||
{
|
||||
OnPropertyChanged(nameof(ShowDetails));
|
||||
OnPropertyChanged(nameof(ShowLists));
|
||||
}
|
||||
|
||||
public IslandsShellViewModel(
|
||||
ListsIslandViewModel lists,
|
||||
TasksIslandViewModel tasks,
|
||||
DetailsIslandViewModel details)
|
||||
{
|
||||
Lists = lists; Tasks = tasks; Details = details;
|
||||
Lists.SelectionChanged += (_, _) => Tasks.LoadForList(Lists.SelectedList);
|
||||
Tasks.SelectionChanged += (_, _) => Details.Bind(Tasks.SelectedTask);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user