private void RemoveUserControls() { if (m_userControl_graphicsInstanceDefinition != null) m_grid_main.Children.Remove(m_userControl_graphicsInstanceDefinition); m_userControl_graphicsInstanceDefinition = null; RemoveAnimationStateControls(true); RemoveFontTextureControls(true); }
private void SelectGraphicsInstanceDefinition(GraphicsInstanceDefinition graphicsInstanceDefinition) { RemoveUserControls(); if(DataManager.AnimationStateDefinitions.Any(x => x.GraphicsInstanceDefinition == graphicsInstanceDefinition)) { m_selectedGraphicsInstanceDefinition = new GraphicsInstanceDefinition_WithAnimationStateDefinitions(graphicsInstanceDefinition); AddAnimationStateControls(); } else if (DataManager.FontTextureDefinitions.Any(x => x.GraphicsInstanceDefinition == graphicsInstanceDefinition)) { m_selectedGraphicsInstanceDefinition = new GraphicsInstanceDefinition_WithFontTextureDefinitions(graphicsInstanceDefinition); AddFontControls(); } else { // we might be trying to load GraphicsInstanceDefinitions before we've loaded the AnimationStateDefinitions or FontTextureDefinitions; // just be patient return; } m_userControl_graphicsInstanceDefinition = new UserControl_GraphicsInstanceDefinition(m_selectedGraphicsInstanceDefinition); m_grid_main.SetRowColumn(m_userControl_graphicsInstanceDefinition, 1, 0); }
private void NewGraphicsInstanceDefinition() { RemoveUserControls(); m_userControl_graphicsInstanceDefinition = new UserControl_GraphicsInstanceDefinition(); m_grid_main.SetRowColumn(m_userControl_graphicsInstanceDefinition, 1, 0); }