How to Implement Validation in WPF MVVM
HTML-код
- Опубликовано: 31 май 2024
- In this video, we're going to delve into implementing validation using the NotifyDataErrorInfo interface while following the MVVM design pattern, NotifyDataErrorInfo enables data entity classes to implement custom validation and expose validation results asynchronously.
Source Code : github.com/TacticDevGit/WPF-D...
#mvvm - Наука
Great Video as always!
A few timesstamps for when I need this in the future :D
00:00 Introduction and Demo
01:01 XAML introduction - Binding Properties - Validation types
02:52 MVVM - Adding ViewModel & Interface INotifyDataErrorInfo
05:15 Error Handling - Dictionary of Errors
09:20 Validation - Validator class
12:55 Validation - Check & Add to Dictionary of Errors
16:15 Validation - Attributes & Conditions
21:18 Implementation - ViewModel into MainWindow XAML
25:42 MVVM - Command class
31:28 Implementation - Action Command
36:05 Demonstration - Textboxes react to input
37:38 Command Class - Add & Implement Execute Event for Button
40:50 Display Error - Tooltip
43:10 Display Error - Textbox
46:05 Final Demonstration - Ending
Hi
very rarely i write any comment but now i feel i have to give you the credit you deserve for your videos. They are very educational and easy to follow at a perfect pace. For me anyway. I have learned so much from them in a short time! I hope you keep making videos about WPF and MVVM! Maybe one about Async/Await in WPF?! 😉
Thank you so much for the time you put into your work, it's really appreciated! 🙂
The realll MVP DELIVER ! Thank you so much for your expertise and the time you poured to realise this video =D
Excellent 👌
Very useful, thank you
Awesome!🤩
How do I add make my WPF app a paid app?
You can add licensing to the application which means the application will only run with license key 🔑, which you can then sell
Could you please show how to display error message for Email and Password?
Hi Jason you can check this video where show exactly how to do it in Mvvm ruclips.net/video/9nAiPjIEdzo/видео.htmlsi=1jMVrnKPTY5IWhKk
Hi@@TacticDevs , thanks for the message. I've tried adding two more similar labels and binding path to Element "Emailtextbox" or "Passwordtextbox", but don't know why those "Email is Required" and "Password is Required" never show up
HI@@jasonliaus
I don't know if you got the problem sorted but I put this and it worked:
VerticalAlignment="Top" Padding="6,0" HorizontalAlignment="Left" Width="300"
Hi @mikaelsvensson5669, I tried adding VerticalAlignment="Top" Padding="6,0" HorizontalAlignment="Left" Width="300", but didn't work.
could you please have a look at my codes for Email:
under the "Emailtextbox" I add a Label, and try to show the validation message. Anything wrong?
@@jasonliaus When the application runs try to resize the window make it a little bit bigger