Пример #1
0
        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();
            }
        }
Пример #2
0
        /// <summary>
        ///     Populates the page with content passed during navigation. Any saved state is also
        ///     provided when recreating a page from a prior session.
        /// </summary>
        /// <param name="sender">
        ///     The source of the event; typically <see cref="NavigationHelper" />
        /// </param>
        /// <param name="e">
        ///     Event data that provides both the navigation parameter passed to
        ///     <see cref="Frame.Navigate(Type, Object)" /> when this page was initially requested and
        ///     a dictionary of state preserved by this page during an earlier
        ///     session. The state will be null the first time a page is visited.
        /// </param>
        private async void navigationHelper_LoadState(object sender, LoadStateEventArgs e)
        {
            LoadingProgressBar.Visibility = Visibility.Visible;
            var  jsonObjectString = (string)e.NavigationParameter;
            long threadId         = Convert.ToInt64(jsonObjectString);

            _forumReply = await _replyManager.GetReplyCookiesForEdit(threadId);

            if (_forumReply == null)
            {
                var msgDlg = new MessageDialog("You can't edit this post!");
                await msgDlg.ShowAsync();

                Frame.GoBack();
                return;
            }
            ReplyText.Text = _forumReply.Quote;
            PreviewLastPostWebView.NavigateToString(_forumReply.PreviousPostsRaw);
            LoadingProgressBar.Visibility = Visibility.Collapsed;
        }
Пример #3
0
 private void LastPostsButton_OnClick(object sender, RoutedEventArgs e)
 {
     PreviewLastPostWebView.NavigateToString(_forumReply.PreviousPostsRaw);
     ItemGridView.Visibility           = Visibility.Collapsed;
     PreviewLastPostWebView.Visibility = Visibility.Visible;
 }