I am using Mahapps and I am not able to set Proper case for Window titles and Group box titles etc..
I tried googling and Typography settings.
If someone knows out there could you please help-me here..
Thanks
<controls:MetroWindow x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
TitleCharacterCasing="Normal" />
Set a style (option 1) or set a property (option 2)
<!-- Option 1 -->
<Style TargetType="{x:Type GroupBox}" BasedOn="{StaticResource MetroGroupBox}">
<Setter Property="Controls:ControlsHelper.ContentCharacterCasing" Value="Normal" />
</Style>
<!-- Option 2 -->
<GroupBox Controls:ControlsHelper.ContentCharacterCasing="Normal" />
Credits: @Suplanus & @Oscar Vicente Perez
Set the TitleCaps
property on your MetroWindow
to false
.
<controls:MetroWindow x:Class="MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
TitleCaps="False" />
Put that TextBlock
in the GroupBox
's header.
<GroupBox>
<GroupBox.Header>
<TextBlock Text="My Group Box"/>
</GroupBox.Header>
Some content
</GroupBox>
TitleCaps="False"
is obsolete, use this code in the Window:
TitleCharacterCasing="Normal"
Completing @Marcos answer:
I had the same problem 2 years after so i'll post my solution. I had to read the code at Git Hub so i realized that the MetroGroupBox Style uses a DependencyProperty in ControlsHelper class named 'ContentCharacterCasing' so we have 2 options, set an style or set the property directly in the control. But before, you need this xmlns in the xaml:
'xmlns:Controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"'
<Style TargetType="{x:Type GroupBox}" BasedOn="{StaticResource MetroGroupBox}">
<Setter Property="Controls:ControlsHelper.ContentCharacterCasing" Value="Normal" />
</Style>
<GroupBox Margin="20,20,20,0" Grid.Row="0" Header="Cliente" Controls:ControlsHelper.ContentCharacterCasing="Normal" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With