ModernWpf
ModernWpf copied to clipboard
PasswordBox binding error
I can't get the little show/hide icon to show up consistently - it might the first time you click into the box, but then if you click again, it won't show up again. This error shows up:
System.Windows.Data Warning: 4 : Cannot find source for binding
with reference 'ElementName=TextBox'. BindingExpression:Path=IsSelectionActive; DataItem=null;
target element is 'PasswordBox' (Name='ApiKey'); target property is 'NoTarget' (type 'Object')
The XAML is:
<PasswordBox
x:Name="ApiKey"
ui:ControlHelper.Header="Your API Key"
TabIndex="3"
PasswordChanged="ApiKey_PasswordChanged">
</PasswordBox>
And my App.xaml resources section:
<prism:PrismApplication.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ui:ThemeResources CanBeAccessedAcrossThreads="True" />
<ui:XamlControlsResources />
<!-- Local custom resources -->
<ResourceDictionary Source="/Resources/Icons.xaml" />
<ResourceDictionary Source="/Resources/Styles.xaml" />
</ResourceDictionary.MergedDictionaries>
<BooleanToVisibilityConverter x:Key="BooleanToVisibiltyConverter" />
</ResourceDictionary>
</prism:PrismApplication.Resources>