Silverlight Web Resources typically provide some interaction with contextual data in Microsoft Dynamics CRM, you should plan how you create your Web resources.
If the .xap webresource is running from within a form in CRM, the object Xrm.Page.context can access contextual information in the same way it can in an entity form.
When you add a Silverlight Web resource to a form , in the dialog window that opens , there would be a checkbox – “Pass record object-type code and unique identifier as parameters option” . Have this option checked, the web resource published before you could retrieve information listed below. You also have the option to enter text as a custom parameter in this window.
You can get the CRM value like this :
string entityTypeName = App.Current.Host.InitParams["typename"];
Similarly other parameters which you could retrieve are :
id – The unique identifier of the record.
type – The entity type code. For custom entities this can vary between organizations.
typename – The logical name of the entity.
orgname – The name of the organization.
userlcid – The language code representing the user’s language preference.
orglcid – The language code representing the organization’s base language.
data – The value of the text entered as a custom parameter.
Hope this information is helpful ! 🙂