LoadLayout breaks the theme.

3 posts, 1 answers
  1. Inseok
    Inseok avatar
    12 posts
    Member since:
    Mar 2011

    Posted 22 Apr 2011 Link to this post

    Hi, I'm facing at strange behavior of LoadLayout feature.
    Please let me know, is the behavior by design or not.

    I created a solution to test LoadLayout feature. You can download it here:

    Here's the instruction to reproduce it.
    1) Open the solution, and add references for RadDocking.

    2) Run it. Just a Pane will show on the DocumentHost. (screenshot #01)

    3) Click 'SetTheme' button, then it style up the RadDocking with MyResources.xaml in the project. (screenshot #02)
    (If you click the 'Add a pane...' button, then you can see 'themed' new Pane on new SplitContainer.)

    4) Click 'LoadLayout1' button, it will perform LoadLayout with MyLayout1.xml in the project. (screenshot #03)
    Everything is fine. All panes are keeping the style which I 'themed'.

    5) Click 'LoadLayout2' button, then it will load MyLayout2.xml and the style of 'New Pane 1' Pane will be broken. (screenshot #04)

    The only difference between MyLayout1.xml and MyLayout2.xml is, a SerializationTag of RadPaneGroup which named "New Group 1" and "Changed Group ..." in the middle of the files.

    RadDocking arranges all the layout on the docking and if there's no such a item which matches the SerializationTag, then it creates new item for it. But at this time, RadDocking doesn't seem to use it's GeneratedItemsFactory (I tested it), and it just create 'empty-not-themed' item.
    As the result, the theme will be broken as I told above.

    An interesting thing is, if you click the 'LoadLayout2' button once again, then it fixes the theme and everything's okay again.
    Of course, now it has known SerializationTag, so that RadDocking doesn't make new item, I guess.

    I think;
    1) RadDocking should use it's GeneratedItemsFactory when it loads layout, so that I can have single way to customize generated item.
    2) RadDocking should keep the theme when it loads new element whether the item has known SerializationTag or not.

    Well, may be I can use ElementLoading event to set the theme manually. But I don't think it is necessary.

  2. Answer
    Miroslav Nedyalkov
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 27 Apr 2011 Link to this post

    Hello Inseok,

    Thank you for reporting us this problem.

    You are correct that there are some issues with theming and Save/Load layout and we will target them as we are planning to update the way the theming work. For now you could just remove the SerilizationgTag property from all elements you don't need to hold reference to, like SplitContainers and PaneGroups.

    I understand that in many cases you need to have references to the PangGroups, but you could just remove the SerializationTag from the SplitContainers - this should resolve the issue.

    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
  3. DevCraft banner
  4. Inseok
    Inseok avatar
    12 posts
    Member since:
    Mar 2011

    Posted 06 May 2011 Link to this post

    Hello Miroslav,
    I removed all SerializationTag from the SplitContainer in the layout XML as your advice, and it works fine.

    Thanks for the answer.
Back to Top