PasswordBox Reveal and Clear icon size, need help. #3573
-
Hello, I've been using the material design library for a while and I know how to change surface level stuff from the styles like making a textbox or the font inside it bigger. But I don't know how to change inner stuff or how to access them. My problem is that I made the passwordbox bigger than the default and the reveal and clrear have 16x16 size (inspected it with snoop). With this bigger box they stay at the top and also they are really tiny. I don't know how to access it and just change that. I've looked at the "MaterialDesignTheme.PasswordBox.xaml" but the RevealPasswordIcon and ClearButton are nested inside multiple things and I don't know how to access it from my own style.xaml that I have in my application. Could some one please help me? If you search in the "MaterialDesignTheme.PasswordBox.xaml" for "RevealPasswordIcon" that's the one I want to change the Height and Width of, I'm surprised you can easily modify the LeadingIcon size but not the reveal and clear one. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
At present there is not a simple way to do it. However, you can setup a style that will apply to all inner PackIcons and manipulate their size that way. Something like this (using the demo app as an example). <PasswordBox materialDesign:HintAssist.HelperText="Bound to Password2"
materialDesign:HintAssist.Hint="Password"
materialDesign:PasswordBoxAssist.Password="{Binding Password2, Mode=TwoWay}"
materialDesign:TextFieldAssist.HasClearButton="True"
IsEnabled="{Binding ElementName=RevealPasswordFloatingEnabled, Path=IsChecked}"
Style="{StaticResource MaterialDesignFloatingHintRevealPasswordBox}">
<PasswordBox.Resources>
<Style TargetType="materialDesign:PackIcon" BasedOn="{StaticResource {x:Type materialDesign:PackIcon}}">
<Setter Property="Width" Value="30" />
<Setter Property="Height" Value="30" />
</Style>
</PasswordBox.Resources>
</PasswordBox> |
Beta Was this translation helpful? Give feedback.
At present there is not a simple way to do it. However, you can setup a style that will apply to all inner PackIcons and manipulate their size that way. Something like this (using the demo app as an example).