MVVM RadDocumentPane defined in external xaml don't show Header

3 posts, 0 answers
  1. Giorgio
    Giorgio avatar
    2 posts
    Member since:
    Aug 2016

    Posted 25 Aug Link to this post

    I would to use the RagDocking control as container of the views of my application as described in you documentation at the page 

    http://docs.telerik.com/devtools/wpf/controls/raddocking/features/panes/panesource.html .

    In my main windows xaml file I added the following lines:

    <telerik:RadDocking PanesSource="{Binding Views}">
        <telerik:RadDocking.DockingPanesFactory>
          <telerik:DockingPanesFactory/>
        </telerik:RadDocking.DockingPanesFactory>
    </telerik:RadDocking>

    In my mainViewModel I added this code to add a new view using this code all works fine:

    RadDocumentPane view = new RadDocumentPane()  { Header = "Customer" };
    _views.Add(view);
    RaisePropertyChanged(() => Views);
     

     

    Now, I would to define the vews of my application in separated xaml files. I added a new UserControl to my project named view1 and I changed the view1.xaml file in this way

    <telerik:RadDocumentPane x:Class="MyApp.Views.TestView"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                 xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                 mc:Ignorable="d"
                 d:DesignHeight="300" d:DesignWidth="300" Header="Test">
        <Grid>
            <TextBlock>Test</TextBlock
        </Grid>
    </telerik:RadDocumentPane>

    and the view1.cs file in this way

    namespace MyApp.Views
    {
        public partial class TestView : RadDocumentPane
        {
            public TestView()
            {
                InitializeComponent();
            }
        }
    }

    Then I changed the code to add a new in this way:

    //RadDocumentPane view = new RadDocumentPane() { Header = "Customer" };
    TestView view = new TestView();
    _views.Add(view);
    RaisePropertyChanged(() => Views);

    With this changes, the new pane is added to the docking view but unfortunately without the header tab.

    Is it possible to define de panes in separated xaml file as I done? Or have I to use the RadDocumentPane class and place my view in the Content property of the RadDocumentPane?

    Thanks in advance

     

  2. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 29 Aug Link to this post

    Hi Giorgio,

    Thank you for contacting us.

    Are you using Implicit Styling in order to apply the desired theme? If so when inheriting from one of our controls you would need manually apply the default style of the control to the inherited one. For example you do this in the TextView.xaml as shown below:

    <telerik:RadDocumentPane x:Class="MyApp.Views.TestView"
                 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                 xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                 xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                 mc:Ignorable="d"
                   Style="{DynamicResource RadPaneStyle}"
                 d:DesignHeight="300" d:DesignWidth="300" Header="Test">
        <Grid>
            <TextBlock>Test</TextBlock>
        </Grid>
    </telerik:RadDocumentPane>

    However if this is not the case I would like to ask to share a sample project demonstrating the issue so we can check it on our side.

    I'm looking forward to hearing from you.

    Regards,
    Kalin
    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Giorgio
    Giorgio avatar
    2 posts
    Member since:
    Aug 2016

    Posted 29 Aug in reply to Kalin Link to this post

    Hi Kalin,

    adding the directive "Style="{DynamicResource RadPaneStyle}"" the tab header is correctly showed as you asserted.

    Thanks for your help.
    Best regards,

    Giorgio Todeschini

Back to Top