This is a migrated thread and some comments may be shown as answers.

Changes in Q2 2011 SP1 - missing methods

7 Answers 60 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Fredrik Kvaal
Top achievements
Rank 1
Fredrik Kvaal asked on 26 Sep 2011, 07:49 PM
Just tried out your latest release (controls Q2 2011 SP1) - and quickly found out that you have made some changes in some of the document element types in the richtextbox:

- Telerik.Windows.Documents.Model.Paragraph no longer inherits from DependencyObject. We are using the SetValue and GetValue methods on DependencyObject for setting and getting values using attached properties on Paragraphs

- Telerik.Windows.Documents.Layout.LayoutBox does no longer have any GetUIElement() - we use this to get hold of the actual TextBlocks rendering the text in the editor

Is this correct? And if so - is there any replacement/alternative or recommended ways of achieving the same?

Thank you!

7 Answers, 1 is accepted

Sort by
0
Iva Toteva
Telerik team
answered on 29 Sep 2011, 05:45 PM
Hello Fredrik Kvaal,

We have changed the fact that all document elements we dependency objects as a first step to allowing off-thread import and export of the document.
Could you share some more details on your implementation, such as what properties you are attaching to Paragraphs and why you need to get hold of the underlying TextBlocks. In the current version we have also changed the logic behind the layout of the document in order to reduce the number of UIElements used, which will probably conflict with your implementation, too.

Best wishes,
Iva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Fredrik Kvaal
Top achievements
Rank 1
answered on 11 Oct 2011, 09:22 AM
I needed to mark pieces of the text and visualize this in a special way. However, I have found that Comments and Bookmarks most likely will fulfill my needs. 

But then I have one related question: Is there any way to customize the appearance of comments? I've found the CommentBalloon, CommentsPane and thus can apply a default style to these, but this doesn't cover all. I'd e.g. like to change the background/fill color of the comment markings in the text.

Thank you!

Fredrik
0
Vesko
Telerik team
answered on 14 Oct 2011, 09:54 AM
Hi Fredrik Kvaal,

 You can use the CommentShowing event of RadRichTextBox. In it you can access the CommentAppearanceSettings (BackgroundBrush, BorderBrush) trough the event args. You can also check for which Comment the event is fired (again trough the event args). This give you the ability for example to have different colors for different Authors.

Let mi know if this helps.

Greetings,
Vesko
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Fredrik Kvaal
Top achievements
Rank 1
answered on 14 Oct 2011, 10:21 AM
Thanx for your reply - but I can't get it to work;
I hook up to the event and change the brushes but nothing happens (still red).
I can break in the event handler - so I'm sure the event is fired and handled.
This is my handler:
private void RichTextEditor_CommentShowing(object sender, CommentShowingEventArgs e)
{
    SolidColorBrush backgroundBrush = new SolidColorBrush(Color.FromArgb(255, 50, 150, 200));
    e.AppearanceSettings.BackgroundBrush = backgroundBrush;
    e.AppearanceSettings.BorderBrush = backgroundBrush;
}

And I also have a related question: When I load a RadDocument including comments (with e.g. the Xaml format provider) - this event is not fired. So if we get this to work (using the CommentShowing event), it will not help help with changing the appearance of existing comments after loading a document.

Thankx again!
0
Alex
Telerik team
answered on 14 Oct 2011, 12:36 PM
Hi Fredrik Kvaal,

Unfortunately we weren't able to reproduce your problem. I've attached a sample project of how we tested.

Just a few clarifications about the CommentShowing event. This event is fired only once per comment - when the comment is showing for the first time (ShowComments property of the RadRichtextBox should be set to true for this to happen). So you should make sure to attach to the event before showing the document for the first time, otherwise you will miss it and there is no way to handle it later. 

About the case when you handled the event, but the visualization didn't change as desired - we will appreciate if you could  isolate the issue in a sample project and send it to us, so we can investigate.

Kind regards,
Alex
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Fredrik Kvaal
Top achievements
Rank 1
answered on 14 Oct 2011, 01:43 PM
Hi, and thanks for the quick reply!

I have tried your solution and I see that it works - except for the background of the actual text that's commented. That's still red. Is it possible to change this background color/brush? (see attached image)

Thanks for quick and splendid support!

Fredrik
0
Iva Toteva
Telerik team
answered on 14 Oct 2011, 05:19 PM
Hi Fredrik,

Thank you for the follow-up on this issue.
Unfortunately, at this point it will not be possible to customize the background of the text that is being commented on. We have logged this task for revision and will revise the current implementation in order to enable it in the future.

All the best,
Iva
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
RichTextBox
Asked by
Fredrik Kvaal
Top achievements
Rank 1
Answers by
Iva Toteva
Telerik team
Fredrik Kvaal
Top achievements
Rank 1
Vesko
Telerik team
Alex
Telerik team
Share this question
or