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

Theme getting Broken

1 Answer 67 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Tyler
Top achievements
Rank 1
Tyler asked on 13 Sep 2012, 03:53 PM
I'm working on a project in which I am trying to make all the windows dockable. I have had success doing this but am having one small problem. I have the theme set at Expression_Dark for everything and when I undock one of the windows everything is fine, but when I dock it back anywhere on the screen the theme is broken on that specific pane and the color changes back to default. How can I fix this problem and reset the theme. I was going to invoke the panestatechange event and reset the theme from there but cant figure out the correct code to put within the event. My code for the xaml is posted below...any help would be appreciated. Thanks.
<ui:UserControlBase x:Class="CommandAlkon.COMMANDtrack.UserInterface.Controls.Dashboard"
    xmlns:ui="clr-namespace:CommandAlkon.COMMANDtrack.UserInterface.Bases"
    Background="Transparent"
    xmlns:parts="clr-namespace:CommandAlkon.COMMANDtrack.UserInterface.Controls.DashboardParts">
  
    <Grid>
        <telerik:RadDocking  BorderThickness="0" Padding="0" IsRestricted="True" RestrictedAreaMargin="100,100,100,100" telerik:StyleManager.Theme="Expression_Dark" >
  
            <telerik:RadSplitContainer Orientation="Vertical" InitialPosition="DockedLeft">
                <telerik:RadPaneGroup telerik:StyleManager.Theme="Expression_Dark">
                    <telerik:RadPane Header="Regions" CanUserClose="False" CanDockInDocumentHost="True">
                        <telerik:RadPane.Content>
                            <Border x:Name="BorderMainRegion" Grid.Row="1" CornerRadius="0,0,10,10" BorderThickness="0,1,0,0" Margin="2" >
                            <ListBox x:Name="RegionsListBox" />
                            </Border>
                        </telerik:RadPane.Content>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
                <telerik:RadPaneGroup telerik:StyleManager.Theme="Expression_Dark">
                    <telerik:RadPane Header="Plants" CanUserClose="False" >
                        <telerik:RadPane.Content>
                            <Border x:Name="BorderMainPlant" Grid.Row="1" CornerRadius="0,0,10,10"  BorderThickness="0,1,0,0" Margin="2" >
                            <ListBox x:Name="PlantsListBox" />
                            </Border>
                        </telerik:RadPane.Content>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
  
            <telerik:RadSplitContainer Orientation="Horizontal" InitialPosition="DockedTop" Height="300" telerik:StyleManager.Theme ="Expression_Dark">
                <telerik:RadPaneGroup telerik:StyleManager.Theme="Expression_Dark">
                    <telerik:RadPane Name="PlantChartPane" Header="Plant" CanUserClose="False" >
                        <telerik:RadPane.Content>
                            <Border x:Name="BorderPlantChart" Grid.Row="1" CornerRadius="0,0,10,10" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,1,0,0" Padding="2,0,2,3"/>
                        </telerik:RadPane.Content>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
                <telerik:RadPaneGroup telerik:StyleManager.Theme="Expression_Dark">
                    <telerik:RadPane Header="Schedule" CanUserClose="False">
                        <telerik:RadPane.Content>
                            <Border x:Name="BorderMainGrid" Grid.Row="1" CornerRadius="0,0,10,10" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="0,1,0,0">
                            <ui:SchedulingControl x:Name="ScheduleLateness" IsScheduleLatenessControl="True"  />
                            </Border>
                        </telerik:RadPane.Content>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
                <telerik:RadPaneGroup telerik:StyleManager.Theme="Expression_Dark">
                    <telerik:RadPane Name="TrucksChartPane" Header="Trucks" CanUserClose="False" />
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
  
            <telerik:RadSplitContainer Orientation="Horizontal" InitialPosition="DockedBottom" Height="150" >
                <telerik:RadPaneGroup telerik:StyleManager.Theme="Expression_Dark">
                    <telerik:RadPane Name="ExceptionsPane" Header="Exceptions" CanUserClose="False" >
                        <telerik:RadPane.Content>
                            <parts:Exceptions Grid.Column="0"/>
                        </telerik:RadPane.Content>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
                <telerik:RadPaneGroup telerik:StyleManager.Theme="Expression_Dark" >
                    <telerik:RadPane Header="Suggestions" CanUserClose="False" >
                        <telerik:RadPane.Content>
                            <parts:Suggestions Grid.Column="0" />
                        </telerik:RadPane.Content>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
  
            <telerik:RadSplitContainer InitialPosition="DockedRight" Width="700">
                <telerik:RadPaneGroup telerik:StyleManager.Theme="Expression_Dark" >
                    <telerik:RadPane Header="Loads" CanUserClose="False">
                        <telerik:RadPane.Content>
                            <parts:Loads Grid.Column="0" />
                        </telerik:RadPane.Content>
                    </telerik:RadPane>
                </telerik:RadPaneGroup>
            </telerik:RadSplitContainer>
              
        </telerik:RadDocking>
    </Grid>
</ui:UserControlBase>

1 Answer, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 18 Sep 2012, 07:46 AM
Hello Tyler,

It seems like this is happening because when you undock a Pane a new ToolWindow is generated and the content of the Pane is put as a content of the ToolWindow. So the new generated ToolWindow does not have any theme set and therefore it gets its default theme.
What you can do is use implicit styles to set the theme as shown in this help article or just use an AplicationTheme:
public MainWindow()
  {
     StyleManager.ApplicationTheme = new Expression_DarkTheme();
     InitializeComponent();
  }

It would be great if you can give it a try and let us know if this works for you.

All the best,
Georgi
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

Tags
Docking
Asked by
Tyler
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Share this question
or