/// <summary> /// Sets the View Model for the Texture and Model tab when an item is selected from the treeview /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void TreeView_SelectionChanged(object sender, PropertyChangedEventArgs e) { var itemVM = sender as ItemViewModel; if (itemVM.IsSelected) { //dispose of the data from teh previously selected item if (ModelVM != null) { ModelVM.Dispose(); } TextureVM = new TextureViewModel(itemVM.Item, ((CategoryViewModel)itemVM.Parent).CategoryName); if (itemVM.ItemName.Equals(Strings.Face_Paint) || itemVM.ItemName.Equals(Strings.Equipment_Decals)) { if (ModelVM != null) { ModelVM.ModelTabEnabled = false; } } else { ModelVM = new ModelViewModel(itemVM.Item, ((CategoryViewModel)itemVM.Parent).CategoryName); ModelVM.ModelTabEnabled = true; } } }
public void OpenID(ItemData item, string race, string category, string part, string variant) { if (ModelVM != null) { ModelVM.Dispose(); } TextureVM.UpdateTextureFromID(item, race, category, part, variant); ModelVM.UpdateModel(item, category); ModelVM.ModelTabEnabled = true; }