1
在服务器端,我有下面的类:RIA:如何获得的功能,而不是一个数据
public class Customer
{
[Key]
public int Id { get; set; }
public string FirstName { get; set; }
public string SecondName { get; set; }
public string FullName { get { return string.Concat(FirstName, " ", SecondName); } }
}
的问题是,每场计算,传输到客户端(在Silvelight应用程序),例如'FullName'属性:
[DataMember()]
[Editable(false)]
[ReadOnly(true)]
public string FullName
{
get
{
return this._fullName;
}
set
{
if ((this._fullName != value))
{
this.ValidateProperty("FullName", value);
this.OnFullNameChanging(value);
this._fullName = value;
this.RaisePropertyChanged("FullName");
this.OnFullNameChanged();
}
}
}
而不是数据传输(即流量消耗,在某些情况下,它会引入大量开销)。我想在客户端进行计算(silverlight aplpication)。
这可能没有手动重复的财产执行?
谢谢。
假设这是一个Web表单或其他东西,你不能使用AJAX或JavaScript进行验证吗? – 2010-03-28 22:16:55
我很抱歉,...我能做些什么与验证?功能复制的目的是在不传递FullName属性值的情况下,在FirstName =“Alex”和SecondName =“Sereda”的情况下,在客户端计算并显示FullName为“Alex Sereda”。 – Budda 2010-03-29 15:03:07