My problem is that i want to destroy the Region when a RadPane is closed. Which is something the sample is not doing.
So, it brings us to this:
protected override void Adapt(IRegion region, RadPaneGroup regionTarget) |
At this stage, i would like to be able to get a reference to the RadDocking, to subscribe the Close event, and then do the destroy Region stuff.
But i can't figure out how to get the RadDocking from a RadPaneGroup. I tried several FindParent function, but none seems to be able to travel up the VisualTree to the RadDocking.
I am using the latest internal build.
Thank you for any help.
7 Answers, 1 is accepted
You could try the ParentOfType extension method. It is a generic method with no parameters. The type parameter is the type to look for up in the visual tree. You could do the following: regionTarget.ParentOfType<RadDocking>().
Hope this helps!
Miroslav Nedyalkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
I eventually did that. But i had problems doing so because at this stage, it returned null. I had to subscribe to the loaded event, and do the find parent there instead.
Were you able to fix the problem subscribing to the Loaded event and going up the visual tree while you find the Docking control?
Sincerely yours,Miroslav Nedyalkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
But there should be a cleaner way to do that. The RadPane should be able to return me the RadDocking before any loaded event. But i fear this restriction is be design.
We are unable to find the Docking control before the loaded event, because the pane itself doesn't belong to the Docking control. Once the loaded event happens, the pane is placed in the visual tree and is associated with a Docking control. Not cleaner, but approach could be to use lambda instead of a method for event handler. This way you will have access to all local variables including the parameters in the scope of the lambda.
Kind regards,Miroslav Nedyalkov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
I have the same issue. Can you share your updated Region Adapter code?
Thanks in advance,
Wagner