- 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
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.
Iva
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
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
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.
Vesko
the Telerik team
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!
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.
Alex
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
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
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.
Iva
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>