TextBlock global style affect appearance of RadMenu

1 Answer 6 Views
Menu Styling
Deltaohm
Top achievements
Rank 1
Iron
Deltaohm asked on 30 Apr 2021, 08:15 AM

I set a global textblock style in app.xaml in order to styling text in dialog:

<Style TargetType="TextBlock" x:Key="{x:Type TextBlock}">
<Setter Property="Width" Value="100"/>
<Setter Property="Margin" Value="5"/>
<Setter Property="VerticalAlignment" Value="Center"/>
<Setter Property="t:StyleManager.Theme" Value="{StaticResource GlobalTheme}"/>
</Style>

But when I run the application I saw that the width property affect the space left for the menu item in toolbar:

This is the appearance without textblock style:



How can I use the style without change the Menu?
Thank you
Luigi

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 04 May 2021, 12:31 PM

Hello Luigi,

The global (implicit) TextBlock style will be applied to any TextBlock element, including the texts in the RadMenu. To avoid this you can use an explicit style (with x:Key) and apply it only on the elements you need to customize.

Regards,
Martin Ivanov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
Menu Styling
Asked by
Deltaohm
Top achievements
Rank 1
Iron
Answers by
Martin Ivanov
Telerik team
Share this question
or