public void RemoveCard(ChoosableCard card)
        {
            Cards.Remove(card);

            list.Items.Remove(card);

            UpdateLayout();
        }
        public void AddCard(ChoosableCard card)
        {
            if (!Cards.Contains(card))
            {
                Cards.Add(card);
                card.OnChoose += Card_OnChoose;

                list.Items.Add(card);
                UpdateLayout();
            }
        }
 private void Card_OnChoose(ChoosableCard card)
 {
     ChosenCard        = card as ChoosableCard;
     list.SelectedItem = card;
     OnSelectedChange?.Invoke(this, new EventArgs());
 }
Exemple #4
0
 /// <summary>
 /// 传出被选中的消息
 /// </summary>
 /// <param name="card">卡片</param>
 protected void Choose(ChoosableCard card)
 {
     OnChoose?.Invoke(card);
 }