Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6742869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:53:39+00:00 2026-05-26T11:53:39+00:00

From my reading and trying to understand and implement MVVM and validation, I need

  • 0

From my reading and trying to understand and implement MVVM and validation, I need some help on the following scenario.

View – User interface (expected)

Model – based on a data table, and via OnColumnChanging, tests for validation requirements on a column-by-column basis (this part works no problem)

ViewModel – glue the connects the model to the view, this works too.

For each of the textbox controls, I have them respectively binding two-way to the data table, current row (still no problem) and it shows the data as expected. The flags including: NotifyOnTargetUpdated, ValidatesOnDataErrors, ValidatesOnExceptions and NotifyOnValidationError are all set to true.

If I use the interface and put in invalid value, it properly triggers the validation and puts red border around control showing it failed.

Now the problem. I start my form, and click the “Add” button (new record, blank values), textbox controls now enabled for editing content. Click the “Save” button. I want to have all the controls refreshed that are missing “required” data. Since my view model is bound to columns of the data table, and that from my readings, all the validation should be handled in the viewmodel, how should I adjust my scenario.

I don’t know how to force which controls are bound to respective controls when they’ve never received focus. In addition, from other readings, to allow for unit testing, you should be able to test under the assumption that there is never a user interface. So, in theory, I could automate creating my viewmodel, which loads my data model, adds a record, tries to save and forces whatever to test all “required” fields.

Am I close??? way off??? Not quite positive on this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T11:53:39+00:00Added an answer on May 26, 2026 at 11:53 am

    Implement: IDataErrorInfo and check Error within your SaveCommand

    Further Reading:

    • WPF Apps With The Model-View-ViewModel Design Pattern
    • Using IDataErrorInfo for validation in MVVM with Silverlight and WPF
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a custom view in Django admin. I'm reading from this
Am trying to implement a generic way for reading sections from a config file.
I'm trying to understand how to implement replaceable components, or a service provider interface,
I am trying to understand Adaboost algorithm but i have some troubles. After reading
In order to improve performance reading from a file, I'm trying to read the
I am trying to achieve reading variables from a Java applet out of process
I'm trying to call the LumenWorks .csv file reading library from a C++/CLI application
I'm trying to create a service reading the dead-letter from the transactional system dead
I am trying to redirect a page reading the url from the config file.
I am reading in numbers from a file and then trying to add them

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.