private void Submit_Click(object sender, RoutedEventArgs e) { JournalComment comment = new JournalComment(); comment.name = Name.Text; comment.website = Website.Text; comment.comment = HttpUtility.HtmlEncode(HtmlPage.Window.Invoke("getEditorContent", null) as string); comment.user_id = settings.user_id; comment.entry_date = DateTime.Now; journalContext.JournalComments.Add(comment); journalContext.SubmitChanges((CommentSubmitted) => { if (!CommentSubmitted.HasError) { LoadComments(); Name.Text = ""; Website.Text = ""; HtmlPage.Window.Invoke("setEditorContent", ""); } }, null); }