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

ContentPresenter of RadRibbonButton has different alignment in Fluent theme

2 Answers 186 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Jan
Top achievements
Rank 1
Jan asked on 20 Feb 2018, 05:49 PM

When I switched to Fluent theme all RadRibbonButtons direct content was aligned to the left instead of centered as it was previously in Expression Dark theme. The problem is, that ContentPresenter in StackPanel named FirstRowContainer has its HorizontalAlignment property set to Left. I don't know how can I change that to Center and I need your help to fix it. Direct content of buttons is TextBlock displaying Font Glyph. Here is sample code:

                        <telerik:RadRibbonButton x:Name="buttonLock"
                                                 Click="ButtonLock_OnClick"
                                                 IsEnabled="{Binding IsUiUnlocked}"
                                                 Size="Large"
                                                 Text="Lock">
                            <TextBlock Margin="2"
                                       FontFamily="{StaticResource TelerikWebUI}"
                                       FontSize="24"
                                       Foreground="#00BFE8"
                                       Text="{StaticResource GlyphLock}" />
                        </telerik:RadRibbonButton>

2 Answers, 1 is accepted

Sort by
0
Sia
Telerik team
answered on 23 Feb 2018, 04:28 PM
Hello,

You are right that in our Fluent theme there is no default setting for HorizontalContentAlignment of RadRibbonButton and that is why it defaults to Left. As a workaround I would suggest setting the HorizontalContentAlignment to Center as follows:
<telerik:RadRibbonButton x:Name="buttonLock"
                 Click="ButtonLock_OnClick"
                 HorizontalContentAlignment="Center"
                 IsEnabled="{Binding IsUiUnlocked}"
                 Size="Large"
                 Text="Lock">
        <TextBlock Margin="2"
               FontFamily="{StaticResource TelerikWebUI}"
               FontSize="24"
               Foreground="#00BFE8"
               Text="{StaticResource GlyphLock}" />
</telerik:RadRibbonButton>

Please let me know whether it works on your end.


Regards,
Sia
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
Jan
Top achievements
Rank 1
answered on 07 Nov 2018, 12:38 PM
Yes, that solves it.
Tags
General Discussions
Asked by
Jan
Top achievements
Rank 1
Answers by
Sia
Telerik team
Jan
Top achievements
Rank 1
Share this question
or