|
-
November 3rd, 2011, 02:23 AM
#1
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
Few companies that installed computers to reduce the employment of clerks have realized their expectations.... They now need more and more expensive clerks even though they call them "Developers" or "Programmers."
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
|