private void RefreshComponent(BlogPost blogPost) { if (blogPost == null) return; this.AuthorTextBox.Text = blogPost.Author; this.ContentTextBox.Text = blogPost.Content; this.TitleTextBox.Text = blogPost.Title; this.CategoryComboBox.Text = blogPost.Category.ToString(); // some change }
private void HandleSaveButtonClick(object sender, EventArgs e) { BlogPost = new BlogPost { Content = this.ContentTextBox.Text, Author = this.AuthorTextBox.Text, Title = this.TitleTextBox.Text, Category = (Category)Enum.Parse(typeof(Category), this.CategoryComboBox.Text) }; OnSaveBlogPost(); }