Esempio n. 1
0
        public void AddCard(
            IMagicCardDefinition cardDefinition,
            int quantity,
            MagicGrade grade,
            MagicLanguage language,
            bool isFoil,
            bool updateTotals)
        {
            var binderCard = new MagicBinderCard()
            {
                CardId   = cardDefinition.CardId,
                Grade    = grade,
                Language = language,
                IsFoil   = isFoil,
                Quantity = quantity
            };

            var viewModel = new MagicBinderCardViewModel(cardDefinition, binderCard);

            _sortedCards.Add(binderCard.RowId, viewModel);
            _cards.Add(viewModel);
            _magicCollection.Cards.Add(binderCard);

            viewModel.PriceChanged += Card_PriceChanged;

            if (updateTotals)
            {
                CalculateTotals();
            }
        }
Esempio n. 2
0
 public FoundMagicCardViewModel(IMagicCardDefinition definition)
 {
     _viewModel = new MagicBinderCardViewModel(definition, new MagicBinderCard()
     {
         CardId = definition.CardId
     });
     _viewModel.PropertyChanged += OnViewModelPropertyChanged;
     UpdateSetData();
 }
Esempio n. 3
0
 public FoundMagicCardViewModel(MagicBinderCardViewModel card)
 {
     _viewModel = card;
     _viewModel.PropertyChanged += OnViewModelPropertyChanged;
     UpdateSetData();
 }