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

RadButton content disappears when i change the color ControlBackground_Focused

2 Answers 86 Views
Buttons
This is a migrated thread and some comments may be shown as answers.
Haythem
Top achievements
Rank 1
Haythem asked on 07 Jan 2014, 12:47 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Boris
Telerik team
answered on 08 Jan 2014, 02:51 PM
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 >>
0
Haythem
Top achievements
Rank 1
answered on 09 Jan 2014, 09:09 AM
Thank you for your efficient response.

Cordially
KAROUI Haythem
Tags
Buttons
Asked by
Haythem
Top achievements
Rank 1
Answers by
Boris
Telerik team
Haythem
Top achievements
Rank 1
Share this question
or