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
  • НаукаНаука

Комментарии • 17

  • @dagorren
    @dagorren 6 месяцев назад +2

    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

  • @mikaelsvensson5669
    @mikaelsvensson5669 4 месяца назад

    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! 🙂

  • @nicolasfok5661
    @nicolasfok5661 6 месяцев назад

    The realll MVP DELIVER ! Thank you so much for your expertise and the time you poured to realise this video =D

  • @anonymoususer1870
    @anonymoususer1870 6 месяцев назад

    Excellent 👌

  • @neurogenix3369
    @neurogenix3369 3 месяца назад

    Very useful, thank you

  • @harilalmn
    @harilalmn 2 месяца назад

    Awesome!🤩

  • @UcheEcoma
    @UcheEcoma Месяц назад

    How do I add make my WPF app a paid app?

    • @TacticDevs
      @TacticDevs  Месяц назад

      You can add licensing to the application which means the application will only run with license key 🔑, which you can then sell

  • @jasonliaus
    @jasonliaus 5 месяцев назад

    Could you please show how to display error message for Email and Password?

    • @TacticDevs
      @TacticDevs  5 месяцев назад

      Hi Jason you can check this video where show exactly how to do it in Mvvm ruclips.net/video/9nAiPjIEdzo/видео.htmlsi=1jMVrnKPTY5IWhKk

    • @jasonliaus
      @jasonliaus 5 месяцев назад +1

      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

    • @mikaelsvensson5669
      @mikaelsvensson5669 4 месяца назад

      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"

    • @jasonliaus
      @jasonliaus 4 месяца назад

      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?

    • @TacticDevs
      @TacticDevs  4 месяца назад +1

      @@jasonliaus When the application runs try to resize the window make it a little bit bigger