How to fix broken Hint padding in TextBoxes? #2780
-
About 2 years ago, I've somehow broken the I've updated to the latest version of the MaterialDesignThemes (v4.5.0) and checked out the Getting Started guide in case something has changed. Here's what's in my App.xaml: <materialDesign:CustomColorTheme BaseTheme="Light" PrimaryColor="#007d40" SecondaryColor="#ff0000" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" /> I've removed out all other ResourceDictionaries containing custom styles. And here's how I'm setting up my Windows: <Window
...
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
TextElement.Foreground="{DynamicResource MaterialDesignBody}"
Background="{DynamicResource MaterialDesignPaper}"
TextElement.FontWeight="Regular"
TextElement.FontSize="13"
FontFamily="{materialDesign:MaterialDesignFont}">
...
</Window> And here's the XAML for the <TextBox
Margin="5,5,5,25"
materialDesign:HintAssist.HelperText="Some help text"
materialDesign:HintAssist.Hint="Default TextBox" /> Any ideas? Thanks. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I've figured it out! Yaaay! It was this <Style x:Key="MyScrollViewer"
TargetType="ScrollViewer">
<Setter Property="HorizontalScrollBarVisibility" Value="Disabled" />
<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
</Style>
<Style BasedOn="{StaticResource MyScrollViewer}" TargetType="ScrollViewer" /> All I needed to do was add <Style
x:Key="MyScrollViewer"
BasedOn="{StaticResource MaterialDesignScrollViewer}"
TargetType="ScrollViewer">
<Setter Property="HorizontalScrollBarVisibility" Value="Disabled" />
<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
</Style>
<Style BasedOn="{StaticResource MyScrollViewer}" TargetType="ScrollViewer" /> |
Beta Was this translation helpful? Give feedback.
I've figured it out! Yaaay!
It was this
ScrollViewer
style that was causing theHint
padding problems.All I needed to do was add
BasedOn="{StaticResource MaterialDesignScrollViewer}"
and the Hint padding problem went away.