Jump to content
UBot Underground

How To Get The Password Value From Xaml Passwordbox ?


Recommended Posts

Normally to get the value of a control you wouldn't otherwise be able to - I would bind the value to an invisible textbox and read it from there. But the passwordbox is kind of a special exception because you can't do that. I think in this case it would need to be added to the plugin. You might be able to make a control which displays the * character but I have a feeling this wouldn't work either and you would just end up with a bunch of stars as the value instead of the password because it would be reading the text property.

 

Or maybe you can hide a password box and have the user input into a textbox then bind the text to the password box and then hide the textbox and show the password box. It's not ideal but maybe it could work.

 

Here's a brief example how to bind it:

<StackPanel>
	<TextBox x:Name="tb1" Text="{Binding ElementName=pb1, Path=Password, UpdateSourceTrigger=PropertyChanged}"/>
	<PasswordBox x:Name="pb1"/>
</StackPanel>
  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...