Ghost1372

everything can be handy

PasswordBox

Styles

Style
PasswordBoxBaseStyle
PasswordBox.Small
PasswordBoxExtend
PasswordBoxExtend.Small

PasswordBoxBaseStyle

The default style of the native passwordbox is not recommended. It should always be used by other styles based on On.

Example:

1
<PasswordBox PasswordChar="*" VerticalAlignment="Center" Width="120"/>

PasswordBox.BaseStyle

PasswordBoxExtendBaseStyle : PasswordBoxBaseStyle

The native passwordbox extends the default style. It is not recommended to use it directly, and it should always be used by other styles as BasedOn.

PasswordBoxExtend : PasswordBoxExtendBaseStyle

Compared to the default style of the native passwordbox, it can implement the functions of title and watermark with the help of additional attributes.

example:

1
2
3
4
5
6
7
8
9
10
11
<!--In order to display the watermark in the normal password input text box, you need to set PasswordBoxAttach.PasswordLength="0"-->
<PasswordBox Style="{DynamicResource PasswordBoxExtend}" PasswordChar="*"
hc:PasswordBoxAttach.PasswordLength="0"
hc:InfoElement.Placeholder="Please enter the password"
VerticalAlignment="Center"
Width="120"/>
<PasswordBox Style="{DynamicResource PasswordBoxExtend}" PasswordChar="*"
hc:TitleElement.Title="user password:"
hc:TitleElement.TitlePlacement="Top"
VerticalAlignment="Center"
Width="120"/>

PasswordBox.ExtendStyle

0%