Section, Block and Paragraph styles

5 posts, 0 answers
  1. Perlom
    Perlom avatar
    5 posts
    Member since:
    Nov 2012

    Posted 21 Feb 2013 Link to this post

    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
  2. Perlom
    Perlom avatar
    5 posts
    Member since:
    Nov 2012

    Posted 25 Feb 2013 Link to this post

    Any heads up in this regards would be highly appreciated :)
  3. UI for WPF is Visual Studio 2017 Ready
  4. Petya
    Admin
    Petya avatar
    975 posts

    Posted 26 Feb 2013 Link to this post

    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.

  5. Perlom
    Perlom avatar
    5 posts
    Member since:
    Nov 2012

    Posted 26 Feb 2013 Link to this post

    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).


  6. Petya
    Admin
    Petya avatar
    975 posts

    Posted 28 Feb 2013 Link to this post

    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.

Back to Top
UI for WPF is Visual Studio 2017 Ready