Print Page | Close Window

Customized attribute in silverlight projects

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce 2010
Forum Discription: For .NET 4.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=3628
Printed Date: 26-Mar-2025 at 5:42am


Topic: Customized attribute in silverlight projects
Posted By: blogger
Subject: Customized attribute in silverlight projects
Date Posted: 14-Sep-2012 at 2:05am
Hi Ideablade
 
Following on the http://www.ideablade.com/forum/forum_posts.asp?TID=2747&title=custom-verifier-attribute - post about custom validation attribue on silverlight  i have a very important problem that prevent me from continuing some validation process, as you know, to customize entities validation in silverlight we have to create a "buddy" class (with metadata) and apply the customized attribute that we 've just created on a static similar field on the metadata class, the problem is in silverlight we have to create the buddy class in the web project  and add it as link in silverlight project,  so , the customized attribute should be known by both web and silverlight  project to work well, but we have created only one version of this attribute? what do you suggest in such a case ? in ideablade project you have creates two dll 's one for web side Ideablade.Validation.dll and the other for the silverlight  client silde which is Ideablade.Validation.SL, so please give me a solution to this issue !
 
Thanks a lot !



Replies:
Posted By: kimj
Date Posted: 17-Sep-2012 at 12:39pm
If you do have a custom verification attribute which must be defined on both client and server, then you have the same options as you would with any other types which must be defined on both sides, such as those in your entity model or any custom interface implementations.  Can you elaborate on the problem you're having?
 


Posted By: blogger
Date Posted: 22-Sep-2012 at 3:08am
To make things clear, i want to create reusable customized attributes in dll's to put them in my project, to reach this i have to create two dll's the first for the silverlight project and the second for the web project like what you have done in  Ideablade.Validation.SL and   Ideablade.Validation , i think we must create two dll's because our entities are defined in the web project and must be linked in the silverlight project , so the silverlight project must know about the existence of these customized attributes.

Thankd


Posted By: blogger
Date Posted: 24-Sep-2012 at 3:39am
Originally posted by kimj

If you do have a custom verification attribute which must be defined on both client and server, then you have the same options as you would with any other types which must be defined on both sides, such as those in your entity model or any custom interface implementations.  Can you elaborate on the problem you're having?
 


Thank you very much Mr Kimj your answer was very helpful, the error that i have made is that i have created two classes (files) for the same Customized validation attribute in both web and client side , the correct procedure is as what you have said , we must creat only one version in the web side and we add it as a link in the client side !
that works fine



Print Page | Close Window