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

Get Name/Titel od Pane out of loaded Usercontrol

1 Answer 5 Views
Docking
This is a migrated thread and some comments may be shown as answers.
ITA
Top achievements
Rank 1
ITA asked on 08 Feb 2013, 11:34 AM
Hi,

i need to get the name or titel from the pane where the Usercontrol is loaded. In The ElementLoaded-Event a add
a UserControl to the content of the pane.

On loading the Usercontrol i have to now the name or titel of the pane in which the control is loaded.

How do i do this?

thanks
best Regards
rene

1 Answer, 1 is accepted

Sort by
0
Vladi
Telerik team
answered on 13 Feb 2013, 11:28 AM
Hi Rene,

In order to get the RadPane in which your custom UserControl is placed all you need to do is in its Loaded event cast the sender as your custom UserControl and then access the RadPane from the Parent property of that UserControl.

The next code snippet shows how the Loaded event of your custom UserControl should look like:
private void MyUserControlLoaded(object sender, RoutedEventArgs e)
{
    var myUserControl = sender as MyUserControl;
    var pane = myUserControl.Parent as RadPane;
}

Hope this is helpful.

Regards,
Vladi
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Docking
Asked by
ITA
Top achievements
Rank 1
Answers by
Vladi
Telerik team
Share this question
or