Esempio n. 1
0
        public CardItemModel() //for adding new items
        {
            var guid = Guid.NewGuid();

            _card = new Card(
                guid,
                ViewModelLocator.SetTabViewModel.SelectedSet.Id,
                "Card",
                guid.ToString(),
                "",
                ViewModelLocator.SizeTabViewModel.DefaultSize._size,
                new Dictionary <string, CardPropertySet>());

            var alt = new AltItemModel()
            {
                ParentCard = this
            };

            alt._altCard.Type = "";
            _card.Properties.Add("", alt._altCard);

            AltItems = new ObservableCollection <AltItemModel>()
            {
                alt
            };
            AltItems.CollectionChanged += (a, b) =>
            {
                RefreshAltItems();
            };
        }
Esempio n. 2
0
        public void AddAlt()
        {
            var ret = new AltItemModel()
            {
                ParentCard = SelectedCard
            };

            SelectedCard.AltItems.Add(ret);
            SelectedAlt = ret;
            RaisePropertyChanged("SelectedAlt");
        }
Esempio n. 3
0
 public AltItemModel(AltItemModel a) //for copying the item
 {
     _altCard      = a._altCard.Clone() as CardPropertySet;
     _altCard.Type = Guid.NewGuid().ToString();
     ParentCard    = a.ParentCard;
     CardSize      = a.CardSize;
     Properties    = new ObservableCollection <CardPropertyItemModel>(_altCard.Properties.Where(x => x.Key.Name != "Name").Select(x => new CardPropertyItemModel(x.Key, x.Value)
     {
         _alt = this
     }));
     AltTypeVisibility = Visibility.Visible;
 }
Esempio n. 4
0
        public void CopyAlt()
        {
            if (SelectedAlt == null)
            {
                return;
            }
            var ret = new AltItemModel(SelectedAlt);

            SelectedCard.AltItems.Add(ret);
            SelectedAlt = ret;
            RaisePropertyChanged("SelectedAlt");
        }