6 Answers, 1 is accepted
Thank you for contacting us.
Currently there are two ways of injecting views into the RadDocking control
- inject the RadPanes into a RadPaneGroup (the RadPane is defined as a view in a separate xap)
- inject a UserControl into a RadPane (in this case, you need to define all the RadPanes in the xaml at initial start up)
We don't support placing a RadDocking into another RadDocking control because of some restrictions by design. You could set RadDocking.AllowUnsafeMode property to True, but this could lead to an unexpected behavior and we don't support it.
All the best,
George
the Telerik team
I'm doing something similar with a project and tried to apply your suggestion (#1) but ran into a minor problem. I setup a user control / View(separate XAP) and attempted to inject that into the RadPaneGroup but it errors out.
Should I set the RadPanes (in my new view) in a <Grid> or some parent container first?
Please let me know and thanks!
~ Dave
I managed to get it done the following way:
PARENT CONTAINER (separate View) :
// some other code.
<telerikDocking:RadDocking.DocumentHost>
<telerikDocking:RadSplitContainer Width="Auto"
Visibility="Visible">
<telerikDocking:RadPaneGroup x:Name="MainContent">
</telerikDocking:RadPaneGroup>
</telerikDocking:RadSplitContainer>
</telerikDocking:RadDocking.DocumentHost>
</telerik:RadDocking>
CHILD CONTAINER (separate View) :
<telerik:RadPane
Tag="AudioRadPane"
// namespaces, ...
Header="todo AudioParent">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<telerik:RadSplitContainer Grid.Row="1">
<!-- Current Track -->
<telerik:RadPaneGroup telerik:ProportionalStackPanel.RelativeSize="30, 300">
<telerik:RadPane Header="todo current track">
</telerik:RadPane>
</telerik:RadPaneGroup>
<!-- Current Playlist -->
<telerik:RadPaneGroup telerik:ProportionalStackPanel.RelativeSize="20, 300">
<telerik:RadPane Header="todo current playlist">
</telerik:RadPane>
</telerik:RadPaneGroup>
<!-- Recently Played Tracks & Indicators -->
<telerik:RadSplitContainer Orientation="Vertical"
telerik:ProportionalStackPanel.RelativeSize="20, 300">
<telerik:RadPaneGroup>
<telerik:RadPane Header="todo recent tracks">
</telerik:RadPane>
</telerik:RadPaneGroup>
<telerik:RadPaneGroup>
<telerik:RadPane Header="todo indicators">
</telerik:RadPane>
</telerik:RadPaneGroup>
</telerik:RadSplitContainer>
<!-- Volume Indicators -->
<telerik:RadPaneGroup telerik:ProportionalStackPanel.RelativeSize="10, 300">
<telerik:RadPane Header="todo volume">
</telerik:RadPane>
</telerik:RadPaneGroup>
</telerik:RadSplitContainer>
<telerik:RadSplitContainer Grid.Row="2">
<telerik:RadPaneGroup telerik:ProportionalStackPanel.RelativeSize="40, 100">
<Playlist:PlaylistView></Playlist:PlaylistView>
</telerik:RadPaneGroup>
<telerik:RadPaneGroup telerik:ProportionalStackPanel.RelativeSize="60, 100">
<telerik:RadPane Header="todo tracks" />
</telerik:RadPaneGroup>
</telerik:RadSplitContainer>
</Grid>
PlaylistView itself is a separate view:
<telerik:RadPane
x:Class="PlaylistView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
// rest of the code
I hope this helps!
Peter.
Hello,
Thank you for the quick response. I'll give your suggestion a try...
I have another quick question specific to MEF. Does it matter what type of object I export? Should it be a "class" or should it be an "interface"?
Here (below) is how I've setup my .cs file to export;
**********************************************************
using System.ComponentModel.Composition;
using System.Windows.Controls;
namespace bcRMS.Samples.Incident
{
[PartCreationPolicy(CreationPolicy.NonShared)]
[Export(typeof(UserControl))]
public partial class IncidentView : UserControl
{
public IncidentView()
{
InitializeComponent();
}
}
}
**********************************************************
Please let me know if you see anything I should change.
Many thanks in advance,
~ Dave
I'm far from being a MEF specialist. Aside from that, I don't see anything wrong with your code. I'm usually not exporting a generic Usercontrol object, but rather a strong type ("IncidentView" in your case). The code importing your object will need, at some point, "IncidentView" I suppose?
I started learning MEF using this blog posts: http://blogs.msdn.com/b/gblock/archive/2009/11/30/building-the-hello-mef-dashboard-in-silverlight-4-part-i.aspx. But, I have to admit, in a "real life application" things can become quite difficult. I'm facing a steep learning curve myself.
Succes on your project,
Peter.
Thanks once again for your feedback. The link you sent was one that I also reviewed - good stuff. I actually got the samples working but since my application was started with the business template I thought I should look for a different example. I finally found one that was based on the navigation template... which is pretty close, so I switched over.
Anyway, I was able to get my user control to load into the main page via MEF however the results were not as I expected. It seems that some of the telerik controls render differently when injected into a application so I'm going to research my new problem and perhaps start a new thread that refers specifically to the sizing of the user controls and the "height, width" properties being set to "infinity".
Just in case, if anyone wants to see my updated code I can certainly post it here. It's nothing revolutionary but it does seem to work for the moment.
Thanks again!
~ Dave