Unplanned
Last Updated: 03 Jan 2017 21:18 by ADMIN
UIElement (TextBlock, Rectangle) is set as a child of RadPanelBarItem in XAML. When changing themes in runtime either with StyleManager or with the Implict Styles mechanism an exception is thrown. 
The exception states "Element is already a child of another element."

Workaround:

Instead of the following xaml:
             
 <telerik:RadPanelBar telerik:StyleManager.Theme="Windows8" x:Name="pBar">
                <telerik:RadPanelBarItem Header="Item 1">                    

                            <TextBlock Text="Item 2"></TextBlock>

                </telerik:RadPanelBarItem>
            </telerik:RadPanelBar>

Use:
 <telerik:RadPanelBar telerik:StyleManager.Theme="Windows8" x:Name="pBar">
                <telerik:RadPanelBarItem Header="Item 1">                    
                    <telerik:RadPanelBarItem>
                        <telerik:RadPanelBarItem.Header>
                            <TextBlock Text="Item 2"></TextBlock>
                        </telerik:RadPanelBarItem.Header>
                    </telerik:RadPanelBarItem>   
                </telerik:RadPanelBarItem>
            </telerik:RadPanelBar>