public BaseItemViewModel(BaseItem item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            this._Item = item;

            IEnumerable<ItemTypeDefinition> resources;
            resources = InfoManager.ItemBalance.Items.Where(kv => kv.Value.Type != null).Select(kv => kv.Value.Type);
            resources =
                resources.Concat(
                    InfoManager.ItemBalance.Items.Where(kv => kv.Value.Types != null).SelectMany(bd => bd.Value.Types));

            this.TypeAssets = CreateAssetList(resources.Distinct().Select(t => t.ResourcePath).OrderBy(s => s));
            this.BuildBalanceAssets();
        }
 public void NewItem()
 {
     var item = new BaseItem()
     {
         UniqueId = new Random().Next(int.MinValue, int.MaxValue),
         // TODO: check other item unique IDs to prevent rare collisions
         AssetLibrarySetId = 0,
     };
     var viewModel = new BaseItemViewModel(item);
     this.Slots.Add(viewModel);
     this.SelectedSlot = viewModel;
 }
 public BackpackItem(BaseItem other)
     : base(other)
 {
 }