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

RadPane If hidden calls ApplyTemplate of Control inside it multiple times.

1 Answer 63 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Nivid
Top achievements
Rank 2
Nivid asked on 14 Feb 2013, 10:53 PM
I have an issue where i have a custom control inside rad pane. If the rad pane is hidden and when it is set to true/visible. All the controls are reloaded and the apply template is called again. where it try's to apply template again and that i guess creates multiple instances and when a property of the control within the radpane changes The PropertyChangedCallback is called multiple times. 

What happens is the pane refreshes its datacontext when its isHidden Property is changed. 

I can explain it in sample code if needed. but its just a control inside a RadPane. 

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 15 Feb 2013, 01:27 PM
Hello Nivid,

I have tried to reproduce this issue in a sample project but without much success - OnApplyTemplate is fired only once - when the hidden pane is changed to visible. After that switching its visibility does not fire the event. 

As to the DataContextChanged event - it is expected to be fired as the pane is taken out of the VisualTree and then added again.  This can be observed even if you switch the Visibility property of the custom control without changing the pane.

Please check the attached project and tell us whether we are missing something. Thanks in advance.

Regards,
Yana
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Docking
Asked by
Nivid
Top achievements
Rank 2
Answers by
Yana
Telerik team
Share this question
or