Unplanned
Last Updated: 03 Jan 2017 21:18 by ADMIN
ADMIN
Martin Ivanov
Created on: 16 Jan 2014 17:26
Category: PanelBar
Type: Bug Report
0
PanelBar: Exception when changing themes in runtime and UIElement is direct child of RadPanelBarItem
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>
0 comments