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

MVVM RadDocumentPane defined in external xaml don't show Header

4 Answers 87 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Giorgio
Top achievements
Rank 1
Giorgio asked on 25 Aug 2016, 10:22 AM

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

 

4 Answers, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 29 Aug 2016, 07:49 AM
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.
0
Giorgio
Top achievements
Rank 1
answered on 29 Aug 2016, 12:24 PM

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

0
Giorgio
Top achievements
Rank 1
answered on 23 Mar 2017, 09:46 AM

I tried to change the theme from Summer to Office2016 and strangely I can't see the TestView content in design mode. Running the application all works fine also with the new theme.

This is what I've done:

1. Added the reference to the file Telerik.Windows.Themes.Office2016.dll

2. Changed all Summer to Office2016 in the MergedDictionaries in the file App.xaml

Application x:Class="Test.App" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" StartupUri="Views\MainWindow.xaml">
  <Application.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="/Telerik.Windows.Themes.Office2016;component/Themes/System.Windows.xaml" />
        <ResourceDictionary Source="/Telerik.Windows.Themes.Office2016;component/Themes/Telerik.Windows.Controls.xaml" />
        <ResourceDictionary Source="/Telerik.Windows.Themes.Office2016;component/Themes/Telerik.Windows.Controls.Input.xaml" />
        <ResourceDictionary Source="/Telerik.Windows.Themes.Office2016;component/Themes/Telerik.Windows.Controls.Navigation.xaml" />
          <ResourceDictionary Source="/Telerik.Windows.Themes.Office2016;component/Themes/Telerik.Windows.Controls.Docking.xaml" />
          <ResourceDictionary Source="/Telerik.Windows.Themes.Office2016;component/Themes/Telerik.Windows.Controls.GanttView.xaml" />
          <ResourceDictionary Source="/Telerik.Windows.Themes.Office2016;component/Themes/Telerik.Windows.Controls.GridView.xaml" />
          <ResourceDictionary Source="/Telerik.Windows.Themes.Office2016;component/Themes/Telerik.Windows.Controls.FixedDocumentViewers.xaml" />
          <ResourceDictionary Source="/Telerik.Windows.Themes.Office2016;component/Themes/Telerik.Windows.Controls.Chart.xaml" />
          <ResourceDictionary Source="/Telerik.Windows.Themes.Office2016;component/Themes/Telerik.Windows.Controls.FixedDocumentViewersUI.xaml" />
      </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
  </Application.Resources>
</Application>

 

What did I do wrong?

Thanks in advance

0
Kalin
Telerik team
answered on 28 Mar 2017, 09:24 AM
Hi Giorgio,

Thanks for getting back to us.

Indeed there is an issue with the newer themes and the Pane is not visible in the designer. I logged that in our Feedback portal you can track its status on the following link:
https://feedback.telerik.com/Project/143/Feedback/Details/214413-docking-standalone-radpane-is-not-visible-in-vs-designer-in-the-latest-themes

I have also updated your Telerik points for your involvement. Will add project with workaround in the Feedback item later today, so stay tuned.

Regards,
Kalin
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Docking
Asked by
Giorgio
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Giorgio
Top achievements
Rank 1
Share this question
or