TRX/tools/config/TRX_ConfigToolLib/Models/CategoryViewModel.cs

32 lines
741 B
C#
Raw Permalink Normal View History

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;
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);
}
public FastObservableCollection<BaseProperty> ItemsSource { get; private set; }
2024-10-02 10:23:19 +02:00
public double ViewPosition { get; set; }
}