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

How to programmatically create RadDocking objects

10 Answers 221 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Cat Bui
Top achievements
Rank 1
Cat Bui asked on 04 Oct 2010, 11:54 PM
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.

10 Answers, 1 is accepted

Sort by
0
George
Telerik team
answered on 07 Oct 2010, 03:47 PM
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
0
Michael
Top achievements
Rank 1
answered on 27 Mar 2014, 09:35 PM
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.
0
George
Telerik team
answered on 28 Mar 2014, 09:47 AM
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.

 
0
Michael
Top achievements
Rank 1
answered on 28 Mar 2014, 02:09 PM
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
0
Michael
Top achievements
Rank 1
answered on 28 Mar 2014, 02:09 PM
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
0
Michael
Top achievements
Rank 1
answered on 28 Mar 2014, 02:52 PM
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.
0
Michael
Top achievements
Rank 1
answered on 28 Mar 2014, 02:55 PM
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.
0
Michael
Top achievements
Rank 1
answered on 28 Mar 2014, 03:10 PM
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?
0
Michael
Top achievements
Rank 1
answered on 28 Mar 2014, 03:14 PM
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.
0
George
Telerik team
answered on 01 Apr 2014, 06:48 AM
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.

 
Tags
Docking
Asked by
Cat Bui
Top achievements
Rank 1
Answers by
George
Telerik team
Michael
Top achievements
Rank 1
Share this question
or