using System.Windows.Media.Imaging; namespace Dominion.NET_WPF.ViewModel { public class SupplyControlViewModel : ViewModelBase { private DominionBase.ITableable _Supply = null; private bool _IsSupplyGone = false; private SupplyVisibility _Clickability = SupplyVisibility.Plain; private BitmapImage _GoneImage = null; private BitmapImage _BuyImage = null; private BitmapImage _SelectImage = null; private BitmapImage _DisableImage = null; public DominionBase.ITableable Supply { get => _Supply; set { _Supply = value; NotifyPropertyChanged(); } } public bool IsSupplyGone { get => _IsSupplyGone; set { _IsSupplyGone = value; NotifyPropertyChanged(); } } public SupplyVisibility Clickability { get => _Clickability; set { _Clickability = value; NotifyPropertyChanged(); } } public BitmapImage GoneImage { get => _GoneImage; private set { _GoneImage = value; NotifyPropertyChanged(); } } public BitmapImage BuyImage { get => _BuyImage; private set { _BuyImage = value; NotifyPropertyChanged(); } } public BitmapImage SelectImage { get => _SelectImage; private set { _SelectImage = value; NotifyPropertyChanged(); } } public BitmapImage DisableImage { get => _DisableImage; private set { _DisableImage = value; NotifyPropertyChanged(); } } public SupplyControlViewModel() { var repo = Caching.ImageRepository.Acquire(); GoneImage = repo.GetBitmapImage("gone", "small"); BuyImage = repo.GetBitmapImage("gainable", string.Empty); SelectImage = repo.GetBitmapImage("selectable", string.Empty); DisableImage = repo.GetBitmapImage("dither_20", string.Empty); Caching.ImageRepository.Release(); } } }