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

Dependency Injection in Docking Manager

1 Answer 162 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Seth asked on 22 May 2012, 02:28 AM
How do I inject a RadSplitContainer to my main docking manager (telerik:RadDocking). Currently I'm doing the following.

I am using the ninject DI framework.

I have the following code in my main main window.

<telerik:RadDocking x:Name="mainDockingManager" Grid.Row="1" Grid.Column="0">
<telerik:RadDocumentPane>Stuff here</telerik:RadDocumentPane>

In the constructor I initialise the DI framework and inject the ILegend usercontrol into the docking manager.

kernel =
new StandardKernel(new AppModule());

The ILegend UserControl is just a wrapper around a <telerik:RadSplitContainer> i.e.:

<UserControl x:Class="Whiteboard.Plugin.UI.UnclassLegend"<br>
             xmlns:mc="" <br>
             mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="300"><br>
    <telerik:RadSplitContainer telerik:DockingPanel.InitialSize="170,500" InitialPosition="DockedLeft">

This method doesn't seem to be working, is it possible to inject different implementations of a RadSplitContainer containing different content?

1 Answer, 1 is accepted

Sort by
Miroslav Nedyalkov
Telerik team
answered on 29 May 2012, 04:31 PM
Hi Seth,

The problem is that you are wrapping the RadSplitContainer inside a UserControl and the Docking control expects to receive a RadSplitContainer directly. What I would suggest you is to use the SplitContainer as root element of the XAML file instead of the UserControl to change the code-behind file to make your class to inherit from RadSplitContainer instead of UserControl. Similar approach is described in this article about the RadWindow control.

Hope this information is helpful.

Kind regards,
Miroslav Nedyalkov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Asked by
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Share this question