本文介绍了在Silverlight中验证linq实体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在Visual Studio 2010中编写一个Silverlight应用程序,并将数据存储在sqlserver 2008中.我使用Linq来访问Web服务器端的sqlclasss,并通过启用了Silverlight的wcf Web服务向Silverlight客户端公开该类.然后,我将代理类成员(通过服务引用获得)绑定到UI silverlight控件.我想验证这些控件中的用户输入是否为文本框,datetimepickers网格等.我已经阅读了许多有关在我希望绑定e.t.c的类中实现IDataErrorInfo接口的文章.问题是我不绑定到由me.linq编写的类,因此会自动生成sql类代码.我绑定到代理类(这是wcf服务公开的sql类的linq).我尝试在属性(列)的设置"部分中的dbml文件的设计器中编写验证规则.我还尝试在设计器文件中实现IDataErrorInfo接口,但是没有一种方法可以验证UI中的用户输入.我该怎么办?

Hello, I am writing a Silverlight application in visual studio 2010 and have my data in sqlserver 2008. I use Linq to sqlclasses on the webserver side which I expose to silverlight client through silverlight enabled wcf web service. Then i bind the proxy class members (that i get through service reference) to UI silverlight controls. I want to validate the user input in these controls whether it is textboxes datetimepickers grids e.t.c. I have read many articles about implementing the IDataErrorInfo interface in the class that i wish to bind e.t.c. Problem is that i do not bind to a class written by me.linq to sql class code is autogenerated. I bind to the proxy class (that is a linq to sql class exposed by a wcf service). I tried writing my validation rules in the designer of the dbml file in the in the "set" section of the properties(columns). I also tried implementing IDataErrorInfo interface in the designer file but neither approach validates user input in the UI. What can I do?

推荐答案


这篇关于在Silverlight中验证linq实体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 11:23