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

Dynamically add View Model RadPane to DocumentHost

3 Answers 217 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 27 Mar 2014, 09:58 PM
Hello,

I've got one or more File View Models, I open them through the command pattern and they land in a "Workspace" view model. It has a Files properties that is an observable collection. There is also the concept of Workspace opened documents and/or ActiveDocument, which should cause the corresponding pane to land in a default DocumentHost and/or activate.

Anyhow, as far as I can figure, I need to be inheriting from RadPane in order to cook up any document or tool windows. Which themselves either aggregate our custom UserControl or themselves have the XAML specified.

Is there a tutorial I can study along these lines?

Thank you.

Best regards.

3 Answers, 1 is accepted

Sort by
0
Michael
Top achievements
Rank 1
answered on 28 Mar 2014, 12:14 AM
At the moment, I have something similar to the following:

raddocking-how-to-add-buttons-to-the-pane-headers

Except in my XAML I just have the:

<telerik:RadDocking.DocumentHost x:Name="Host" />

No split containers or anything like that. I seem to be able to add a RadPane to the Host just fine, but no "Title", tab, or anything.

My suspicion is that I should be binding RadPane Title and not RadPane Header, to the DataContext itself, which has ToString() overridden. Better than that, I want to align a Horizontal StackPanel with an Image to the left if possible.

I've got a basic grasp of the binding mechanics. Much stronger grasp of underlying model, view model, INotifyPropertyChanged mechanisms.
0
Michael
Top achievements
Rank 1
answered on 28 Mar 2014, 12:19 AM
May have a glimmer of something to work with here. I deriving from RadPane. I wonder if that shouldn't be RadDocumentPane, which Header then would possibly bind (?) to my DataContext view model object?
0
Kalin
Telerik team
answered on 28 Mar 2014, 03:27 PM
Hi Michael,

The Panes have few different Templates which are applied depending on their state. That is why the Title template you have used is not applied when the Panes are in the DocumentHost. In order to add image there you will need to modify their DocumentHostTemplate as required. I have created a sample project which demonstrates the exact approach - if you are using a custom Panes you will just need to modify the TargetType of the Style (note that I have used Implicit Styles in order to easily apply the Template to all of the Panes.)

Hope this helps. Please let me know if you have further questions.

Regards,
Kalin
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
Michael
Top achievements
Rank 1
Answers by
Michael
Top achievements
Rank 1
Kalin
Telerik team
Share this question
or