- Create ViewModels/Components/ and Views/Components/ folders - Extract LibrarySidebarView and LibrarySidebarViewModel from ShellView - Move LibraryItemViewModel to Components folder - Move GameItemViewModel to Components folder - Create GameBannerView component (not yet integrated) - Create PageHeaderView component (not yet integrated) - Simplify ShellView to use LibrarySidebarView component - Update GamesListView to reference Components namespace This improves code organization and makes it easier to navigate the codebase as the UI grows.
38 lines
901 B
C#
38 lines
901 B
C#
using System;
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
using LANCommander.Launcher.Data.Models;
|
|
|
|
namespace LANCommander.Launcher.Avalonia.ViewModels.Components;
|
|
|
|
public partial class LibraryItemViewModel : ViewModelBase
|
|
{
|
|
[ObservableProperty]
|
|
private Guid _id;
|
|
|
|
[ObservableProperty]
|
|
private string _title = string.Empty;
|
|
|
|
[ObservableProperty]
|
|
private string? _iconPath;
|
|
|
|
[ObservableProperty]
|
|
private bool _hasIcon;
|
|
|
|
[ObservableProperty]
|
|
private bool _isSelected;
|
|
|
|
public LibraryItemViewModel(Game game, string? iconPath = null)
|
|
{
|
|
Id = game.Id;
|
|
Title = game.Title ?? "Unknown";
|
|
IconPath = iconPath;
|
|
HasIcon = !string.IsNullOrEmpty(iconPath);
|
|
}
|
|
|
|
public LibraryItemViewModel(Guid id, string name)
|
|
{
|
|
Id = id;
|
|
Title = name;
|
|
HasIcon = false;
|
|
}
|
|
}
|