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

2 posts, 0 answers
  1. Nivid
    Nivid  avatar
    14 posts
    Member since:
    Jun 2012

    Posted 14 Feb 2013 Link to this post

    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. 

  2. Yana
    Yana avatar
    4603 posts

    Posted 15 Feb 2013 Link to this post

    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.

    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top