private void PopulateControls()
        {
            _thisGrid !.Children.Clear();
            _thisGrid.ColumnDefinitions.Clear();
            if (_cardList !.Count == 0)
            {
                return;
            }
            int times = _cardList.Count + 3;

            times.Times(x =>
            {
                AddPixelColumn(_thisGrid, _pixels);
            });
            int y = 0;

            _cardList.ForEach(thisCard =>
            {
                var thisGraphics = GetNewCard(thisCard);
                AddControlToGrid(_thisGrid, thisGraphics, 0, y);
                Grid.SetColumnSpan(thisGraphics, 4);
                y++;
            });
            _currentCard = _cardList.Last();
        }
예제 #2
0
        private void PopulateControls()
        {
            _thisGrid !.ColumnDefinitions.Clear();
            _thisGrid.Children.Clear();
            if (_cardList !.Count == 0)
            {
                return;
            }
            var pixels = _widthUsed / 4;
            int totals = _cardList.Count + 3;

            totals.Times(x => AddPixelColumn(_thisGrid, (int)pixels));
            int y, m;

            if (_isReversed)
            {
                y = _cardList.Count;
                //d = -1;
                m = 0;
            }
            else
            {
                y = 0;
                //d = 1;
                m = _cardList.Count;
            }
            _cardList.ForEach(thisCard =>
            {
                var thisGraphics = GetNewCard(thisCard);
                AddControlToGrid(_thisGrid, thisGraphics, 0, y);
                Grid.SetColumnSpan(thisGraphics, 4);
                if (_isReversed)
                {
                    y--;
                }
                else
                {
                    y++;
                }
            });
            if (_isReversed)
            {
                _currentCard = _cardList.Last();
            }
            else
            {
                _currentCard = _cardList.First();
            }
            _currentCard.IsSelected = _thisMod !.IsSelected;
        }
예제 #3
0
 public DeckObservableDict <D> DeckList() // try this way
 {
     _objectList.ForEach(thisO => thisO.Visible = true);
     return(_objectList.ToObservableDeckDict());
 }