示例#1
0
        private UserInterface.Deck.ViewModel CreateReadonlyDeckVm(Deck deck)
        {
            var deckVm = ViewModels.Deck.Create(deck);

            deckVm.OnAdd    = delegate { return(false); };
            deckVm.OnRemove = delegate { return(false); };
            return(deckVm);
        }
示例#2
0
        public ViewModel(List <CardInfo> library, Deck existing)
        {
            _library  = library;
            _existing = existing;

            ButtonNames = new ButtonNames
            {
                Cancel   = "Back",
                Continue = "Save deck"
            };
        }
示例#3
0
        public override void Initialize()
        {
            IsSaved = true;

            if (_deck == null)
            {
                _deck = new Deck {
                    Name = NewDeckName
                };
                SelectedCard = null;
                IsNew        = true;
                return;
            }

            SelectedCard = _deck[RandomEx.Next(_deck.CardCount)];
        }
示例#4
0
        private UserInterface.Deck.ViewModel CreateReadonlyDeckVm(Deck deck)
        {
            var deckVm = ViewModels.Deck.Create(deck);

              deckVm.OnAdd = delegate { return false; };
              deckVm.OnRemove = delegate { return false; };
              return deckVm;
        }
示例#5
0
 public ViewModel(Deck deck)
 {
     _deck = deck;
 }
示例#6
0
 public void RemoveCard(LibraryItem libraryItem)
 {
     Deck.RemoveCard(libraryItem.Info);
 }
示例#7
0
 public void AddCard(LibraryItem libraryItem)
 {
     Deck.AddCard(libraryItem.Info);
 }
示例#8
0
    public override void Initialize()
    {
      IsSaved = true;

      if (_deck == null)
      {
        _deck = new Deck {Name = NewDeckName};
        SelectedCard = null;
        IsNew = true;
        return;
      }

      SelectedCard = _deck[RandomEx.Next(_deck.CardCount)];
    }
示例#9
0
 public ViewModel(Deck deck)
 {
   _deck = deck;
 }