|
-
Nov 3rd, 2011, 02:26 AM
#1
Thread Starter
Fanatic Member
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
Code:
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.
Code:
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|