Answer the question
In order to leave comments, you need to log in
How to validate PasswordBox in WPF?
I want to set validation for PasswordBox, but it doesn't work like I did for TextBoxes
<TextBox x:Name="email"
materialDesign:HintAssist.Hint="Email"
Style="{StaticResource MaterialDesignFloatingHintTextBox}"
Width="140"
Margin="0,0,0,-2">
<TextBox.Text>
<Binding Path="Email" UpdateSourceTrigger="PropertyChanged">
<Binding.ValidationRules>
<rules:IsEmail ValidatesOnTargetUpdated="False"/>
</Binding.ValidationRules>
</Binding>
</TextBox.Text>
</TextBox>
Answer the question
In order to leave comments, you need to log in
It is better to look towards MVVM and INotifyPropertyChanged, IDataErrorInfo interfaces.
Ps: Life will make it easier to use ValidationContext.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question