954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to trigger the Property Change from WCF service in Silverlight

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

vuyiswamb
Posting Whiz
312 posts since Mar 2007
Reputation Points: 31
Solved Threads: 14
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You