RadButton content disappears when i change the color ControlBackground_Focused

3 posts, 1 answers
  1. Haythem
    Haythem avatar
    26 posts
    Member since:
    Jun 2013

    Posted 07 Jan 2014 Link to this post

    Hello,
    I wanted to tune my radbutton style by modifiying the background color when the button is focused.
    I edited the template in blend but when i change ControlBackground_Focused the button content is no more visible ...
    Can you help me please? its urgent
    Here is the image of the button after changing  ControlBackground_Focused to black .
    Waiting forward for your response,

    Cordially,
    KAROUI Haythem
    IT Manager at Crea digital
  2. Answer
    Boris
    Admin
    Boris avatar
    276 posts

    Posted 08 Jan 2014 Link to this post

    Hello Haythem,

    I have made a sample project that demonstrates the change of ControlBackground_Focused to "Black" and the content of button is now visible. The issue was resolved by positioning the ContentControl from the Button's ControlTemplate after the Border with name: "CommonStatesWrapper" :
    <Border x:Name="CommonStatesWrapper">
                                    <Border x:Name="FocusVisual"
                                        BorderThickness="1"
                                        Visibility="Collapsed"
                                        BorderBrush="{StaticResource ControlOuterBorder_Focused}"
                                        CornerRadius="{TemplateBinding CornerRadius}"
                                        Background="{StaticResource ControlBackground_Focused}">
                                        <Border BorderThickness="1" CornerRadius="{TemplateBinding InnerCornerRadius}" BorderBrush="{StaticResource ControlInnerBorder_Focused}"/>
                                    </Border>
                                </Border>
     
                                <ContentControl x:Name="Content"
                                    IsTabStop="False"
                                    Content="{TemplateBinding Content}"
                                    Foreground="{TemplateBinding Foreground}"
                                    Margin="{TemplateBinding Padding}"
                                    ContentTemplate="{TemplateBinding ContentTemplate}"
                                    VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                    HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"/>
    You can find the edited RadButtonStyle in App.xaml. The style is applied implicitly.

    We hope this helps you proceed further.

    Regards,
    Boris Penev
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
    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. DevCraft banner
  4. Haythem
    Haythem avatar
    26 posts
    Member since:
    Jun 2013

    Posted 09 Jan 2014 Link to this post

    Thank you for your efficient response.

    Cordially
    KAROUI Haythem
Back to Top