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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T22:08:21+00:00 2026-05-12T22:08:21+00:00

Im facing a bit of an issue when trying to validate a decimal property

  • 0

Im facing a bit of an issue when trying to validate a decimal property on domain object which is bound to a textbox on the view through the viewmodel.

I am using NHibernate to decorate my property on the domain object as below.

private decimal _refurbishmentFee;
[Min(Value=0), NotNull]
public decimal RefurbishmentFee
{
    get { return _refurbishmentFee; }
    set 
    {
        if (_refurbishmentFee == value) return;
        _refurbishmentFee = value;
        OnPropertyChanged("RefurbishmentFee");
    }
}

The validation works fine if I put in a number less than 0, however if I put in alpha characters or a space then nothing happens, the application doesn’t even fall into the setter.

Any help?

Thanks
Faisal

  • 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-12T22:08:21+00:00Added an answer on May 12, 2026 at 10:08 pm

    Yes I am using ValidatesOnDataErrors in the XAML. Fortunately one of my colleagues resolved this issue last night so I thought I should put it on here in case someone else is in the same position.

    To get the validation to occur in all cases you need to add ValidatesOnExceptions=”True” as well as ValidatesOnDataErrors=”True” in the XAML.

    <Controls:NumberTextBox IsEnabled="{Binding IsEditable}"  Grid.Row="1" Grid.Column="3" Name="txtRefurbishmentFee">
        <TextBox.Text>
            <Binding Path="Entity.RefurbishmentFee" UpdateSourceTrigger="PropertyChanged" ValidatesOnExceptions="True" ValidatesOnDataErrors="True" />
        </TextBox.Text>
    </Controls:NumberTextBox>
    

    Then on the domain object use standard NHibernate validation decorators.

    private decimal _refurbishmentFee;
    [Min(Value=0)]
    public decimal RefurbishmentFee
    {
        get { return _refurbishmentFee; }
        set 
        {
            if (_refurbishmentFee == value) return;
            _refurbishmentFee = value;
            OnPropertyChanged("RefurbishmentFee");
        }
    }
    

    Thanks,
    Faisal

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

Sidebar

Related Questions

I have Apache running on a public-facing Debian server, and am a bit worried
I am facing strange issue on Windows CE: Running 3 EXEs 1)First exe doing
I am facing a bit of a quandary, I need to replace a new
I am facing an issue where my Rails application is set to cache classes
I'm trying to design a tab control which will fade out the current content
I'm facing a problem when trying to log my application using log4net. My application
I have a bit of a problem. I'm trying to add,remove and edit items
I'm a bit stuck trying to figure out how to design an Oracle query,
I'm facing a problem while trying to create Checkboxes Dynamic in my application. The
I'm facing a trouble with my href which is listed inside yui menu. Here

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.