Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/magento/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Data binding 实体绑定在深层不起作用_Data Binding_Silverlight 4.0_Wcf Ria Services - Fatal编程技术网

Data binding 实体绑定在深层不起作用

Data binding 实体绑定在深层不起作用,data-binding,silverlight-4.0,wcf-ria-services,Data Binding,Silverlight 4.0,Wcf Ria Services,假设我有实体图,比如 人->学生 然后在xaml中,我有以下类型的绑定(人是VM的财产): 运行应用程序时,绑定到人员的所有数据都正常 绑定到Student的所有数据均无效 如何修复它?我猜客户端的Student属性为null。您需要在服务器端的Student属性中添加[Include]属性,以便RIA服务将其传递到客户端。您可能还需要为服务器端添加一个include,以便从数据库中检索它,具体取决于数据访问的写入方式 <TextBox Text="{Binding People.Nam

假设我有实体图,比如

人->学生

然后在xaml中,我有以下类型的绑定(人是VM的财产):

运行应用程序时,绑定到人员的所有数据都正常

绑定到Student的所有数据均无效


如何修复它?

我猜客户端的Student属性为null。您需要在服务器端的Student属性中添加[Include]属性,以便RIA服务将其传递到客户端。您可能还需要为服务器端添加一个include,以便从数据库中检索它,具体取决于数据访问的写入方式

<TextBox  Text="{Binding People.Name, Mode=TwoWay}" />
<TextBox  Text="{Binding People.Student.StudentNo, Mode=TwoWay}" />   <!--  this bounding is not working -->
public void BeginEdit()
{
   ((IEditableObject)this.People).BeginEdit();
   ((IEditableObject)this.People.Student).BeginEdit();    //this code not working
   //....
}