Friday, August 28, 2015

NumericPassword.WP


NumericPassword.WP is a TextBox-based component for Windows Phone providing missing and widely requested numeric password input.

Adding NumericPassword component to your Windows Phone project is easy, as it takes only 5 simple steps:


  1. Add ExternalGoods.NumericPassword.WP package to your project via NuGet Package manager.
    In Visual Studio choose Tools > NuGet Package Manager > Manage NuGet Packages for Solution..., search for NumericPassword in upper right corner of the dialog and click Install.
  2. Add namespace reference to your PhoneApplicationPage.
    You can choose any prefix that does not exist on your page yet (red part), but the value (blue part) must stay the same, saying VS what assembly and namespace to look for the component.
  3. Add NumericPassword component to your XAML layout using namespace from the previous step.
  4. Set a password character you wish to use via PasswordChar property. If not set the default character ("*") ("") will be used.
  5. You can set any other common property or event, just like you would do with classic TextBox.
    The only one protected property (which you can read, but can not set) is InputScope, which is hardcoded to Number.

  6. In code you can access the value directly the same way like in the classic TextBox:

    pinPopup_pin.Text = "0000";  //presets the value (user will see four dots instead)
    string value = pinPopup_pin.Text;  //returns value entered by user (e.g. 1234)

That's it! You are now ready to build your own superb UI with NumericPassword!





type name meaning default value since
string PasswordChar character to be displayed instead of each one digit of the numeric password 1.0.0
bool PasswordVisible when set to true, the password is displayed in a plain form (i.e. showing original digits instead of PasswordChar) false 1.0.2
string Text current password value; when being set, the digits are displayed as PasswordChars, when read the original plain-text password is returned {empty string} 1.0.0

6 comments:

  1. Hi. Thanks for coming up with this. But unfortunately it's not available on Windows Mobile 10 though.

    ReplyDelete
    Replies
    1. Hi Alex, thank you for letting me know. The library is built for WP8, so it would make sense. I will try my best to create a Wp10 build ASAP.
      Using it in Wp8 application on Wp10 device should work.

      Delete
    2. This comment has been removed by the author.

      Delete
    3. This comment has been removed by the author.

      Delete
  2. Hi. Thanks for coming up with this. But unfortunately it's not available on Windows Mobile 10 though.

    ReplyDelete
  3. Hi thanks for the reply. Anyway, just to let you know that apparently Windows 10 came with their own built in textbox by using InputScope="NumericPin". Hopefully this would enlighten your other readers.

    More details https://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.xaml.input.inputscopenamevalue.aspx

    ReplyDelete