2025-04-03 10:21:57 +01:00
|
|
|
|
using TRX_ConfigToolLib.Models.Specification;
|
|
|
|
|
using TRX_ConfigToolLib.Utils;
|
2024-10-02 10:23:19 +02:00
|
|
|
|
|
|
|
|
|
namespace TRX_ConfigToolLib.Models;
|
|
|
|
|
|
|
|
|
|
public class CategoryViewModel
|
|
|
|
|
{
|
|
|
|
|
private static readonly string _defaultImage = "Graphics/graphic1.jpg";
|
|
|
|
|
|
|
|
|
|
private readonly Category _category;
|
|
|
|
|
|
|
|
|
|
public CategoryViewModel(Category category)
|
|
|
|
|
{
|
|
|
|
|
_category = category;
|
2024-11-16 15:56:54 +00:00
|
|
|
|
ItemsSource = new(category.Properties);
|
2024-10-02 10:23:19 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Title
|
|
|
|
|
{
|
|
|
|
|
get => _category.Title;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string ImageSource
|
|
|
|
|
{
|
|
|
|
|
get => AssemblyUtils.GetEmbeddedResourcePath(_category.Image ?? _defaultImage);
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-16 15:56:54 +00:00
|
|
|
|
public FastObservableCollection<BaseProperty> ItemsSource { get; private set; }
|
2024-10-02 10:23:19 +02:00
|
|
|
|
|
|
|
|
|
public double ViewPosition { get; set; }
|
|
|
|
|
}
|