private async void PreviewButton_Click(object sender, RoutedEventArgs e) { ItemGridView.Visibility = Visibility.Collapsed; PreviewLastPostWebView.Visibility = Visibility.Visible; _forumReply.MapMessage(ReplyText.Text); var replyManager = new ReplyManager(); string result = await replyManager.CreatePreviewEditPost(_forumReply); if (!string.IsNullOrEmpty(result)) { PreviewLastPostWebView.NavigateToString(result); PreviewLastPostWebView.Visibility = Visibility.Visible; } else { LoadingProgressBar.Visibility = Visibility.Collapsed; string messageText = string.Format( "No text?! What good is showing you a preview then! Type something in and try again!{0}{1}", Environment.NewLine, Constants.ASCII_2); var msgDlg = new MessageDialog(messageText); await msgDlg.ShowAsync(); } }
private async void PreviewButton_Click(object sender, RoutedEventArgs e) { PostPreviewRaw.Visibility = Visibility.Collapsed; PreviewPostGrid.Visibility = Visibility.Visible; _forumReply.MapMessage(ReplyText.Text); var replyManager = new ReplyManager(); string result = await replyManager.CreatePreviewEditPost(_forumReply); if (!string.IsNullOrEmpty(result)) { PostPreviewRaw.NavigateToString(result); PostPreviewRaw.Visibility = Visibility.Visible; } else { var msgDlg = new MessageDialog( "No text?! What the f**k good is showing you a preview then! Type some shit in and try again!"); await msgDlg.ShowAsync(); PreviewPostGrid.Visibility = Visibility.Collapsed; } }
public async Task<bool> GetPreviewEditPost(string replyText) { Html = string.Empty; IsLoading = true; ForumReplyEntity.MapMessage(replyText); var replyManager = new ReplyManager(); Html = await replyManager.CreatePreviewEditPost(ForumReplyEntity); IsLoading = false; return !string.IsNullOrEmpty(Html); }
public async Task<bool> GetPreviewEditPost(string replyText) { Html = string.Empty; IsLoading = true; ForumReplyEntity.MapMessage(replyText); var replyManager = new ReplyManager(); try { Html = await replyManager.CreatePreviewEditPost(ForumReplyEntity); } catch (Exception ex) { AwfulDebugger.SendMessageDialogAsync("Could not create preview HTML", ex); } IsLoading = false; return !string.IsNullOrEmpty(Html); }