I’m new to silverlight. I got a separate class file in web project and i have to access the class file in silverlight project xaml page. I have created a service and added the reference to silverlight project.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
you cannot access class direcly you need to expose it via service only.there is no other option.
To access any class or data in you silverlight project you need to specify the contract in wcf servcie class. You class will be avaiale in silverlight application once you do as below.
WCF Contracts
In WCF, all services expose contracts. The contract is a platform-neutral and standard way of describing what the service does.
Describe which operations the client can perform on the service.
There are two types of Service Contracts.
Example
Data contracts
There are two types of Data Contracts.
– DataContract – attribute used to define the class
– DataMember – attribute used to define the properties
Example