private void TextContent_TextChanged(object sender, TextChangedEventArgs e) { string tag = (sender as TextBox).Tag as string; switch (tag) { case "TextContent": UpdateLayoutData.setControlSource(currentControl, this.TextContent.Text); break; case "TextSize": if (currentControl == null) { return; } MyText myText = currentControl as MyText; if (this.TextSize.Text == "" || !this.TextSize.IsFocused) { return; } myText.setTextChildAttr(Convert.ToInt32(this.TextSize.Text), this.TextColor.SelectedIndex, this.TextBackground.SelectedIndex); break; } }