Styling the DocumentHost borders

5 posts, 0 answers
  1. Ross
    Ross avatar
    1 posts
    Member since:
    Aug 2012

    Posted 25 Oct 2012 Link to this post

    I'm working on styling our RadDocking controls and I am having a lot of trouble finding where in the styles the border around the central items in the DocumentHost is set.  It's the last thing I need to style for this control and I need some help finding it.  What style does that border live in?
  2. Masha
    Admin
    Masha avatar
    355 posts

    Posted 29 Oct 2012 Link to this post

    Hi Ross,

    To remove the border around RadPaneGroup of DocumentHostTemplate you should to edit  the style of RadPaneGroup. In Visual Blend, select RadPaneGroup in Objects and Timeline, right-click it and choose from the menu Edit Template-> Edit A Copy. Find the following:

    <Setter Property="DocumentHostTemplate">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type telerik:RadPaneGroup}">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="*"/>
                    </Grid.RowDefinitions>
                    <ContentControl x:Name="ContentBackground" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Grid.Row="1">
                        <ContentControl.Style>
                            <Style TargetType="{x:Type ContentControl}">
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="{x:Type ContentControl}">
                                            <Border x:Name="Root" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" CornerRadius="0,2,2,2">
                                                <Border x:Name="BorderLayer3" BorderBrush="White" BorderThickness="2" CornerRadius="0,1,1,1">
                                                    <Border x:Name="BorderLayer2" BorderBrush="#FFF0F0F0" BorderThickness="2" CornerRadius="0">
                                                        <Border x:Name="BorderLayer1" BorderBrush="#FF848484" BorderThickness="1" CornerRadius="0">
                                                            <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}"/>
                                                        </Border>
                                                    </Border>
                                                </Border>
                                            </Border>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </ContentControl.Style>

    and set BorderThickness to 0 of elements which have x:Name BorderLayer3 and BorderLayer2

    Hope this helps.

    All the best,
    Maria
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. UI for WPF is Visual Studio 2017 Ready
  4. Philippe
    Philippe avatar
    8 posts
    Member since:
    Oct 2012

    Posted 13 Dec 2012 Link to this post

    Hi,

    I used this thread to remove borders between panes and the solution was right.
    Now I have to save / restore the layout and after the LoadLayout method, the borders are present, the style is ineffective.
    Can you tell me what should I do?

    Regards,
    Philippe
  5. Masha
    Admin
    Masha avatar
    355 posts

    Posted 17 Dec 2012 Link to this post

    Hello Ross,

    The preferred solution of styling RadDocking control, when the layout is loaded dynamically, is
    to use implicit styles. You need to merge the corresponding resource dictionaries to the App.xaml file and applied the corrections described below for DocumentHostTemplate.

    If you experience difficulties, please isolate the issue in a small runnable sample and I will do my best to help you.

    Regards,
    Maria
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  6. Philippe
    Philippe avatar
    8 posts
    Member since:
    Oct 2012

    Posted 18 Dec 2012 Link to this post

    Great.. It works !!

    Thanks
Back to Top
UI for WPF is Visual Studio 2017 Ready