Dynamically add View Model RadPane to DocumentHost

4 posts, 0 answers
  1. Michael
    Michael avatar
    23 posts
    Member since:
    Mar 2014

    Posted 27 Mar 2014 Link to this post

    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.
  2. Michael
    Michael avatar
    23 posts
    Member since:
    Mar 2014

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

    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.
  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 Michael Link to this post

    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?
  5. Kalin
    Admin
    Kalin avatar
    1209 posts

    Posted 28 Mar 2014 Link to this post

    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.

     
Back to Top