I have a very low security application. I would like to add an Attached Property to a PasswordBox so I may bind to it. I realize the security issues associated with doing this.
I have copied this seemingly well known code: http://blog.functionalfun.net/2008/06/wpf-passwordbox-and-data-binding.html
I added the proper xmlns for my app:
xmlns:w="clr-namespace:gobo2018.HelperClass"
And, my PasswordBox xaml:
<PasswordBox x:Name="userPasswordBox" Grid.Row="2" Grid.Column="1"
w:PasswordBoxAssistant.BindPassword="True"
w:PasswordBoxAssistant.BoundPassword="{Binding Path=Password, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}">
</PasswordBox>
However, I am getting "doesn't exist in the namespace..." which I don't understand, especially since the intellisense recognizes "w:PasswordBoxAssistant.BindPassword..."
Output Message: System.Windows.Data Error: 40 : BindingExpression path error: 'Password' property not found on 'object' ''ActiveJobViewModel' (HashCode=6122357)'. BindingExpression:Path=Password; DataItem='ActiveJobViewModel' (HashCode=6122357); target element is 'PasswordBox' (Name='userPassWordBox'); target property is 'BoundPassword' (type 'String')
Restarting my machine resolved the "doesn't exist in the namespace..." problem.