Monday, September 27, 2010

Getting Silverlight version

Here is the post which gives you how to get the Silverlight version through Javascript.

If you want to get the Silverlight version inside Silverlight code you may invoke this function as follows.

Saturday, September 18, 2010

Silverlight security aspects

The below link explains the security aspects of Silverlight. ie differences among the Transparent code,Safe critical code and Critical code along with the theory of user initiation.

Monday, September 13, 2010

Using dynamic keyword in browser interaction

In my general code blog I talked about usage of dynamic keyword in Silverlight browser interaction applications.Here is the sample with source.

Generally the browser interaction is used to communicate with the browser elements from Silverlight application.Its not at all type safe.So we use the general methods like SetProperty to talk to the com objects.

The 'innerText' property isn't defined at compile-time - it's a Javascript property on the div. The way to do this without the dynamic keyword is:

var myDiv = HtmlPage.Document.GetElementById("myDiv");
myDiv.SetProperty("innerText", "Text was replaced!");

We can replace the SetProperty as the real property usage if we use the dynamic keyword.

dynamic myDiv = HtmlPage.Document.GetElementById("myDiv");
myDiv.innerText = "Text was replaced!";

Download the sample from here