Align PasswordBox text to center Windows store apps

1.1k Views Asked by At

I need to align password to center in PasswordBox like TextAlignment property do for TextBox, but unfortunately there is no TextAlignment property defined with PasswordBox element, In windows phone 8 i achieved this by modifying PasswordBox Template as this post -PasswordBox textalignment in WP7, But when searched for Windows Store App I found many post to regarding silverlight and wpf like This but not working for Windows store apps.

Thanks :)

1

There are 1 best solutions below

0
On

Include namespace:

<!-- XML Namespace mapping. -->
xmlns:vsm="clr-namespace:System.Windows;assembly=System.Windows"

Add the non-default control HorizontalContentAlignment to the style template.

<control HorizontalContentAlignment="horizontalAlignmentValue"/>

More info here and here