set_replybutton() public method

public set_replybutton ( reply_clicked reply_handler ) : void
reply_handler reply_clicked
return void
コード例 #1
0
        public void display_all_comments(object c_obj, RunWorkerCompletedEventArgs e)
        {
            this._list.Items.Dispatcher.BeginInvoke(DispatcherPriority.Normal,
               new System.Action(() =>
               {
                   this._list.Items.Clear();
                   if (initial_item != null)
                       this._list.Items.Add(initial_item);

                   List<comment_item_generic> comments = (List<comment_item_generic>)e.Result;
                   if (this.total_number != null)
                       this.total_number.Text = comments.Count.ToString();
                   foreach (comment_item_generic cig in comments)
                   {
                       item_generic i = new item_generic();
                       //i.username.Text = cig.comment.User.name + ":"; TextBlock.SetFontWeight(i.username, FontWeights.Bold);
                       i.username.Text = "";
                       i.username.Inlines.Add(new Bold(new Run(cig.comment.User.name + ": ")));
                       i.username.Inlines.Add(cig.comment.note);
                       i.user_desc.Visibility = Visibility.Collapsed; //i.user_desc.Content = configurations.GetDate_Formatted(cig.comment.date);
                       i.number.Text = configurations.GetDate_Formatted(cig.comment.date); //i.number.Visibility = System.Windows.Visibility.Collapsed;
                       i.number.FontSize = configurations.design_idea_item_user_info_font_size;
                       i.desc.Visibility = Visibility.Collapsed;// i.desc.Content = "Commented:";
                       i.topleft_panel.VerticalAlignment = VerticalAlignment.Top;
                       i.top_panel.Margin = new Thickness(5, 10, 5, 10);
                       //i.content.Text = cig.comment.note;
                       i.content.Visibility = Visibility.Collapsed;
                       if (item_width != 0) i.Width = item_width + 2;
                       i.avatar.Source = new BitmapImage(new Uri(configurations.GetAbsoluteAvatarPath() + cig.comment.User.avatar));
                       i.Tag = cig.comment.id;
                       if (configurations.use_avatar_drag) i.set_touchevent(this.avatar_drag);
                       i.Margin = new Thickness(0);
                       i.second_border.Margin = new Thickness(cig.level * 25, 0, 0, 0);
                       i.first_border.BorderBrush = Brushes.Gray; i.first_border.BorderThickness = new Thickness(0, 0, 0, 1);
                       i.second_border.BorderBrush = Brushes.DarkGray; i.second_border.BorderThickness = new Thickness(1, 0, 0, 0);
                       if (this.reply_clicked_handler != null && cig.level < (configurations.max_thread_reply - 1)) i.set_replybutton(this.reply_clicked_handler);
                       this._list.Items.Add(i);
                   }

                   if (this._list.Items.Count == 0)
                       this._list.Height = 0;
                   else
                       this._list.Height = Double.NaN;

                   this._list.Items.Refresh();
                   this._list.Padding = new Thickness(0);
                   this._list.UpdateLayout();
               }));
        }