The previously described
TextBox control is great for entering various kinds of information. However, it is not a perfect solution for typing passwords. To handle this type of information, the
PasswordBox control is available. You will learn how to use it in this recipe.
To step through this recipe, you only need the automatically generated project.
To add a password box and handle the
PasswordChanged event, perform the following steps:
PasswordBoxcontrol on the page and adjust its appearance by modifying the content of the
MainPage.xamlfile as follows:
<Page (...)> <Grid (...)> <PasswordBox PlaceholderText="Type a password..." VerticalAlignment="Center" HorizontalAlignment="Stretch" Margin="20" ...