/// <summary> /// コンストラクタ /// </summary> /// <param name="settings"> </param> public ObjectChipPalletViewModel(IGeneralSettings settings) : base(settings) { ObjectChipLibrary = new ObjectChipLibrary(settings); Items = GetPalletItemViewModels(ObjectChipLibrary); base.Drawing = new DrawObjectState(ObjectChipLibrary); }
public DrawObjectState(ObjectChipLibrary objectChipLibrary) { _objectChipLibrary = objectChipLibrary; }
private static ObservableCollection<PalletItemViewModel> GetPalletItemViewModels(ObjectChipLibrary objectChipLibrary) { var items = new ObservableCollection<PalletItemViewModel>( objectChipLibrary.GetEnumerator() .Select(x => { var bitmap = objectChipLibrary.GetBitMap(x.ID); return new PalletItemViewModel() { ImageSource = bitmap, Visible = Visibility.Hidden, ItemID = x.ID, }; })); return items; }