vuyiswamb 17 Posting Whiz

Good Day All

My Question goes as follows.

I have a DataLayer in a Form of a WCF service and it is being consumed by a Business Layer that is also in a Form of a WCF Service and it is being consumed by a Silverlight Application. Now i have a Model in the DataLayer that defines the structure that comes from the Database, and this strucure model implements INotifyPropertyChanged interface to track the changes on the Properties.

So basically , when the changes are made in silverlight , i want the Interface method to be fired in the Datalayer.

now to go further with my requirement , i am doing the validation on the Properties like this

public string CustomerSurname
        {
            get
            {
                return _CustomerSurname;
            }

            set
            {

                if (!string.IsNullOrEmpty(value))
                {
                    _CustomerSurname = value;

                    OnNotifyPropertyChanged("CustomerSurname");
                }
                else
                {
                    throw new Exception("Invalid Surname");
                }
            }
        }

and obviously set binded control with the Proper binding property to show the Exception.

Text="{Binding CustomerSurname, Mode=TwoWay,ValidatesOnExceptions=True}"

The problem is the "changed" event does not get triggered, or rather my Exception does not show.


Thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.