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 7727017
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:21:16+00:00 2026-06-01T05:21:16+00:00

My doubt is simple, how can I show an exception using this INotifyDataErrorInfo in

  • 0

My doubt is simple, how can I show an exception using this INotifyDataErrorInfo in WPF 4.5?

I’m using MVVM:

Here is the part of my view

    <TextBox MinHeight="50"
             Text="{Binding Person.Name, Mode=TwoWay, NotifyOnValidationError=True, ValidatesOnExceptions=True}"

And here my model class. Check the Validate method, where I set @ character, should throw an exception

public class Person : DomainObject
{
    private string _name;

    public string Name
    {
        get
        {
            return this._name;
        }

        set
        {
            if (this._name != value)
            {
                this.ValidateProperty("Name", value);
                this._name = value;
                this.RaisePropertyChanged("Name");
            }
        }
    }
}

    protected override void ValidateProperty(string propertyName, object value)
    {
        if (propertyName == "Name")
        {
            var errors = new List<string>();

            var response = value as string;

            if (string.IsNullOrEmpty(response))
            {
                errors.Add("The value cannot be null or empty");
            }
            else if (response == "@")
            {
                throw new Exception("@");
            }

            this.ErrorsContainer.SetErrors(propertyName, errors);
        }
        else
        {
            base.ValidateProperty(propertyName, value);
        }
    }

When that happens, it really stop the programs.. And according to my knowledge, in Silverlight does not happen 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-06-01T05:21:17+00:00Added an answer on June 1, 2026 at 5:21 am

    You probably use your setter somewhere else besides the bindings (and you don’t catch the exception).

    You need to run your application in debug mode. Visual Studio will show you the Exception assistant when the exception occurs.

    Then you’ll be able to analyze the stack trace and see how your program calls this code.

    If it doesn’t solve your problem, please update your question with the stack trace of the exception (Visual studio calls it “Unhandled Exception”) that causes your program to stop.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No doubt I'm missing something really simple here but I just can't see the
I'm not a bash scriptor, so this is no doubt a very simple question.
My simple project structure is shown in this link . I am using Eclipse
I have a very basic doubt here. I have two very simple C codes
Im very sorry for asking for this simple doubt.Im just started to android and
I had this simple doubt. I have to display a progress dialog when the
i have a simple http client server. here client can download from the server.
I doubt it can be done portably, but are there any solutions out there?
I doubt I am the only one who has come up with this solution,
Basic doubt...If QTP generates vbscript code as we record actions, can't we directly write

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.