Totally remove shadow on book control

3 posts, 0 answers
  1. first100
    first100 avatar
    4 posts
    Member since:
    Sep 2013

    Posted 30 Sep 2013 Link to this post

    Hy,

    I would to totally remove shadow on the book in the middle of the page,
    I've read that it is not easy to edit this shadow but I would like to know if i can totally eliminate.

    Many thanks
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1183 posts

    Posted 03 Oct 2013 Link to this post

    Hello,

    With the current implementation of the RadBook control you are not allowed to remove the shadows. By "remove" I mean to completely delete them. This is because the Border elements, representing the shadows, are configured through code. This is why those borders must be defined in the template of the RadBookItems.

    However, you can hide those Borders - instead deleting them. You can set their Background property to Transparent. By doing so they still be there, but users will not see them.

    For your convenience I extracted and edited the default template of the RadBookItem control.

    <Style TargetType="telerik:RadBookItem">
        <Setter Property="Background" Value="White" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="VerticalContentAlignment" Value="Stretch" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="telerik:RadBookItem">
                    <Grid x:Name="LayoutRoot">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="0.15*" />
                            <ColumnDefinition Width="0.7*" />
                            <ColumnDefinition Width="0.15*" />
                        </Grid.ColumnDefinitions>
                        <Border BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}" Grid.ColumnSpan="3" />
                        <ContentPresenter Grid.ColumnSpan="3"
                                ContentTemplate="{TemplateBinding ContentTemplate}"
                                Content="{TemplateBinding Content}"
                                HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                Margin="{TemplateBinding BorderThickness}"
                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                        <Border x:Name="RightBackPageShadow"
                                Background="Transparent" Grid.Column="2"
                                IsHitTestVisible="False" Visibility="Collapsed" />
                        <Border x:Name="RightBackPageShadowStatic"
                                Background="Transparent" Grid.Column="2"
                                IsHitTestVisible="False" Visibility="Collapsed" />
                        <Border x:Name="LeftBackPageShadow"
                                Background="Transparent" Grid.Column="0"
                                IsHitTestVisible="False" Visibility="Collapsed" />
                        <Border x:Name="RightUnderPageShadow"
                                Background="Transparent" Grid.Column="0"
                                IsHitTestVisible="False" Visibility="Collapsed" />
                        <Border x:Name="LeftUnderPageShadow"
                                Background="Transparent" Grid.Column="2"
                                IsHitTestVisible="False" Visibility="Collapsed" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    Please try importing this Style into your application and let us know if it works in your particular scenario.

    Regards,
    Pavel R. Pavlov
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. first100
    first100 avatar
    4 posts
    Member since:
    Sep 2013

    Posted 03 Oct 2013 Link to this post

    I have resolved :D Thanks!
Back to Top