This is a migrated thread and some comments may be shown as answers.
Specify FontWeight for buttons
3 Answers 25 Views
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Jeremy
Top achievements
Rank 1
Jeremy asked on 07 Nov 2011, 08:58 AM
Hello,

I'm using the MessageBox control and I need to display a list of choices to my users. In my case, I need each button to be a simple text. In order to do that, I've come up with the following XAML:

<ControlTemplate x:Key="shareMessageBoxTemplate"
                 TargetType="telerik:RadMessageBoxControl">
        <Border
                Padding="12"
                Background="{StaticResource PhoneChromeBrush}">
            <Border.Resources>
                <Style TargetType="Button">
                    <Style.Setters>
                        <Setter Property="Template">
                            <Setter.Value>
                                <ControlTemplate TargetType="Button">
                                    <TextBlock
                                        Margin="14"
                                        Text="{TemplateBinding Content}"
                                        FontSize="30"
                                        FontWeight="ExtraLight"/>
                                </ControlTemplate>
                            </Setter.Value>
                        </Setter>
                    </Style.Setters>
                </Style>
            </Border.Resources>
             
            <Grid>
                <ContentControl x:Name="PART_Title" Visibility="Collapsed"/>
                <ContentControl x:Name="PART_Message" Visibility="Collapsed"/>
                <CheckBox x:Name="PART_CheckBox" Visibility="Collapsed"/>
 
                <ContentControl
                        x:Name="PART_ButtonsContainer"
                        HorizontalContentAlignment="Stretch">
                    <ContentControl.ContentTemplate>
                        <DataTemplate>
                            <StackPanel x:Name="PART_ButtonsPanel"/>
                        </DataTemplate>
                    </ContentControl.ContentTemplate>
                </ContentControl>
            </Grid>
        </Border>


The problem is that the 
FontWeight="ExtraLight"
option does not seems to be taken into account (the text is still rendered using a bold style).

Am I missing something ? I've also tried to set the resources in the Resources section of the ContentControl but it doesn't work either.

Regards,
Jeremy

3 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 07 Nov 2011, 04:36 PM
Hello Jeremy,

 Thank you for writing.
I am afraid that I have no idea why your XAML does not work. It looks like it should. I tried setting ExtraLight as font weight for a standalone TextBlock on an empty page and it does not have any effect. Perhaps the ExtraLight value is broken in the WindowsPhone Silverlight. There seems to be no difference between ExtraLight and Normal.

Please write again if you need assistance with our controls.

Greetings,
Victor
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Jeremy
Top achievements
Rank 1
answered on 08 Nov 2011, 08:50 AM
Ok I found the issue (based on this thread):Font selection is a bit of a mess. You can select FontWeight for some typefaces such as Verdana, but for Segoe WP they created a separate FontFamily for each weight. Instead of FontWeight you would select FontFamily="Segoe WP Light"

In my case, changing the FontWeight="ExtraLight" to FontFamily="Segoe WP Light" did the trick.
0
Vitalii
Top achievements
Rank 2
answered on 14 May 2014, 07:10 PM
Hey, Jeremy, thanks for info! That one is still actual, at least for wp7.
Tags
MessageBox
Asked by
Jeremy
Top achievements
Rank 1
Answers by
Victor
Telerik team
Jeremy
Top achievements
Rank 1
Vitalii
Top achievements
Rank 2
Share this question
or