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

Section, Block and Paragraph styles

4 Answers 180 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Perlom
Top achievements
Rank 1
Perlom asked on 21 Feb 2013, 04:06 PM
Hi,

I wonder if it is possible to extend the Section, Block and Paragraph objects, and wither they have any visual representation to them?

We are trying to create an editor using the RadRichTextbox, where the user should add one or more section (similar to the container concept in WPF) to the document, and then then add blocks within each section, and then they add text, images, inline controls...etc. to each block. After that, we want to enable the user to re-order those sections or the blocks within each section. So ideally, when a mouse over a section, the whole section border will be visible, to show the section boundaries. When the user right clicks, a context menu will show up to allow moving the section up/down. Same functionality should be there for blocks.

Can we use the section object “Telerik.Windows.Documents.Model.Section” to achieve this functionality? We are inspiring our specific purpose editor from this hierarchy

http://www.telerik.com/help/wpf/radrichtextbox-features-document-elements-hierarchy.html

and would like to reuse those object! Any advice?

Cheers

4 Answers, 1 is accepted

Sort by
0
Perlom
Top achievements
Rank 1
answered on 25 Feb 2013, 06:33 PM
Any heads up in this regards would be highly appreciated :)
0
Petya
Telerik team
answered on 26 Feb 2013, 10:01 AM
Hello,

Thank you for contacting us!

The Section, Block and Paragraph elements are part of RadDocument's structure that is built as a flow document. The hierarchy you found in our documentation is indeed placed there as a reference when building a document from code. Extending it is possible, but I don’t think it is necessary in your scenario, as the operations you have listed could be achieved with the document elements as they are.

Generally speaking, RadDocument exposes its Sections through a property (RadDocument.Sections), each Section – its Blocks (Section.Blocks), a Paragraph – Paragraph.Inlines, etc. You could use these collections to determine what to select and then implement cut/paste functionality of the Selection

When it comes to providing a UI for that, you can try implementing UI layers such as the TableMovementUILayer. Most visual representations in the control's code are built in that way. I suggest you refer to this article for more information.

I hope this helps! 
 
Regards,
Petya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Perlom
Top achievements
Rank 1
answered on 26 Feb 2013, 06:52 PM

Hi, thanks for the reply, but I guess you forgot to add the link to article talking about TableMovementUILayer.

 

I searched for TableMovementUILayer topic, and I couldn’t figure out how it is going to help me.  Is any sample code I could follow?  The requirement is to show a border that surrounds the content of a specific section when hovering the mouse over the section (no need necessary to highlight/select the content of the section).


0
Petya
Telerik team
answered on 28 Feb 2013, 09:48 AM
Hi,

I am terribly sorry for missing to post the relevant links.

I pointed to the TableMovementUILayer as it seems the closest to your scenario. If you wish to see the implementation, you can do so by downloading the source code of RadControls for WPF. The file is located at  .\Documents\Core\UI\Layers\TableDecorationLayers\TableMovement\TableMovementUILayer.cs .

As for general guidance on UI layers, I suggest you take a look at this help article, this online demo, as well as at this example in our brand new SDK at GitHub.

Let us know if you have other questions.
 
Kind regards,
Petya
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
RichTextBox
Asked by
Perlom
Top achievements
Rank 1
Answers by
Perlom
Top achievements
Rank 1
Petya
Telerik team
Share this question
or