Monday, September 27, 2010

Getting Silverlight version

Here is the post which gives you how to get the Silverlight version through Javascript.
http://www.kunal-chowdhury.com/2010/09/how-to-detect-installed-silverlight.html

If you want to get the Silverlight version inside Silverlight code you may invoke this function as follows.
http://silverlightedweb.blogspot.com/2008/05/silverlight-javascript-communication.html

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.

http://msdn.microsoft.com/en-us/library/dd470128%28VS.95%29.aspx

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