public UserControl_GraphicsInstanceDefinition(GraphicsInstanceDefinition_Ex graphicsInstanceDefinition_ex) : base("Graphics Instance Type Definition", false) { m_graphicsInstanceDefinition = graphicsInstanceDefinition_ex.GraphicsInstanceDefinition; GraphicsInstanceDefinitionType = graphicsInstanceDefinition_ex.TypeOfInstance; if (DataIsNull()) { m_textBlock_id.Text = "N/A"; m_textBox_name.Text = string.Empty; m_integerUpDown_zOrder.Value = null; m_integerUpDown_renderPass.Value = null; } else { m_textBlock_id.Text = m_graphicsInstanceDefinition.Id.ToString(); m_textBox_name.Text = m_graphicsInstanceDefinition.Name; m_integerUpDown_zOrder.Value = m_graphicsInstanceDefinition.ZOrder; m_integerUpDown_renderPass.Value = m_graphicsInstanceDefinition.RenderPass; if (DataManager.AnimationStateDefinitions.Any(x => x.GraphicsInstanceDefinition == m_graphicsInstanceDefinition)) m_radioButton_animation.IsChecked = true; else if (DataManager.FontTextureDefinitions.Any(x => x.GraphicsInstanceDefinition == m_graphicsInstanceDefinition)) m_radioButton_font.IsChecked = 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); }