public void Initialize(List <Affix> affixes, ItemBase itemBase, BaseInfomation baseInfo)
        {
            if (_baseInfo == null || !_baseInfo.Equals(baseInfo))
            {
                _itemBase    = itemBase;
                _affixes     = affixes;
                _baseInfo    = baseInfo;
                SelectedItem = new ItemPrototypeModel();
                ItemPrototypes.Clear();
                ItemControl = null;

                AddItem();
                SelectedItem = ItemPrototypes[0];
                OnPropertyChanged(nameof(SelectedItem));
            }
        }
Example #2
0
        public void Initialize(Dictionary <ItemPrototypeModel, List <Equipment> > items, double currencySpent)
        {
            ItemResults = string.Empty;
            OnPropertyChanged(nameof(ItemResults));

            ItemDictionary = items;
            ItemPrototypes.Clear();

            var itemCount  = items.Where(x => x.Key.Value > 0).Sum(x => x.Value.Count);
            var itemsValue = items.Sum(x => x.Key.Value * x.Value.Count);

            CurrencyResults = String.Format("You spent {0} chaos crafting {1} items worth a total of {2} chaos", currencySpent, itemCount, itemsValue);

            foreach (var itemPrototype in ItemDictionary)
            {
                ItemPrototypes.Add(itemPrototype.Key);
            }

            OnPropertyChanged(nameof(CurrencyResults));
            OnPropertyChanged(nameof(ItemPrototypes));
        }