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

  • Home
  • SEARCH
  • 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 8909409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T03:25:26+00:00 2026-06-15T03:25:26+00:00

I have a WPF application( .Net 3.5 ) which uses the IDataErrorInfo on the

  • 0

I have a WPF application(.Net 3.5) which uses the IDataErrorInfo on the ViewModel to validate input.

It works great, the usercontrol get the correct UI feedback.

The problem is that the user can still change the selected element, or save this element.

So my question is: How can I know that all my properties are valid? Or at least that all my displayed values are valid. The goal is to bind some IsActive on this result

  • 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-06-15T03:25:28+00:00Added an answer on June 15, 2026 at 3:25 am

    From your comment on your implementation of IDataErrorInfo change your implementation to this style….

    #region IDataErrorInfo Members
    
    public string Error
    {
        get { return this[null] }
    }
    
    public string this[string columnName]
    {
        get
        {
            StringBuilder result = new StringBuilder();
            if (string.IsNullOrEmpty(columnName) || columnName == "FirstName")
            {
                if (string.IsNullOrEmpty(FirstName))
                    result.Append("Please enter a First Name\n");
            }
            if (string.IsNullOrEmpty(columnName) || columnName == "LastName")
            {
                if (string.IsNullOrEmpty(LastName))
                    result.Append("Please enter a Last Name\n");
            }
           if (string.IsNullOrEmpty(columnName) || columnName == "Age")
            {
                if (Age <= 0 || Age >= 99)
                    result.Append("Please enter a valid age\n");
            }
            return (result.Length==0) ? null : result.Remove(result.Length-1,1).ToString();
        }
    }
    
    #endregion
    
    
    public bool IsValid {
       get { return string.IsNullOrEmpty(this.Error); }
    }
    

    Then in your property changed event

    if (e.PropertyName == "Error") {
       OnPropertyChanged(this,new PropertyChangedEventArgs("IsValid"));
    }
    if (e.PropertyName != "Error" && e.PropertyName != "IsValid") {
       OnPropertyChanged(this,new PropertyChangedEventArgs("Error"));
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My .NET 4 application uses the WPF TreeView which I have enhanced to enable
I have a desktop .NET WPF application witch uses an embedded database (SQLite). Where
I have a C# WPF (.NET 4.0) application that uses Excel interop to read
I have a WPF application targetting the .NET 4.0 Client Profile which needs to
I have a client application (WPF, C#, .net4) which uses POCO entity model connected
I have WPF application, Which works fine on my PC. As this application is
I have a WPF application in which I use entity framework with mysql connector/net
In my .NET 3.5 WPF Application, I have a WPF DataGrid which will be
I have a WPF application (.NET 3.0, VS2008) that displays data in a tab
I have a .Net 4.0 WPF application that requires an embedded database. MS Access

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.