public UserControl_FontTextureDefinition(FontTextureDefinition fontTextureDefinition)
            : base("Font Texture Definition", false)
        {
            m_fontTextureDefinition = fontTextureDefinition;

            if (DataIsNull())
            {
                m_textBlock_id.Text = "N/A";
                m_textBox_name.Text = string.Empty;
                m_textBox_texture.Text = string.Empty;
                m_doubleUpDown_textureWidth.Value = null;
                m_doubleUpDown_startTop.Value = null;
                m_doubleUpDown_startLeft.Value = null;
                m_doubleUpDown_characterWidth.Value = null;
                m_doubleUpDown_characterHeight.Value = null;
            }
            else
            {
                m_textBlock_id.Text = m_fontTextureDefinition.Id.ToString();
                m_textBox_name.Text = m_fontTextureDefinition.Name;
                m_textBox_texture.Text = m_fontTextureDefinition.Texture;

                CreateCanvasControls();

                m_doubleUpDown_textureWidth.Value = m_fontTextureDefinition.TextureWidth;
                m_doubleUpDown_startTop.Value = m_fontTextureDefinition.StartTop;
                m_doubleUpDown_startLeft.Value = m_fontTextureDefinition.StartLeft;
                m_doubleUpDown_characterWidth.Value = m_fontTextureDefinition.CharacterWidth;
                m_doubleUpDown_characterHeight.Value = m_fontTextureDefinition.CharacterHeight;
            }
        }
        protected override int AddNewData()
        {
            m_fontTextureDefinition = DataManager.Generate<FontTextureDefinition>();
            m_fontTextureDefinition.Name = m_textBox_name.Text;
            m_fontTextureDefinition.Texture = m_textBox_texture.Text;
            m_fontTextureDefinition.TextureWidth = m_doubleUpDown_textureWidth.Value.Value;
            m_fontTextureDefinition.StartTop = m_doubleUpDown_startTop.Value.Value;
            m_fontTextureDefinition.StartLeft = m_doubleUpDown_startLeft.Value.Value;
            m_fontTextureDefinition.CharacterWidth = m_doubleUpDown_characterWidth.Value.Value;
            m_fontTextureDefinition.CharacterHeight = m_doubleUpDown_characterHeight.Value.Value;

            DataManager.FontTextureDefinitions.Add(m_fontTextureDefinition);

            SaveTextureInformation(m_fontTextureDefinition.Texture);

            return m_fontTextureDefinition.Id;
        }
 private void SelectFontTextureDefinition(FontTextureDefinition fontTextureDefinition)
 {
     RemoveFontTextureControls(false);
     m_userControl_fontTextureDefinition = new UserControl_FontTextureDefinition(fontTextureDefinition);
     m_userControl_fontTextureDefinition.NewDataAddedEvent += UserControl_FontTextureDefinition_NewDataAdded;
     m_userControl_fontTextureDefinition.ExistingDataUpdatedEvent += UserControl_FontTextureDefinition_ExistingDataUpdated;
     m_grid_main.SetRowColumn(m_userControl_fontTextureDefinition, 1, 1);
 }
 private void DisplayFont(FontTextureDefinition fontTextureDefinition)
 {
     m_image.Source = new BitmapImage(new Uri(fontTextureDefinition.Texture));
 }