How to programmatically create RadDocking objects

11 posts, 0 answers
  1. Cat Bui
    Cat Bui avatar
    1 posts
    Member since:
    May 2006

    Posted 04 Oct 2010 Link to this post

    Hello,

    I'm having problems trying to create panes, pane groups and split containers programmatically.
    Is there some code sample that can show me how to programmatically add those objects?
    I'm trying to dock some control to the left side and a couple documents.
    It's very weird for example the property HasDocumentHost returns true event when DocumentHost property is null.

    Could you help me on this?
    Thanks in advance.
  2. George
    Admin
    George avatar
    1332 posts

    Posted 07 Oct 2010 Link to this post

    Hello,

    Attached you can find the sample I made for you. It generates RadPanes, RadPaneGroups and RadSplitContainers using the code. I hope it suits your needs. 

    Could you please give us some more information about the scenario when you have HasDocumentHost = True and DocumentHost = null at same time. 

    I will be glad to assist you further.

    Best wishes,
    George
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. UI for WPF is Visual Studio 2017 Ready
  4. Michael
    Michael avatar
    23 posts
    Member since:
    Mar 2014

    Posted 27 Mar 2014 in reply to George Link to this post

    Hello,

    It's been a couple of years since this one, but it is an interesting example. Thank you for that.

    Question, cooking up an engaging app, I want to "open files" and have them land in, presumable, a RadPane-hosted custom-UserControl. Content TBD, wired in with our "FileViewModel".

    This is an easy-ish thing to do through the Telerik framework?

    Thank ye...

    Best regards.
  5. George
    Admin
    George avatar
    1332 posts

    Posted 28 Mar 2014 Link to this post

    Hi Michael,

    This is an old example indeed. Please, refer to the following new blog post which describes how to use RadDocking in MVVM scenario and build an IDE-like example - http://blogs.telerik.com/xamlteam/posts/13-12-09/building-ide-with-raddocking-for-wpf-silverlight

    Hope this information will help.

    Regards,
    George
    Telerik
     

    Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

     
  6. Michael
    Michael avatar
    23 posts
    Member since:
    Mar 2014

    Posted 28 Mar 2014 in reply to George Link to this post

    I'd like to clone through Git but it is blocked on port 22. Working on that.

    Using HTTPS in the meantime, I get the following:

    username@MACHINE/c/Source/Telerik
    $ git clone https://github.com/telerik/xaml-sdk.git
    Cloning into 'xaml-sdk'...
    fatal: unable to access 'https://github.com/telerik/xaml-sdk.git/': SSL certificate problem: unable to get local issuer certificate
  7. Michael
    Michael avatar
    23 posts
    Member since:
    Mar 2014

    Posted 28 Mar 2014 in reply to George Link to this post

    I'd like to clone through Git but it is blocked on port 22. Working on that.

    Using HTTPS in the meantime, I get the following:

    username@MACHINE/c/Source/Telerik
    $ git clone https://github.com/telerik/xaml-sdk.git
    Cloning into 'xaml-sdk'...
    fatal: unable to access 'https://github.com/telerik/xaml-sdk.git/': SSL certificate problem: unable to get local issuer certificate
  8. Michael
    Michael avatar
    23 posts
    Member since:
    Mar 2014

    Posted 28 Mar 2014 in reply to George Link to this post

    Hello George,

    I did download the examples and searched, but I did not see anything like binding to a Header.

    In our scenario, I'd like to bind the Header to our view model object (INPC). All of the examples I saw had to do with setting to a static text.

    So when we set the pane's DataContext to our view model, our view model should report itself through ToString (?). However, this is not happening (plausibly, using either RadPane or RadDocumentPane base classes), or I do not have the WPF plumbing quite right (entirely possible).

    A pane gets added dynamically to the underlying DocumentHost well enough. But with no Header or Title tab appearing. Any additional attempts to add them do not, plausibly because the Header or Title of the pane is null, in spite of the binding I think I have.

    i.e. Header="{Binding}"

    then,

    pane.DataContext = viewModel;
    //pane.Header ==  null

    Any ideas? Are we doing this wrong? Or what's the better way?

    Thank you.

    Best regards.
  9. Michael
    Michael avatar
    23 posts
    Member since:
    Mar 2014

    Posted 28 Mar 2014 in reply to Michael Link to this post

    This is my guess, but, it appears using DocumentHost is insufficient. That's for the document itself (?). Whereas, perhaps we need to add the panes to something like the pane group? within a split container? This is where it gets a bit mystical for me, for the moment.
  10. Michael
    Michael avatar
    23 posts
    Member since:
    Mar 2014

    Posted 28 Mar 2014 in reply to Michael Link to this post

    It does appear to be Title we want. And I can bind to {Binding Title}. Fine so far.

    This seems to be a known issue, however: when we float the window then re-dock it, the title vanishes.

    I don't know if possibly there is an event or something we can intercept to ensure that the Title is intact?
  11. Michael
    Michael avatar
    23 posts
    Member since:
    Mar 2014

    Posted 28 Mar 2014 in reply to Michael Link to this post

    Seems to be docking in the middle of the compass that's the issue. If I dock top, left, right, bottom, the title remains intact.
  12. George
    Admin
    George avatar
    1332 posts

    Posted 01 Apr 2014 Link to this post

    Hi Michael,


    There should be some misunderstanding - in the VisualStudioDocking example the pane's headers are bound. Please, refer to the App.xaml file, line and search for pane style (line 64):
    <Style TargetType="telerik:RadPane" BasedOn="{StaticResource RadPaneStyle}">
        <Setter Property="CanDockInDocumentHost" Value="False" />
        <Setter Property="Header" Value="{Binding Header}" />
        <Setter Property="IsHidden" Value="{Binding IsHidden, Mode=TwoWay}" />
        <Setter  Property="IsActive" Value="{Binding IsActive, Mode=TwoWay}" />
    </Style>
     
    <Style TargetType="telerik:RadDocumentPane" BasedOn="{StaticResource RadPaneStyle}">
        <Setter Property="Header" Value="{Binding Header}" />
        <Setter Property="IsHidden" Value="{Binding IsHidden, Mode=TwoWay}" />
        <Setter Property="IsActive" Value="{Binding IsActive, Mode=TwoWay}" />
    </Style>

    Setting pane's header is good enough to apply the Title, because they are internally bound one for other. Anyway, if you want to use Title instead of Header, you could bind it as well using the same style.

    Let me know if this helps.

    Regards,
    George
    Telerik
     

    Build cross-platform mobile apps using Visual Studio and .NET. Register for the online webinar on 03/27/2014, 11:00AM US ET.. Seats are limited.

     
Back to Top
UI for WPF is Visual Studio 2017 Ready