public void LoadList(PlayerBoardObservable <TR> thisMod) { _thisMod = thisMod; _cardList = thisMod.CardList; _cardList.CollectionChanged += CardList_CollectionChanged; if (thisMod.Game == PlayerBoardObservable <TR> .EnumGameList.None) { throw new BasicBlankException("Must choose Skuck or Horseshoes"); } if (_cardList.Count == 0) { throw new BasicBlankException("Must have cardlist already"); } _thisGrid = new Grid(); GamePackageDIContainer thisC = Resolve <GamePackageDIContainer>(); IProportionImage thisImage = thisC.Resolve <IProportionImage>(ts.TagUsed); SKSize thisSize = _cardList.First().DefaultSize; SKSize usedSize = thisSize.GetSizeUsed(thisImage.Proportion); var pixels = usedSize.Height / 2; int x; var loopTo = _cardList.Count; for (x = 1; x <= loopTo; x++) { GridHelper.AddPixelRow(_thisGrid, (int)pixels); } GridHelper.AddPixelRow(_thisGrid, (int)pixels); pixels = usedSize.Width + 6; for (x = 1; x <= 4; x++) { GridHelper.AddPixelColumn(_thisGrid, (int)pixels); } PopulateControls(); Content = _thisGrid; }
public void UpdateList(PlayerBoardObservable <TR> thisMod) { _thisMod = thisMod; _cardList !.CollectionChanged -= CardList_CollectionChanged; _cardList = thisMod.CardList; _cardList.CollectionChanged += CardList_CollectionChanged; if (thisMod.Game == PlayerBoardObservable <TR> .EnumGameList.None) { throw new BasicBlankException("Must choose Skuck or Horseshoes"); } if (_cardList.Count == 0) { throw new BasicBlankException("Must have cardlist already"); } PopulateControls(); }