Closed Gerardo-Sista closed 4 years ago
HI @Gerardo-Sista ,
currently using mah:ControlsHelper.ContentCharacterCasing="Upper"
is not applicateable on Label
. You can use mah:ContentControlEx
or adjust your Style:
<Style TargetType="{x:Type Label}">
<Setter Property="Foreground" Value="{DynamicResource MahApps.Brushes.Label.Text}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Label}">
<mah:ContentControlEx x:Name="PART_ContentPresenter"
Padding="{TemplateBinding Padding}"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
ContentCharacterCasing="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=(mah:ControlsHelper.ContentCharacterCasing)}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Happy coding Tim
Thank you for fixing @punker76 @timunie . As end user the name ControlsHelper suggests me that can be applied to all controls, so it feels natural to use is for label, textbox etc. etc.
Hello, in MahApps v2 if I set
<Label mah:ControlsHelper.ContentCharacterCasing="Upper" Content="{lng:Language Key=WarningsContent}" />
the casing of bound text remains the same as was set in the bound value (lowercase)
Is it normal?
For completeness on labels is applied this simple style in app.xaml:
Thank you.