<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-8603776122273127789</atom:id><lastBuildDate>Tue, 06 Jan 2026 10:16:19 +0000</lastBuildDate><category>Silverlight 3</category><category>Silverlight 4</category><category>Browser Interaction</category><category>SilverLight 2.0</category><category>Javascript</category><category>Controls</category><category>WCF</category><category>Workarounds</category><category>Application</category><category>Bug</category><category>Prism</category><category>Silverlight Security</category><category>Tutorials</category><category>Books</category><category>ClientBase</category><category>Desklighter</category><category>Documents</category><category>Expression Blend</category><category>HTML 5</category><category>Identitymine</category><category>Paging</category><category>Performance Optimization</category><category>SilverLight1.0</category><category>Silverlight 5</category><category>Standalone Silverlight application</category><category>Styling</category><category>Templating</category><category>VS 2010 Beta</category><category>ASP.Net MVC</category><category>Automated Testing</category><category>Blend 3</category><category>Crossdomain</category><category>Crossfader</category><category>Deeplinking</category><category>F#</category><category>FullScreen</category><category>IntelliSense</category><category>JSON</category><category>Lambda Expression</category><category>Linux</category><category>LocalMessageReceiver</category><category>LocalMessageSender</category><category>MEF</category><category>Media Player</category><category>Memory Leak</category><category>Mobile</category><category>Moonlight</category><category>MouseWheel</category><category>Navigation Application</category><category>Out Of Browser</category><category>Pixel shaders</category><category>Resource Dictionary</category><category>RoutedEvent</category><category>SOS</category><category>SSRS</category><category>SilverLight 2.0 Beta 2</category><category>Silverlight questions</category><category>Silverlight training</category><category>TestComplete</category><category>Transform</category><category>Visual Studio</category><category>WinDbg</category><category>Windows Authentication</category><category>Windows Mobile 7</category><category>dynamic keyword</category><title>My Silverlight experiences</title><description>The blog which is dedicated to Silverlight - The RIA platform from Microsoft.You can find articles,code snippets and tips for Silverlight here.</description><link>http://silverlightedweb.blogspot.com/</link><managingEditor>noreply@blogger.com (Joymon)</managingEditor><generator>Blogger</generator><openSearch:totalResults>80</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-3928914500751850784</guid><pubDate>Sun, 25 Dec 2011 16:50:00 +0000</pubDate><atom:updated>2011-12-25T22:20:12.886+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Silverlight 5</category><category domain="http://www.blogger.com/atom/ns#">Silverlight Security</category><title>How to get unrestricted access in Silverlight 5</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
As you all know Silverlight 5 released with unrestricted access in InBrowser mode which gives full control to the Silverlight developers in the client machine. This post is to describe what are the changes you need to do at the server side as well as client side to leverage the trusted application feature.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Server side &lt;br /&gt;
    &lt;ol&gt;
&lt;li&gt;Make the IB elevated from project properties &lt;/li&gt;
&lt;li&gt;Sign the xap using certificate. &lt;/li&gt;
&lt;/ol&gt;
&lt;br /&gt;
    &lt;ol&gt;&lt;/ol&gt;
&lt;/li&gt;
&lt;li&gt;Client side &lt;br /&gt;
    &lt;ol&gt;
&lt;li&gt;Install the cert into “trusted publishers” &lt;/li&gt;
&lt;li&gt;Change the reg key “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Silverlight\AllowElevatedTrustAppsInBrowser” to 1 &lt;/li&gt;
&lt;li&gt;The “Protected mode” of browser should be turned off for the zone.&lt;/li&gt;
&lt;/ol&gt;
&lt;/li&gt;
&lt;/ul&gt;
The above steps are mainly for Silverlight 4 to Silverlight 5 conversion and want to get the full trust support. If you just upgrading your projects there is no need to do above items. Just open in Visual Studio 2010 after installing the SL 5 tools.It will show the conversion wizard and just follows that. One thing you need to make sure is the reference path to Sl 5 assemblies.&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Steps to setup Silverlight 5 application to have unrestricted access in IB using elevated trust mode&lt;/u&gt;&lt;/strong&gt; &lt;br /&gt;
&lt;br /&gt;
Ok.Now lets look at details of how we can create new SL project which access a file from c:\ in the In-Browse mode.First as usual create a Silverlight 5 Application. Then place a Button inside and wire the Click event handler.Write the below code in the handler to write a file to c:\ &lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; btnWriteToCDrive_Click ( &lt;span style=&quot;color: blue;&quot;&gt;object&lt;/span&gt; sender, RoutedEventArgs e )
{
    File.WriteAllText(&lt;span style=&quot;color: #006080;&quot;&gt;@&quot;c:\FromSL5.txt&quot;&lt;/span&gt;,&lt;span style=&quot;color: #006080;&quot;&gt;&quot;This is written from Silverlight 5 web application in InBrowser mode&quot;&lt;/span&gt;);
}&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;strong&gt;&lt;u&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;strong&gt;&lt;u&gt;Giving Elevated trust to SL 5 application&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Just to go to the Silverlight 5 project properties and in the Silverlight tab check the “Require elevated trust when running in-browser” check box.See the below screen shot for reference.&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2Kw1rE5jgdHncGGTwfTlhwsxnXn7zYtBN-2t3R0WM3wabFsEXOrtNlX4kAwXBBVCJf3ruSjrLJ3cjB03Krg4G9jYjkunwlvlPdeDXfgu1SrrbEabEBr8kG7ytssEhTSCHmEQ5Korzc9k/s576/SL5_FullAccess_2.jpg&quot; /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Signing the xap&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
Next step is to sign the xap file with a certificate. Just goto Silverlight project properties and check the “Sign the Xap File” check box.If you don’t have any certificate just create a new one using the “Create Test Certificate” button.&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhczkht7wEZsf3Zwl2j5J_9_Bp9I8rJdb-cbZubkfsR6nJexBpv-0lF0kybEEbtXemFpSYi1bk0HCSUFy_ONc1egJ2U5-omXaV1p2N6wWcj9x0cAUwQD3oP5iBWmtXP6cxMeVS9nriNlrY/s640/SL5_FullAccess_3.jpg&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Disable the browser protected mode&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
The above changes are mainly for the server side. You need to do some at client side as well.The first one is to disable the protected mode in browser.Goto the internet options and disable it.&lt;img src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjt3gsboWceVM6JK7Y5ONCXSkzT6P89SQoQMa4MAMcw-zRhbGdjYaQkUwjgAVcFC8CWz3EYGQr7rxbXZE_ew9Z9vnVdkD6fjxgmq3AvHZS_wYNeiAALGyXLBwwgirAHYOknfG-rni_OFXo/s512/SL5_FullAccess_1.jpg&quot; /&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;strong&gt;&lt;u&gt;Change registry entry&lt;/u&gt;&lt;/strong&gt;&lt;br /&gt;
&lt;br /&gt;
As mentioned above just change the registry entry as it is.If you cant find the key just add a DWORD and set to 1. Still I am not sure how this step is carried out in other platforms such as MAC and Linux.&lt;br /&gt;
&lt;br /&gt;
That’s it.Now run your application.It will create a file inside c:\ from in browser.Just uploaded the sample by removing the certificate as it give some information about my company laptop &lt;img alt=&quot;Smile&quot; class=&quot;wlEmoticon wlEmoticon-smile&quot; src=&quot;$wlEmoticon-smile[2].png&quot; style=&quot;border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none;&quot; /&gt;&lt;br /&gt;
&lt;iframe frameborder=&quot;0&quot; height=&quot;120&quot; marginheight=&quot;0&quot; marginwidth=&quot;0&quot; scrolling=&quot;no&quot; src=&quot;https://skydrive.live.com/embed?cid=890C06C8106550A0&amp;amp;resid=890C06C8106550A0%21200&amp;amp;authkey=AF6z3obXvIVajP0&quot; style=&quot;background-color: #fcfcfc; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;Preview&quot; width=&quot;98&quot;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;u&gt;Welcome to my general coding blog.&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Most probably this will be my last post in this &lt;a href=&quot;http://silverlightedweb.blogspot.com/&quot;&gt;Silverlight technology blog&lt;/a&gt;. It’s a hard decision to stop this blog and use &lt;a href=&quot;http://joymonscode.blogspot.com/&quot;&gt;my general coding blog&lt;/a&gt; for all the programming related posts. Still I don’t know why I started separate blogs for each technology.May be my knowledge in SEO at that time lead me to have a new blog with technology name in the URL.Anyway changes are needed and I think this is the time to afford that. If possible I will post a last good bye post .Anyway you can start following me in my coding blog where my new Silverlight posts will come soon and it is.&lt;br /&gt;
&lt;a href=&quot;http://joymonscode.blogspot.com/&quot; style=&quot;font-size: 19px; font-weight: bold;&quot;&gt;Joymon v/s Code&lt;/a&gt;&lt;/div&gt;</description><link>http://silverlightedweb.blogspot.com/2011/12/how-to-get-unrestricted-access-in.html</link><author>noreply@blogger.com (Joymon)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2Kw1rE5jgdHncGGTwfTlhwsxnXn7zYtBN-2t3R0WM3wabFsEXOrtNlX4kAwXBBVCJf3ruSjrLJ3cjB03Krg4G9jYjkunwlvlPdeDXfgu1SrrbEabEBr8kG7ytssEhTSCHmEQ5Korzc9k/s72-c/SL5_FullAccess_2.jpg" height="72" width="72"/><thr:total>3</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-1427718061890858836</guid><pubDate>Sun, 11 Dec 2011 15:48:00 +0000</pubDate><atom:updated>2011-12-11T21:18:00.334+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">HTML 5</category><category domain="http://www.blogger.com/atom/ns#">Silverlight 5</category><category domain="http://www.blogger.com/atom/ns#">Silverlight Security</category><title>Silverlight 5 released !! more access or security threat</title><description>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Finally it is released. Earlier than expected.&lt;br /&gt;
&lt;a href=&quot;http://www.silverlight.net/learn/overview/what&#39;s-new-in-silverlight-5&quot;&gt;http://www.silverlight.net/learn/overview/what&#39;s-new-in-silverlight-5&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Nobody said that this is the final version in the Silverlight line as a web technology.But it can be because &amp;nbsp;Microsoft as a product company started promoting HTML 5.Look at their new OS windows 8. We can even write native windows applications using HTML5 and javascript.&lt;br /&gt;
&lt;br /&gt;
For the developers who still think that Silverlight will be available for long as a web technology, I have a small story .No its not a story its the history of web applications which brought RIA.&lt;br /&gt;
&lt;hr /&gt;
&lt;u&gt;&lt;b&gt;The History of RIA&lt;/b&gt;&lt;/u&gt;&lt;br /&gt;
&lt;br /&gt;
Long long ago when speed of the internet connectivity was in single digit Kb/s, developers created browsers and people started using it. The job of the browser was simple. Get a server address known as URL from the user then retrieve some text from that URL address using socket and port, mainly port 80 and show that text to the user. If the retrieved text contains any markup tags, format the text between the start and end tag according to a name of the tag. That tagging or formatting language known as HTML.&lt;br /&gt;
&lt;br /&gt;
Later there came a scripting language which is executed by the browsers .This make people embed some code which will understand the page and even can modify the web page during runtime. But different browsers supported the language in different ways which made it difficult to write programs.&lt;br /&gt;
&lt;br /&gt;
Years passed .The speed of internet connection started expressing in double digits and at some places the unit Kb/s changed to Mb/s along with the fall of connection cost. Then people started thinking about the shortcomings of the HTML. They figured that if they want to draw a curve there is no inbuilt option to draw other than putting an image which adds load to the downloading content.This also reduce the quality when the same page is opened in big screens with high resolution.Another scenario they faced was lack of an option to refresh small portion of page. This demanded the HTML to support more tags and specifications. The people / panel who decides on HTML told changing the HTML specs is a long process. We cannot change it overnight. It will takes years to evolve. You need to continue using the technology as is.&lt;br /&gt;
&lt;br /&gt;
Some smart people effectively utilized this scenario .They didn&#39;t go to change the HTML specifications or the way browser deals with the tags and javascript. They created their own system which has it own run time independent of browser ,programming language, designer applications etc...They just asked browser &quot;Can we get some space in your page?&quot; The browser agreed and in the borrowed space they started playing.&lt;br /&gt;
&lt;br /&gt;
Wow...That was the first impression from people who saw these plug-ins in their browser. Its great,lets put it everywhere.This made a good competition in RIA.RIA is the name given to this technology and it stands for&amp;nbsp;&lt;u&gt;R&lt;/u&gt;ich&amp;nbsp;&lt;u&gt;I&lt;/u&gt;nternet&amp;nbsp;&lt;u&gt;A&lt;/u&gt;pplications. Investments on RIA technology increased rapidly. Even some people started creating their entire application in RIA excluding the HTML. But one day..&lt;br /&gt;
&lt;br /&gt;
As agreed earlier the governing body of HTML, planned to release specs on new version called HTML 5. This has enough tags to support short comings of old HTML, specification for javascript and much more. The RIA world got panic first but after that it settled down and one of them said that &lt;a href=&quot;http://blogs.adobe.com/conversations/2011/11/flash-focus.html&quot;&gt;they are stopping their RIA&lt;/a&gt; and you can have a&lt;a href=&quot;http://labs.adobe.com/technologies/wallaby/&quot;&gt;&amp;nbsp;tool which will convert your RIA applications to HTML 5&lt;/a&gt;. Another RIA vendor said you can even create &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/windows/apps/br211385.aspx&quot;&gt;desktop applications using HTML 5&lt;/a&gt; and Javascript.&lt;br /&gt;
&lt;br /&gt;
Everybody accepted and the world became ready for HTML 5 .Isn&#39;t it?&lt;br /&gt;
&lt;hr /&gt;
&lt;b&gt;&lt;u&gt;What is next with Silverlight 5&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;/b&gt;&lt;br /&gt;
Now Silverlight web developers can directly access so many resources at client side even in the InBrowser mode. From the application developer&#39;s view its a great help,but just think from the system admin&#39;s / security&amp;nbsp;personal&#39;s&amp;nbsp; view. They need to open up machine to an outside web application which may take up anything from the system or do anything to the system. I agree that there are certificates and other security measures. But don&#39;t know why I can&#39;t fully agree with this which makes it less different than a desktop application.&lt;br /&gt;
&lt;br /&gt;
I guess in near future if Silverlight as web technology survives HTML 5 ,we can hear about Silverlight VIRUS or some threat which may make it unacceptable. But as a developer I love Silverlight as it is the technology in Windows Phone :-)&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</description><link>http://silverlightedweb.blogspot.com/2011/12/silverlight-5-released-more-access-or.html</link><author>noreply@blogger.com (Joymon)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-8817526188689099764</guid><pubDate>Mon, 29 Aug 2011 15:49:00 +0000</pubDate><atom:updated>2011-08-29T21:19:00.959+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Bug</category><category domain="http://www.blogger.com/atom/ns#">LocalMessageReceiver</category><category domain="http://www.blogger.com/atom/ns#">LocalMessageSender</category><title>Silverlight local messaging issues with ‘\0’</title><description>&lt;p&gt;When we want to communicate between 2 Silverlight applications locally, we have a framework way to accomplish the same.Its nothing but 2 classes &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/dd459519(v=VS.95).aspx&quot;&gt;LocalMessageSender&lt;/a&gt; and &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.messaging.localmessagereceiver%28VS.95%29.aspx&quot;&gt;LocalMessageReceiver&lt;/a&gt;.Recently we had faced an issue with &lt;a href=&quot;http://silverlightedweb.blogspot.com/2009/03/silverlight-3-beta-local-messaging.html&quot;&gt;local messaging system of Silverlight&lt;/a&gt;.The problem was LocalMessageSender sends a message without any exception but when LocalMessageReceiver receives the message, it is not the same message. Its not incorrect data, &lt;font color=&quot;#ff0000&quot;&gt;but the length itself reduced&lt;/font&gt;.    &lt;br /&gt;We first checked the size of the message which we are sending.It not exceeding &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/dd833063(v=vs.95).aspx&quot;&gt;40KB limit&lt;/a&gt; as per Microsoft.Then we started digging into the project specifics and could see that the data passed is binary data.ie it’s the data got from a BinarySerializer which is just using the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.io.binarywriter(v=VS.95).aspx&quot;&gt;BinaryWriter&lt;/a&gt; Class to make the data as binary.The investigation continued to find the character which says the end of the message at the receiver side. After couple of hours I got the character which is nothing but our famous &lt;strong&gt;&lt;font color=&quot;#ff0000&quot;&gt;&lt;u&gt;‘\0’&lt;/u&gt;&lt;/font&gt;&lt;/strong&gt; which was used in C &amp;amp; C++ to denote as end of string.     &lt;br /&gt;Our binary serializer was adding this character while serializing the objects. Since the serializer internally uses BinaryWriter, this happens by the BinaryWriter when serializing numbers. I have checked .Net string specification and it says the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.string.aspx#EmbeddedNulls&quot;&gt;string is represented using its length rather than the old ‘\0’ style&lt;/a&gt;. But don’t know why in local message sending, this is happening.    &lt;br /&gt;You can reproduce it simply.Try to send the message &amp;quot;Joy\0George&amp;quot; it will transmit or receives only ‘Joy’.I am not sure which communication end is cutting the message.&lt;/p&gt;  &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;   &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; btnJSON_Click(&lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt; sender, RoutedEventArgs e)&lt;br /&gt;{&lt;br /&gt;    SendMessage(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;joy\0George&amp;quot;&lt;/span&gt;);&lt;br /&gt;}&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; SendMessage(&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; serialized)&lt;br /&gt;{&lt;br /&gt;    MessageBox.Show(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Length:&amp;quot;&lt;/span&gt;+serialized.Length.ToString());&lt;br /&gt;    LocalMessageSender sender = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; LocalMessageSender(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;TestPoint&amp;quot;&lt;/span&gt;);&lt;br /&gt;    sender.SendCompleted += &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; EventHandler&amp;lt;SendCompletedEventArgs&amp;gt;(sender_SendCompleted);&lt;br /&gt;    sender.SendAsync(serialized);&lt;br /&gt;}&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; sender_SendCompleted(&lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt; sender, SendCompletedEventArgs e)&lt;br /&gt;{&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (e.Error != &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;) MessageBox.Show(e.Error.ToString());&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Here is the receiving end.&lt;br /&gt;  &lt;br /&gt;&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;  &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt; ListenForMessage()&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Dim&lt;/span&gt; receiver &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt; LocalMessageReceiver(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;TestPoint&amp;quot;&lt;/span&gt;)&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;AddHandler&lt;/span&gt; receiver.MessageReceived, &lt;span style=&quot;color: #0000ff&quot;&gt;AddressOf&lt;/span&gt; Received&lt;br /&gt;    receiver.Listen()&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt; Received(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; MessageReceivedEventArgs)&lt;br /&gt;    MessageBox.Show(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Length &amp;quot;&lt;/span&gt; + e.Message.Length.ToString())&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;DirectCast&lt;/span&gt;(sender, IDisposable).Dispose()&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Don’t confuse with the C# and VB.Net code.All will compile into same ILCode &lt;img style=&quot;border-bottom-style: none; border-left-style: none; border-top-style: none; border-right-style: none&quot; class=&quot;wlEmoticon wlEmoticon-smile&quot; alt=&quot;Smile&quot; src=&quot;http://lh3.ggpht.com/-v6ZGMDEi_1A/TklAM_1-3DI/AAAAAAAAOWo/FSE-OG20NW8/wlEmoticon-smile2.png?imgmax=800&quot; /&gt;.At the sending side the length will be 10 and receiving end the length will be 3 if we send the above mentioned string which has ‘\0’.&amp;#160; &lt;br /&gt;&lt;br /&gt;&lt;p&gt;I can guess that Microsoft uses unmanaged modules to accomplish the communication which takes ‘\0’ as end of string. Anyway I have posted in &lt;a href=&quot;http://forums.silverlight.net/t/236755.aspx/1?Issues+with+LocalMessageSender+if+the+message+contains+0+&quot;&gt;Silverlight forums&lt;/a&gt;. &lt;/p&gt;  </description><link>http://silverlightedweb.blogspot.com/2011/08/silverlight-local-messaging-issues-with.html</link><author>noreply@blogger.com (Joymon)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/-v6ZGMDEi_1A/TklAM_1-3DI/AAAAAAAAOWo/FSE-OG20NW8/s72-c/wlEmoticon-smile2.png?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-4882446532009654003</guid><pubDate>Mon, 22 Aug 2011 17:50:00 +0000</pubDate><atom:updated>2011-08-22T23:20:00.363+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">ClientBase</category><category domain="http://www.blogger.com/atom/ns#">Silverlight 4</category><category domain="http://www.blogger.com/atom/ns#">WCF</category><category domain="http://www.blogger.com/atom/ns#">Workarounds</category><title>Adding custom EndPoint Behavior at client side ServiceReferences.ClientConfig</title><description>&lt;p&gt;A custom Endpoint behavior which implements &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.servicemodel.description.iendpointbehavior(v=vs.95).aspx&quot;&gt;IEndpointBehavior&lt;/a&gt; can be added for many purposes. That depends upon your requirements and the nature of the application you are working on. But interesting thing is you &lt;u&gt;cannot add the EndpointBehavior through config&lt;/u&gt; in Silverlight 4. But supports addition of &lt;u&gt;custom Endpoint Behaviors through code&lt;/u&gt; .ie after creating the proxy you may add the behavior to the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.servicemodel.description.serviceendpoint.behaviors(v=vs.95).aspx&quot;&gt;Endpoint.Behaviors&lt;/a&gt; collection of proxy.As you know, here proxy is a derived class of &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms576141(v=vs.95).aspx&quot;&gt;ClientBase&amp;lt;T&amp;gt;&lt;/a&gt; and this class has the property &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms553831(v=vs.95).aspx&quot;&gt;Endpoint&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Passing ClientBase&amp;lt;T&amp;gt; objects as method arguments&lt;/u&gt;&lt;/strong&gt;     &lt;br /&gt;Next question comes how to make the code to add end point more generic in order to reuse the code for all the WCF service proxies.ie we need to write a method which accepts ClientBase&amp;lt;T&amp;gt;.This is little tricky at first look .But please don’t go for &lt;a href=&quot;http://silverlightedweb.blogspot.com/search/label/dynamic%20keyword&quot;&gt;dynamic&lt;/a&gt; keyword or &lt;a href=&quot;http://joymonscode.blogspot.com/2010/09/difference-between-dynamic-var-and.html&quot;&gt;object&lt;/a&gt; where we have a typed way.Here is the small code snippet to use &lt;u&gt;ClientBase&amp;lt;T&amp;gt; as method parameter type&lt;/u&gt; in C#. &lt;/p&gt;  &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;   &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; CreateProxy()&lt;br /&gt;{&lt;br /&gt;    TestServiceReference.TestServiceClient client = &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; TestServiceReference.TestServiceClient();&lt;br /&gt;    AddMyEndpointBahavior &amp;lt; TestServiceReference.ITestService&amp;gt;(client);&lt;br /&gt;}&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; AddMyEndpointBahavior&amp;lt;T&amp;gt;(ClientBase&amp;lt;T&amp;gt; client) &lt;span style=&quot;color: #0000ff&quot;&gt;where&lt;/span&gt; T :&lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt;&lt;br /&gt;{&lt;br /&gt;    client.Endpoint.Behaviors.Add(&lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; MyEndpointBehavior());&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;For VB.Net version see &lt;a href=&quot;http://joymonscode.blogspot.com/2011/08/using-generic-type-variables-as-method.html&quot;&gt;my general coding blog&lt;/a&gt; where I posted this first since it is more related to generics. &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;  </description><link>http://silverlightedweb.blogspot.com/2011/08/adding-custom-endpoint-behavior-at.html</link><author>noreply@blogger.com (Joymon)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-1393753969314220261</guid><pubDate>Mon, 15 Aug 2011 17:14:00 +0000</pubDate><atom:updated>2011-08-15T22:44:01.257+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Application</category><category domain="http://www.blogger.com/atom/ns#">Controls</category><category domain="http://www.blogger.com/atom/ns#">Performance Optimization</category><category domain="http://www.blogger.com/atom/ns#">Silverlight 4</category><category domain="http://www.blogger.com/atom/ns#">WCF</category><category domain="http://www.blogger.com/atom/ns#">Workarounds</category><title>Changing Application.RootVisual at runtime</title><description>&lt;p&gt;If you are a &lt;em&gt;Silverlight Island programmer&lt;/em&gt;, this will not applicable to you because you will never face a situation which demands to change the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.application.rootvisual(v=vs.95).aspx&quot;&gt;Application.RootVisual&lt;/a&gt; property. Don’t confuse the word Island programmer ,it simply refers to the programmers who are creating small sized Silverlight applications mainly with some animations to fit into a small portion of HTML page which may be static or emitted by technologies such as ASP.Net or PHP.&lt;/p&gt;  &lt;p&gt;Sometimes I feel that the Silverlight is more suited to Island programs than full window business apps. There are so many reasons.One is its rich user interface capabilities.This is more needed for glazy island apps than business apps. When we talk about great user experience there is always some cost attached to it which reduces performance. The performance is more important when we come to business apps than the user interface. In some of the tests we could see that the UI rendering takes more time than the WCF service in the whole display cycle. This happens when the data elements are huge in number but small and has complex data templates.&lt;/p&gt;  &lt;p&gt;Ok.Coming back to changing Application.RootVisual multiple times at runtime. There may be scenarios where you need to show your authentication UI first and then load your application XAPs and the actual UI pages. In this case you need to change the RootVisual for sure.But this is not supported by the Silverlight runtime. First of all if you simply change, it will not change.You will get the below exception when you try to set null first and assign another visual after that.&lt;/p&gt;  &lt;p&gt;&lt;font color=&quot;#ff0000&quot;&gt;Invalid value set for application&#39;s RootVisual&lt;/font&gt;&lt;/p&gt;  &lt;p&gt;ie the below code will result into System.InvalidOperationException&#39; in System.Windows.dll&lt;/p&gt;  &lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;   &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #008000&quot;&gt;&#39;This will result in System.InvalidOperationException occurred in System.Windows.dll&lt;/span&gt;&lt;br /&gt;Application.Current.RootVisual = &lt;span style=&quot;color: #0000ff&quot;&gt;Nothing&lt;/span&gt;&lt;br /&gt;Application.Current.RootVisual = &lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt; TextBox &lt;span style=&quot;color: #0000ff&quot;&gt;With&lt;/span&gt; {.Text = &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;changed&amp;quot;&lt;/span&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;So what is the simple solution.Keep a &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.controls.contentcontrol(v=vs.95).aspx&quot;&gt;ContentControl&lt;/a&gt; as your RootVisual and set your Login UI and Application UI pages as its content.In the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.application.startup(v=VS.95).aspx&quot;&gt;Application_Startup&lt;/a&gt; event set a ContentControl as your RootVisual then add initial UI to that. Later cast the RootVisual as ContentControl and change its &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.controls.contentcontrol.content(v=vs.95).aspx&quot;&gt;Content property&lt;/a&gt;. &lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px&quot; id=&quot;codeSnippetWrapper&quot;&gt;&lt;br /&gt;  &lt;pre style=&quot;border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px&quot; id=&quot;codeSnippet&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt; Application_Startup(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; o &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; StartupEventArgs) &lt;span style=&quot;color: #0000ff&quot;&gt;Handles&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Me&lt;/span&gt;.Startup&lt;br /&gt;    &lt;span style=&quot;color: #008000&quot;&gt;&#39;Initial UI.Here its button&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Dim&lt;/span&gt; btnChangeRootVisual &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt; Button() &lt;span style=&quot;color: #0000ff&quot;&gt;With&lt;/span&gt; {.Content = &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Change RootVisual&amp;quot;&lt;/span&gt;}&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;AddHandler&lt;/span&gt; btnChangeRootVisual.Click, &lt;span style=&quot;color: #0000ff&quot;&gt;AddressOf&lt;/span&gt; btnChangeRootVisual_Click&lt;br /&gt;    &lt;br /&gt;    &lt;span style=&quot;color: #008000&quot;&gt;&#39;ContentControl as RootVisual&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Me&lt;/span&gt;.RootVisual = &lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt; ContentControl() &lt;span style=&quot;color: #0000ff&quot;&gt;With&lt;/span&gt; {.Content = btnChangeRootVisual}&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt; btnChangeRootVisual_Click(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; sender &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; e &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; RoutedEventArgs)&lt;br /&gt;    &lt;span style=&quot;color: #008000&quot;&gt;&#39;Get the ContentControl and assign new UI to its content property&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Dim&lt;/span&gt; rootContentControl &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; ContentControl = &lt;span style=&quot;color: #0000ff&quot;&gt;DirectCast&lt;/span&gt;(Application.Current.RootVisual, ContentControl)&lt;br /&gt;    rootContentControl.Content = &lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt; TextBox &lt;span style=&quot;color: #0000ff&quot;&gt;With&lt;/span&gt; {.Text = &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;changed&amp;quot;&lt;/span&gt;}&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; Sub&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;  &lt;br /&gt;&lt;/div&gt;&lt;br /&gt;This is just a hack for real business application programmers of Silverlight. &lt;br /&gt;&lt;br /&gt;  </description><link>http://silverlightedweb.blogspot.com/2011/08/changing-applicationrootvisual-at.html</link><author>noreply@blogger.com (Joymon)</author><thr:total>9</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-2625226680905458519</guid><pubDate>Thu, 30 Dec 2010 08:47:00 +0000</pubDate><atom:updated>2010-12-30T14:17:26.221+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Automated Testing</category><category domain="http://www.blogger.com/atom/ns#">Silverlight 4</category><category domain="http://www.blogger.com/atom/ns#">TestComplete</category><title>TestComplete now supports Silverlight 4</title><description>&lt;p&gt;Today I got chance to work with TestComplete to automate a Silverlight application.&lt;/p&gt;  &lt;p&gt;&lt;a title=&quot;http://www.automatedqa.com/blogs/post/10-12-09/TestComplete-8-10-Enhanced-Support-for-Silverlight-4-Applications.aspx&quot; href=&quot;http://www.automatedqa.com/blogs/post/10-12-09/TestComplete-8-10-Enhanced-Support-for-Silverlight-4-Applications.aspx&quot;&gt;http://www.automatedqa.com/blogs/post/10-12-09/TestComplete-8-10-Enhanced-Support-for-Silverlight-4-Applications.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If you need to get the support for Silverlight object recognition you need to patch your xap with a TestComplete utility. The patch just adds 2 dlls into your xap and updates the AppManifest.xaml file.&lt;/p&gt;  &lt;p&gt;We have an application which uses same code base for WPF as well as Silverlight .Hope our WPF test scripts will execute for testing Silverlight version as well.&lt;/p&gt;  </description><link>http://silverlightedweb.blogspot.com/2010/12/testcomplete-now-supports-silverlight-4.html</link><author>noreply@blogger.com (Joymon)</author><thr:total>4</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-3055251426061143761</guid><pubDate>Mon, 22 Nov 2010 17:43:00 +0000</pubDate><atom:updated>2010-11-22T23:13:31.199+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">HTML 5</category><category domain="http://www.blogger.com/atom/ns#">Silverlight questions</category><category domain="http://www.blogger.com/atom/ns#">Silverlight training</category><title>Silverlight training - some questions</title><description>&lt;p&gt;After a while I had to conduct training in my company.Earlier &lt;a href=&quot;http://joyfulwpf.blogspot.com/2009/08/wpf-training-at-orion.html&quot;&gt;it was WPF&lt;/a&gt; and now the topic is Silverlight.I dont know whether Silverlight training is relevant now because of HTML 5.According to me next version of ASP.Net may be 5.0 or 6.0 will emit html5 which may reduce the need of Silverlight in the RIA world.But in other context Silverlight is valuable because of Windows 7 mobile development.&lt;/p&gt;  &lt;p&gt;Anyway I have started training and conducted one small test in order to evaluate my students.I am not going to share their scores but some questions I have asked.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Which code snippet determines whether the Silverlight application is running inside browser or OOB?      &lt;ol&gt;       &lt;li&gt;App.GetState() &lt;/li&gt;        &lt;li&gt;System.Windows.Application.Current.IsRunningOutOfBrowser &lt;/li&gt;        &lt;li&gt;System.AppDomain.CurrentDomain.IsRunningOutOfBrowser &lt;/li&gt;        &lt;li&gt;Silverlight.IsRunningOutOfBrowser &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt;    &lt;li&gt;Can we create folder in IsolatedStorage? (Yes/No) &lt;/li&gt;    &lt;li&gt;Can we redirect the browser to a ASPX/HTML page from Silverlight?(Yes/No) &lt;/li&gt;    &lt;li&gt;What is possible in OOB without using COM objects?      &lt;ol&gt;       &lt;li&gt;Access registry &lt;/li&gt;        &lt;li&gt;Access file from C: drive &lt;/li&gt;        &lt;li&gt;Access file from MyDocuments &lt;/li&gt;        &lt;li&gt;All &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt;    &lt;li&gt;Is it possible to refer a WPF 4.0 dll in Silverlight? (Yes/No) &lt;/li&gt;    &lt;li&gt;Where we normally specify the window less mode?&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;ol&gt;       &lt;li&gt;Hosting HTML page &lt;/li&gt;        &lt;li&gt;App.xaml.vb &lt;/li&gt;        &lt;li&gt;MainPage.xaml.vb &lt;/li&gt;        &lt;li&gt;None of the above&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt;    &lt;li&gt;Where is isolated storage located?      &lt;ol&gt;       &lt;li&gt;Main memory of server &lt;/li&gt;        &lt;li&gt;Hard disk of client &lt;/li&gt;        &lt;li&gt;Main memory of client &lt;/li&gt;        &lt;li&gt;Database &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt;    &lt;li&gt;Can &amp;lt;Resources&amp;gt; tag in a xaml page contain a boolean value?(Yes/No) &lt;/li&gt;    &lt;li&gt;Can we write code behind of ABC.xaml in XYZ.vb? (Yes/No) &lt;/li&gt;    &lt;li&gt;Can Silverlight application access ASP.Net Session variable? &lt;/li&gt;    &lt;li&gt;How Silverlight application gets values from its browser host at initialization time?&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;ol&gt;       &lt;li&gt;Through constructor of App class&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/li&gt;        &lt;li&gt;Through Environment.CommandLine property&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/li&gt;        &lt;li&gt;Using ProvideInitValues event&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/li&gt;        &lt;li&gt;None of the above &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt;    &lt;li&gt;How to add a resource programatically?      &lt;ol&gt;       &lt;li&gt;Me.Resources.Add(1, New SolidColorBrush(Colors.Green)) &lt;/li&gt;        &lt;li&gt;Me.Resources.AddResource(1, New SolidColorBrush(Colors.Green)) &lt;/li&gt;        &lt;li&gt;Me.AddResource(&amp;quot;mycolor&amp;quot;, New SolidColorBrush(Colors.Green)) &lt;/li&gt;        &lt;li&gt;None of the above &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt;    &lt;li&gt;What is the base class of UserControl class?&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;ol&gt;       &lt;li&gt;Control &lt;/li&gt;        &lt;li&gt;UIElement &lt;/li&gt;        &lt;li&gt;DependencyObject &lt;/li&gt;        &lt;li&gt;UserControlBase&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/li&gt;     &lt;/ol&gt;   &lt;/li&gt;    &lt;li&gt;How Silverlight application can access SQL database ?      &lt;ul&gt;       &lt;li&gt;Through SQLDataAdapter &lt;/li&gt;        &lt;li&gt;Through ODBC connection &lt;/li&gt;        &lt;li&gt;Using WebService &lt;/li&gt;        &lt;li&gt;Using Windows service&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Last question was to create a simple &amp;lt;Grid&amp;gt; based layout of a login page. &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;If you are a Silverlight developer you may feel that some questions are silly or too simple.But my students are in different categories.Some had projects in Silverlight others are hearing word Silverlight for the first time.So its a mix and people can just start learning concepts even if they are not able to answer.&lt;/p&gt;  &lt;p&gt;Hope I don’t have to provide answers to these questions since all are known.Let me know if anybody needs clarification.&lt;/p&gt;  &lt;p&gt;NB: These are not Silverlight interview questions and I think nobody will ask these type of questions in interview.&lt;/p&gt;  </description><link>http://silverlightedweb.blogspot.com/2010/11/silverlight-training-some-questions.html</link><author>noreply@blogger.com (Joymon)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-5037776012677060190</guid><pubDate>Tue, 05 Oct 2010 17:02:00 +0000</pubDate><atom:updated>2010-10-05T22:32:09.396+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Silverlight 4</category><title>Why it is asking to update Silverlight version</title><description>&lt;p&gt;So&amp;#160; many times I have seen this type of messages in dev environment.Now understood what was the reason..I was doing the same without knowing the actual facts.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://timheuer.com/blog/archive/2010/09/28/keeping-your-silverlight-dev-environment-stable-through-service-releases.aspx&quot;&gt;http://timheuer.com/blog/archive/2010/09/28/keeping-your-silverlight-dev-environment-stable-through-service-releases.aspx&lt;/a&gt;&lt;/p&gt;  </description><link>http://silverlightedweb.blogspot.com/2010/10/why-it-is-asking-to-update-silverlight.html</link><author>noreply@blogger.com (Joymon)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-7576228647318857666</guid><pubDate>Mon, 27 Sep 2010 08:34:00 +0000</pubDate><atom:updated>2010-09-27T14:04:43.749+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Browser Interaction</category><category domain="http://www.blogger.com/atom/ns#">Javascript</category><title>Getting Silverlight version</title><description>&lt;p&gt;Here is the post which gives you how to get the Silverlight version through Javascript.    &lt;br /&gt;&lt;a title=&quot;http://www.kunal-chowdhury.com/2010/09/how-to-detect-installed-silverlight.html&quot; href=&quot;http://www.kunal-chowdhury.com/2010/09/how-to-detect-installed-silverlight.html&quot;&gt;http://www.kunal-chowdhury.com/2010/09/how-to-detect-installed-silverlight.html&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;If you want to get the Silverlight version inside Silverlight code you may invoke this function as follows.    &lt;br /&gt;&lt;a title=&quot;http://silverlightedweb.blogspot.com/2008/05/silverlight-javascript-communication.html&quot; href=&quot;http://silverlightedweb.blogspot.com/2008/05/silverlight-javascript-communication.html&quot;&gt;http://silverlightedweb.blogspot.com/2008/05/silverlight-javascript-communication.html&lt;/a&gt;&lt;/p&gt;  </description><link>http://silverlightedweb.blogspot.com/2010/09/getting-silverlight-version.html</link><author>noreply@blogger.com (Joymon)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-746875920269443228</guid><pubDate>Sat, 18 Sep 2010 10:28:00 +0000</pubDate><atom:updated>2010-09-18T15:58:55.595+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Silverlight Security</category><title>Silverlight security aspects</title><description>&lt;p&gt;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.&lt;/p&gt;  &lt;p&gt;&lt;a title=&quot;http://msdn.microsoft.com/en-us/library/dd470128%28VS.95%29.aspx&quot; href=&quot;http://msdn.microsoft.com/en-us/library/dd470128%28VS.95%29.aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/dd470128%28VS.95%29.aspx&lt;/a&gt;&lt;/p&gt;  </description><link>http://silverlightedweb.blogspot.com/2010/09/silverlight-security-aspects.html</link><author>noreply@blogger.com (Joymon)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-8394041803187849912</guid><pubDate>Mon, 13 Sep 2010 07:44:00 +0000</pubDate><atom:updated>2010-09-13T13:15:01.054+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Browser Interaction</category><category domain="http://www.blogger.com/atom/ns#">dynamic keyword</category><category domain="http://www.blogger.com/atom/ns#">Silverlight 4</category><title>Using dynamic keyword in browser interaction</title><description>&lt;p&gt;In my general code blog I talked about usage of dynamic keyword in Silverlight browser interaction applications.Here is the sample with source. &lt;br /&gt;   &lt;br /&gt;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.  &lt;br /&gt;   &lt;br /&gt;The &#39;innerText&#39; property isn&#39;t defined at compile-time - it&#39;s a Javascript property on the div. The way to do this without the dynamic keyword is: &lt;/p&gt;  &lt;div style=&quot;border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px&quot;&gt;   &lt;pre style=&quot;border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;var myDiv = HtmlPage.Document.GetElementById(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;myDiv&amp;quot;&lt;/span&gt;);&lt;br /&gt;myDiv.SetProperty(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;innerText&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Text was replaced!&amp;quot;&lt;/span&gt;);&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;We can replace the SetProperty as the real property usage if we use the dynamic keyword.&lt;br /&gt;&lt;div style=&quot;border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px&quot;&gt;&lt;br /&gt;  &lt;pre style=&quot;border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;dynamic myDiv = HtmlPage.Document.GetElementById(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;myDiv&amp;quot;&lt;/span&gt;);&lt;br /&gt;myDiv.innerText = &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Text was replaced!&amp;quot;&lt;/span&gt;;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;Download the sample from &lt;a href=&quot;http://cid-890c06c8106550a0.office.live.com/self.aspx/BlogSamples/JoymonsCode/DynamicVar.zip&quot;&gt;here&lt;/a&gt;&lt;/p&gt;  </description><link>http://silverlightedweb.blogspot.com/2010/09/using-dynamic-keyword-in-browser.html</link><author>noreply@blogger.com (Joymon)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-6032076282545411763</guid><pubDate>Sun, 08 Aug 2010 17:48:00 +0000</pubDate><atom:updated>2010-08-08T23:22:44.371+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Application</category><category domain="http://www.blogger.com/atom/ns#">Browser Interaction</category><category domain="http://www.blogger.com/atom/ns#">Documents</category><category domain="http://www.blogger.com/atom/ns#">Silverlight 4</category><title>Single window F1 help in Silverlight</title><description>&lt;p&gt;I know the title is confusing.You will know why I gave this title when you read further.When we talk about the Rich Internet Application we could see that they are half desktop and half web.The UI resembles a desktop application but they behave like web applications.&lt;/p&gt;  &lt;p&gt;As we know all the desktop applications comes with a help.We all would like to have a help popup on F1 key when we are struck on a desktop’s functionality. The same applies to RIA.Due to its richness like desktop we should have a F1 help window.This post talks about implementing a F1 help window for Silverlight applications.&lt;/p&gt;  &lt;p&gt;Basically we need to capture the F1 key and show a popup.I don’t think people expects a huge hlp file on F1 because this is web and downloading a big file will take time.So better we can choose html or asp.net based help which are context based and easy to load. Now the things are simple just show a html popup on F1 press.&lt;/p&gt;  &lt;p&gt;Here I am adding one good feature of Silverlight.Attached properties. This extends one class by introducing a new property implemented in another class.I am not going into details of attached properties.We can write a HelpProvier class which holds the attached property so that we can set the help source as follows from anywhere in our application.&lt;/p&gt;  &lt;div style=&quot;border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px&quot;&gt;   &lt;pre style=&quot;border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;UserControl&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;x:Class&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;F1Help.MainPage&amp;quot;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #ff0000&quot;&gt;xmlns&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #ff0000&quot;&gt;xmlns:x&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #ff0000&quot;&gt;xmlns:local&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;clr-namespace:F1Help&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;Grid&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;x:Name&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;LayoutRoot&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;Background&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;White&amp;quot;&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;local:HelpProvider&lt;/span&gt;.&lt;span style=&quot;color: #ff0000&quot;&gt;Source&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;help.htm&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;TextBox&lt;/span&gt; &lt;span style=&quot;color: #ff0000&quot;&gt;Text&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;=&amp;quot;Enter the datas here&amp;quot;&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;TextBox&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;Grid&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;lt;/&lt;/span&gt;&lt;span style=&quot;color: #800000&quot;&gt;UserControl&lt;/span&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Lets see how the HelpProvider is processing the F1 key.&lt;br /&gt;&lt;div style=&quot;border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px&quot;&gt;&lt;br /&gt;  &lt;pre style=&quot;border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;using&lt;/span&gt; System;&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;using&lt;/span&gt; System.Net;&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;using&lt;/span&gt; System.Windows;&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;using&lt;/span&gt; System.Windows.Controls;&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;using&lt;/span&gt; System.Windows.Documents;&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;using&lt;/span&gt; System.Windows.Ink;&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;using&lt;/span&gt; System.Windows.Input;&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;using&lt;/span&gt; System.Windows.Media;&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;using&lt;/span&gt; System.Windows.Media.Animation;&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;using&lt;/span&gt; System.Windows.Shapes;&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;using&lt;/span&gt; System.Windows.Browser;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;namespace&lt;/span&gt; F1Help&lt;br /&gt;{&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; HelpProvider&lt;br /&gt;    {&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;static&lt;/span&gt; Uri GetSource(DependencyObject obj)&lt;br /&gt;        {&lt;br /&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; (Uri)obj.GetValue(SourceProperty);&lt;br /&gt;        }&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; SetSource(DependencyObject obj, Uri &lt;span style=&quot;color: #0000ff&quot;&gt;value&lt;/span&gt;)&lt;br /&gt;        {&lt;br /&gt;            obj.SetValue(SourceProperty, &lt;span style=&quot;color: #0000ff&quot;&gt;value&lt;/span&gt;);&lt;br /&gt;        }&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;readonly&lt;/span&gt; DependencyProperty SourceProperty =&lt;br /&gt;            DependencyProperty.RegisterAttached(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Source&amp;quot;&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;typeof&lt;/span&gt;(Uri), &lt;span style=&quot;color: #0000ff&quot;&gt;typeof&lt;/span&gt;(HelpProvider), &lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; PropertyMetadata(OnSourcePropertyChanged));&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; OnSourcePropertyChanged(&lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt; sender, DependencyPropertyChangedEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (e.NewValue != &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt; &amp;amp;&amp;amp; e.NewValue &lt;span style=&quot;color: #0000ff&quot;&gt;is&lt;/span&gt; Uri)&lt;br /&gt;            {&lt;br /&gt;                FrameworkElement element = sender &lt;span style=&quot;color: #0000ff&quot;&gt;as&lt;/span&gt; FrameworkElement;&lt;br /&gt;                    element.KeyDown+=&lt;span style=&quot;color: #0000ff&quot;&gt;new&lt;/span&gt; KeyEventHandler(element_KeyDown);&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; element_KeyDown(&lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt; sender, KeyEventArgs e)&lt;br /&gt;        {&lt;br /&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (e.Key == Key.F1)&lt;br /&gt;            {&lt;br /&gt;                e.Handled = &lt;span style=&quot;color: #0000ff&quot;&gt;true&lt;/span&gt;;&lt;br /&gt;                e = &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;;&lt;br /&gt;                &lt;span style=&quot;color: #0000ff&quot;&gt;if&lt;/span&gt; (GetSource(sender &lt;span style=&quot;color: #0000ff&quot;&gt;as&lt;/span&gt; DependencyObject) != &lt;span style=&quot;color: #0000ff&quot;&gt;null&lt;/span&gt;)&lt;br /&gt;                {&lt;br /&gt;                    ShowHelpFile(GetSource(sender &lt;span style=&quot;color: #0000ff&quot;&gt;as&lt;/span&gt; DependencyObject));&lt;br /&gt;                }&lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;static&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;void&lt;/span&gt; ShowHelpFile(Uri source)&lt;br /&gt;        {&lt;br /&gt;            HtmlPage.Window.Navigate(source, &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;new&amp;quot;&lt;/span&gt;);&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;The code is self explanatory.In the property changed method we are subscribing to the keydown event of the UIElement which requested help implementation.The event handler shows the htm file in a popup.Simple…&lt;br/&gt;&lt;br /&gt;But you can see yourself this is not as simple as we thought when you run the app.F1 will show our help as well as browser help.The user needs our help only when he is in our application.So we need to avoid browser help at any cost.What to do? I know what everybody thinking as web developers.Yes Javascript…&lt;br/&gt;&lt;br /&gt;&lt;div style=&quot;border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px&quot;&gt;&lt;br /&gt;  &lt;pre style=&quot;border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;function&lt;/span&gt; HideHelp() {&lt;br /&gt;    document.onhelp = &lt;span style=&quot;color: #0000ff&quot;&gt;function&lt;/span&gt; () { &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; (&lt;span style=&quot;color: #0000ff&quot;&gt;false&lt;/span&gt;); }&lt;br /&gt;    window.onhelp = &lt;span style=&quot;color: #0000ff&quot;&gt;function&lt;/span&gt; () { &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; (&lt;span style=&quot;color: #0000ff&quot;&gt;false&lt;/span&gt;); }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;Call this function on document.onload.This is tested only in IE 8.Sample can be downloaded from &lt;a href=&quot;http://cid-890c06c8106550a0.office.live.com/self.aspx/BlogSamples/SilverlightedWeb/F1Help.zip&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;  </description><link>http://silverlightedweb.blogspot.com/2010/08/single-window-f1-help-in-silverlight.html</link><author>noreply@blogger.com (Joymon)</author><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-4817541363592561619</guid><pubDate>Mon, 17 May 2010 13:52:00 +0000</pubDate><atom:updated>2010-05-17T19:22:11.363+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Out Of Browser</category><title>Location of OOB xap file in local file system</title><description>&lt;p&gt;Everybody knows that there is Out of browser support in Silverlight 3 and Silverlight 4.Basically how it is working? Its simple.It downloads the xap file into a local folder and runs the xap from that location as similar to in browser.But with some more privileges.&lt;/p&gt;  &lt;p&gt;All that are fine.So to which location the xap files is getting downloaded in my local machine? It’s very easy to find out.Right click on the OOB application icon in desktop and get select properties.You can get the application id.Using that application id you can find the application folder in the Out-of-browser cache in the below location.&lt;/p&gt;  &lt;p&gt;C:\Users\&amp;lt;login id&amp;gt;\AppData\Local\Microsoft\Silverlight\OutOfBrowser&lt;/p&gt;  </description><link>http://silverlightedweb.blogspot.com/2010/05/location-of-oob-xap-file-in-local-file.html</link><author>noreply@blogger.com (Joymon)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-5231004111560144079</guid><pubDate>Sat, 24 Apr 2010 17:22:00 +0000</pubDate><atom:updated>2010-04-24T22:52:08.736+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Controls</category><category domain="http://www.blogger.com/atom/ns#">Silverlight 4</category><title>Silverlight 4 RichTextBox lab</title><description>&lt;p&gt;Got the below lab when I was looking for the usage of &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.controls.richtextbox%28v=VS.95%29.aspx&quot;&gt;RichTextBox&lt;/a&gt; in Silverlight 4.This gives an idea how to use RichTextBox.&lt;/p&gt;  &lt;p&gt;&lt;a href=&quot;http://channel9.msdn.com/learn/courses/Silverlight4/NewFeatures/RichTextBox/&quot;&gt;http://channel9.msdn.com/learn/courses/Silverlight4/NewFeatures/RichTextBox/&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;More labs &lt;a href=&quot;http://channel9.msdn.com/learn/courses/Silverlight4/NewFeatures/&quot;&gt;here&lt;/a&gt;&lt;/p&gt;  </description><link>http://silverlightedweb.blogspot.com/2010/04/silverlight-4-richtextbox-lab.html</link><author>noreply@blogger.com (Joymon)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-2387648374847577029</guid><pubDate>Tue, 20 Apr 2010 19:20:00 +0000</pubDate><atom:updated>2010-04-21T00:51:41.157+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Silverlight 4</category><category domain="http://www.blogger.com/atom/ns#">Workarounds</category><title>Parser internal error: Object writer &amp;#39;xClassNotDerivedFromElement&amp;#39;</title><description>&lt;p&gt;If you are a Silverlight developer there is a chance that you may get the exception “Parser internal error: Object writer &#39;xClassNotDerivedFromElement&#39;” very rarely which is difficult to track.Even you can’t put break points to track this.As a developer you will google the same.But most probably you will not get any results.&lt;/p&gt;  &lt;p&gt;Only thing went wrong here is the namespace.But this is not at all mentioned in any of the exception details.ie The project which you are working on will not have a namespace or somebody in the project might forgot put the namespace in XAML or code files.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;So make sure that there is namespace present in the project and the xaml files are correctly mapped to the corresponding code files in the x:Class attribute.&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Note :&lt;/strong&gt; &lt;em&gt;We cannot have Silverlight projects without namespace.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;I came to see this exception when one of my colleagues tried to write code which should&amp;#160; compile in both Silverlight 4 and WPF 4.&lt;/p&gt;  </description><link>http://silverlightedweb.blogspot.com/2010/04/parser-internal-error-object-writer.html</link><author>noreply@blogger.com (Joymon)</author><thr:total>11</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-5806831754045661996</guid><pubDate>Sat, 20 Mar 2010 13:56:00 +0000</pubDate><atom:updated>2010-03-20T19:36:16.986+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">ClientBase</category><category domain="http://www.blogger.com/atom/ns#">Silverlight 4</category><category domain="http://www.blogger.com/atom/ns#">WCF</category><title>Creating WCF proxy without reference</title><description>&lt;p&gt;&lt;u&gt;The problem : Creating WCF proxy in Silverlight without using the add service reference and it’s auto generated code&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;It was a debate that whether we can call a WCF service from Silverlight without using “Add Service Reference” menu item.In WPF or in the other .Net environments it is easy.We just need to refer the contracts dll and write a class which inherits from &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/ms576141%28VS.95%29.aspx&quot;&gt;ClientBase&lt;/a&gt;.But this is Silverlight - A different runtime.&lt;img src=&quot;http://lh3.ggpht.com/_jIJDXxbTxiU/S6TRylggioI/AAAAAAAAALI/dpR-SpNm70I/WCFClientBase_1.jpg&quot; /&gt; &lt;/p&gt;  &lt;p align=&quot;center&quot;&gt;A Normal WCF service reference with all the generated code files&lt;/p&gt;  &lt;p&gt;There were 3 opinions.Not at all possible,Possible with less amount of code,Possible if we create all those classes by our own.Just avoid the last one because that doesn’t give us any benefit as it is just making the process manual.&lt;/p&gt;  &lt;p&gt;One of my Colleagues started research on that and was able to achieve the same.I am just sharing the idea.&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Solution : We can achieve the same using contract interface,proxy class and a custom eventargs class&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;First of all there are no changes at the server side.Only 3 types we are going to write at client side which will be present in the reference.cs file if you create the proxy using “Add Service Reference” Dialog.&lt;/p&gt;  &lt;p&gt;There will be a question for sure.Why are we writing the code which is being auto generated ? Why don’t we create a reference using the dialog and copy paste the reference.cs code?&lt;/p&gt;  &lt;p&gt;The answer for both the questions is same.You can create reference using the dialog and get the code from reference.cs.That is enough.&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Advantages&lt;/u&gt;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Can avoid huge amount of code which is auto generated.&lt;/li&gt;    &lt;li&gt;This is acting as a separate layer and can encapsulate operations here in future.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;&lt;u&gt;Implementation steps&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;Lets take example of implementing a DataService with one method GetData which returns a string.Don’t bother about the server side.Use the same.Below are the steps to perform at client side ie Silverlight side.&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Create interface IDataService&lt;/li&gt;    &lt;ol&gt;     &lt;li&gt;Decorate with ServiceContract attribute.&lt;/li&gt;      &lt;li&gt;Add method BeginGetData.Decorate it with OpertionContract and Set AsyncPattern to True.&lt;/li&gt;      &lt;li&gt;Add Method EndGetData.      &lt;div style=&quot;border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px&quot;&gt;       &lt;pre style=&quot;border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;Imports&lt;/span&gt; System.ServiceModel&lt;br /&gt;&lt;br /&gt;&amp;lt;ServiceContract()&amp;gt; _&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Interface&lt;/span&gt; IDataService&lt;br /&gt;    &amp;lt;OperationContract(AsyncPattern:=&lt;span style=&quot;color: #0000ff&quot;&gt;True&lt;/span&gt;)&amp;gt; _&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Function&lt;/span&gt; BeginGetData(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; callback &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.AsyncCallback, &lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; asyncState &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Object&lt;/span&gt;) &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.IAsyncResult&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Function&lt;/span&gt; EndGetData(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; result &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.IAsyncResult) &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;String&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; Interface&lt;/pre&gt;&lt;br /&gt;    &lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;  &lt;/ol&gt;&lt;br /&gt;&lt;br /&gt;  &lt;li&gt;Create eventArgs class deriving from System.ComponentModel.AsyncCompletedEventArgs&lt;/li&gt;&lt;br /&gt;  &lt;ol&gt;&lt;br /&gt;    &lt;li&gt;Add required properties to pass values.&lt;br /&gt;    &lt;div style=&quot;border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px&quot;&gt;&lt;br /&gt;      &lt;pre style=&quot;border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Class&lt;/span&gt; GetDataCompletedEventArgs&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Inherits&lt;/span&gt; System.ComponentModel.AsyncCompletedEventArgs&lt;br /&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Private&lt;/span&gt; results() &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Object&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt;(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; results() &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; exception &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.Exception, &lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; cancelled &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Boolean&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; userState &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Object&lt;/span&gt;)&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;MyBase&lt;/span&gt;.&lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt;(exception, cancelled, userState)&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;Me&lt;/span&gt;.results = results&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;ReadOnly&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Property&lt;/span&gt; Result() &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;String&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;Get&lt;/span&gt;&lt;br /&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;If&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Me&lt;/span&gt;.results IsNot &lt;span style=&quot;color: #0000ff&quot;&gt;Nothing&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Then&lt;/span&gt;&lt;br /&gt;                &lt;span style=&quot;color: #0000ff&quot;&gt;Return&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;CType&lt;/span&gt;(&lt;span style=&quot;color: #0000ff&quot;&gt;Me&lt;/span&gt;.results(0), &lt;span style=&quot;color: #0000ff&quot;&gt;String&lt;/span&gt;)&lt;br /&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;If&lt;/span&gt;&lt;br /&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;Return&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Nothing&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Get&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Property&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; Class&lt;/pre&gt;&lt;br /&gt;    &lt;/div&gt;&lt;br /&gt;&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;  &lt;li&gt;Create class DataServiceProxy derived from ClientBase which Implements IDataService.Write constructors.Implement methods.Write delegates and event which communicate back to the caller.&lt;/li&gt;&lt;br /&gt;&lt;/ol&gt;&lt;br /&gt;    &lt;div style=&quot;border-bottom: gray 1px solid; border-left: gray 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; max-height: 200px; font-size: 8pt; overflow: auto; border-top: gray 1px solid; cursor: text; border-right: gray 1px solid; padding-top: 4px&quot;&gt;&lt;br /&gt;      &lt;pre style=&quot;border-bottom-style: none; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Class&lt;/span&gt; DataServiceProxy&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Inherits&lt;/span&gt; ClientBase(Of IDataService)&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Implements&lt;/span&gt; IDataService&lt;br /&gt;&lt;span style=&quot;color: #cc6633&quot;&gt;#Region&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot; Constructors&amp;quot;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt;()&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;MyBase&lt;/span&gt;.&lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt;()&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt;(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; endpointConfigurationName &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;String&lt;/span&gt;)&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;MyBase&lt;/span&gt;.&lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt;(endpointConfigurationName)&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt;(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; endpointConfigurationName &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;String&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; remoteAddress &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;String&lt;/span&gt;)&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;MyBase&lt;/span&gt;.&lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt;(endpointConfigurationName, remoteAddress)&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt;(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; endpointConfigurationName &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;String&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; remoteAddress &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.ServiceModel.EndpointAddress)&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;MyBase&lt;/span&gt;.&lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt;(endpointConfigurationName, remoteAddress)&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt;(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; binding &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.ServiceModel.Channels.Binding, &lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; remoteAddress &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.ServiceModel.EndpointAddress)&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;MyBase&lt;/span&gt;.&lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt;(binding, remoteAddress)&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #cc6633&quot;&gt;#End Region&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style=&quot;color: #cc6633&quot;&gt;#Region&lt;/span&gt; &lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;GetData&amp;quot;&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Private&lt;/span&gt; onBeginGetDataDelegate &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; BeginOperationDelegate&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Private&lt;/span&gt; onEndGetDataDelegate &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; EndOperationDelegate&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Private&lt;/span&gt; onGetDataCompletedDelegate &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.Threading.SendOrPostCallback&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Event&lt;/span&gt; GetDataCompleted &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.EventHandler(Of GetDataCompletedEventArgs)&lt;br /&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Function&lt;/span&gt; BeginGetData(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; callback &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.AsyncCallback, &lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; asyncState &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Object&lt;/span&gt;) &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.IAsyncResult &lt;span style=&quot;color: #0000ff&quot;&gt;Implements&lt;/span&gt; ServiceContracts.IDataService.BeginGetData&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;Return&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;MyBase&lt;/span&gt;.Channel.BeginGetData(callback, asyncState)&lt;br /&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Function&lt;/span&gt; EndGetData(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; result &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.IAsyncResult) &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;String&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Implements&lt;/span&gt; ServiceContracts.IDataService.EndGetData&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;Return&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;MyBase&lt;/span&gt;.Channel.EndGetData(result)&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Function&lt;/span&gt; OnBeginGetData(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; inValues() &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Object&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; callback &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.AsyncCallback, &lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; asyncState &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Object&lt;/span&gt;) &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.IAsyncResult&lt;br /&gt;        &lt;span style=&quot;color: #008000&quot;&gt;&#39;Dim engID As String = CType(inValues(0), String)&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;color: #008000&quot;&gt;&#39;Dim libraryID As String = CType(inValues(1), String)&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;color: #008000&quot;&gt;&#39;Dim folderName As String = CType(inValues(2), String)&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;color: #008000&quot;&gt;&#39;Dim parentFolder As PathInfo = CType(inValues(3), PathInfo)&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;color: #008000&quot;&gt;&#39;Dim folderGeneralProperties As FolderGeneralProperties = CType(inValues(4), FolderGeneralProperties)&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;color: #008000&quot;&gt;&#39;Dim additionalProperties As System.Collections.Generic.Dictionary(Of String, String) = CType(inValues(5), System.Collections.Generic.Dictionary(Of String, String))&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;Return&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;CType&lt;/span&gt;(&lt;span style=&quot;color: #0000ff&quot;&gt;Me&lt;/span&gt;, IDataService).BeginGetData(callback, asyncState)&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span style=&quot;color: #008000&quot;&gt;&#39;Private Function GetData() As String Implements IDataService.GetData&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #008000&quot;&gt;&#39;Return MyBase.Channel.GetData()&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #008000&quot;&gt;&#39;End Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Function&lt;/span&gt; OnEndGetData(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; result &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; System.IAsyncResult) &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Object&lt;/span&gt;()&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;Dim&lt;/span&gt; retVal &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;String&lt;/span&gt; = &lt;span style=&quot;color: #0000ff&quot;&gt;CType&lt;/span&gt;(&lt;span style=&quot;color: #0000ff&quot;&gt;Me&lt;/span&gt;, IDataService).EndGetData(result)&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;Return&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Object&lt;/span&gt;() {retVal}&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt; OnGetDataCompleted(&lt;span style=&quot;color: #0000ff&quot;&gt;ByVal&lt;/span&gt; state &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Object&lt;/span&gt;)&lt;br /&gt;        &lt;span style=&quot;color: #008000&quot;&gt;&#39;If Not (GetDataCompleted Is Nothing) Then&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;Dim&lt;/span&gt; e &lt;span style=&quot;color: #0000ff&quot;&gt;As&lt;/span&gt; InvokeAsyncCompletedEventArgs = &lt;span style=&quot;color: #0000ff&quot;&gt;CType&lt;/span&gt;(state, InvokeAsyncCompletedEventArgs)&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;RaiseEvent&lt;/span&gt; GetDataCompleted(&lt;span style=&quot;color: #0000ff&quot;&gt;Me&lt;/span&gt;, &lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt; GetDataCompletedEventArgs(e.Results, e.&lt;span style=&quot;color: #0000ff&quot;&gt;Error&lt;/span&gt;, e.Cancelled, e.UserState))&lt;br /&gt;        &lt;span style=&quot;color: #008000&quot;&gt;&#39;End If&lt;/span&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;Public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Overloads&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt; GetDataAsync()&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;If&lt;/span&gt; (&lt;span style=&quot;color: #0000ff&quot;&gt;Me&lt;/span&gt;.onBeginGetDataDelegate &lt;span style=&quot;color: #0000ff&quot;&gt;Is&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Nothing&lt;/span&gt;) &lt;span style=&quot;color: #0000ff&quot;&gt;Then&lt;/span&gt;&lt;br /&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;Me&lt;/span&gt;.onBeginGetDataDelegate = &lt;span style=&quot;color: #0000ff&quot;&gt;AddressOf&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Me&lt;/span&gt;.OnBeginGetData&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;If&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;If&lt;/span&gt; (&lt;span style=&quot;color: #0000ff&quot;&gt;Me&lt;/span&gt;.onEndGetDataDelegate &lt;span style=&quot;color: #0000ff&quot;&gt;Is&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Nothing&lt;/span&gt;) &lt;span style=&quot;color: #0000ff&quot;&gt;Then&lt;/span&gt;&lt;br /&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;Me&lt;/span&gt;.onEndGetDataDelegate = &lt;span style=&quot;color: #0000ff&quot;&gt;AddressOf&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Me&lt;/span&gt;.OnEndGetData&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;If&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;If&lt;/span&gt; (&lt;span style=&quot;color: #0000ff&quot;&gt;Me&lt;/span&gt;.onGetDataCompletedDelegate &lt;span style=&quot;color: #0000ff&quot;&gt;Is&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Nothing&lt;/span&gt;) &lt;span style=&quot;color: #0000ff&quot;&gt;Then&lt;/span&gt;&lt;br /&gt;            &lt;span style=&quot;color: #0000ff&quot;&gt;Me&lt;/span&gt;.onGetDataCompletedDelegate = &lt;span style=&quot;color: #0000ff&quot;&gt;AddressOf&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Me&lt;/span&gt;.OnGetDataCompleted&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;If&lt;/span&gt;&lt;br /&gt;        &lt;span style=&quot;color: #0000ff&quot;&gt;MyBase&lt;/span&gt;.InvokeAsync(&lt;span style=&quot;color: #0000ff&quot;&gt;Me&lt;/span&gt;.onBeginGetDataDelegate, &lt;span style=&quot;color: #0000ff&quot;&gt;New&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Object&lt;/span&gt;() {}, &lt;span style=&quot;color: #0000ff&quot;&gt;Me&lt;/span&gt;.onEndGetDataDelegate, &lt;span style=&quot;color: #0000ff&quot;&gt;Me&lt;/span&gt;.onGetDataCompletedDelegate, &lt;span style=&quot;color: #0000ff&quot;&gt;Nothing&lt;/span&gt;)&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Sub&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #cc6633&quot;&gt;#End Region&lt;/span&gt;&lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;End&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;Class&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;    &lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;Uploaded &lt;a href=&quot;http://cid-890c06c8106550a0.skydrive.live.com/self.aspx/BlogSamples/SilverlightedWeb/WCFTestClientBase.zip&quot;&gt;a sample&lt;/a&gt; which does the same.&lt;/p&gt;  </description><link>http://silverlightedweb.blogspot.com/2010/03/creating-wcf-proxy-without-reference.html</link><author>noreply@blogger.com (Joymon)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh3.ggpht.com/_jIJDXxbTxiU/S6TRylggioI/AAAAAAAAALI/dpR-SpNm70I/s72-c/WCFClientBase_1.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-5131510531911707288</guid><pubDate>Wed, 03 Mar 2010 13:12:00 +0000</pubDate><atom:updated>2010-03-03T18:42:14.705+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Silverlight 3</category><category domain="http://www.blogger.com/atom/ns#">Silverlight 4</category><category domain="http://www.blogger.com/atom/ns#">VS 2010 Beta</category><title>Silverlight Installation issues I faced</title><description>&lt;p&gt;Here are some details about the installation issues which I faced when tried to setup my machine for Silverlight 4 with Visual studio 2010. No need to read further, if you are able to setup your machine with Silverlight 3 + VS 2008 and Silverlight 4 + VS 2010 without issues ;-)&lt;/p&gt;  &lt;p&gt;After the completion of previous project which is done in VSTS 2008 and Silverlight 3 we decided to port the same to Silverlight 4.According to my knowledge it is difficult to have 2 versions of Visual studio if any version of them are in beta.Here to work with Silverlight 4 we need Visual studio 2010 beta 2.So normally I uninstalled Silverlight 3 and&amp;#160; started uninstalling VS 2008.&lt;/p&gt;  &lt;p&gt;Everything went fine until my onsite counterpart called and asked me to setup my machine with VS 2008 + Silverlight 3and VSTS2010 beta 2 + Silverlight 4 beta .The reason was simple.We may need to support client for the previous project.The good news was he setup his machine with the above mentioned configuration.&lt;/p&gt;  &lt;p&gt;So I stopped the uninstallation of VSTS 2008.Seems the problems started here.Started installation of Silverlight 3.Got the simple error message.Not able to complete the installation.Log says a previous version of Silverlight is there.Tried with different versions of Silverlight 3 which were available with colleagues.Hours passed with Uninstallations, Installations and reboots.Finally downloaded the Silverlight 3 version from net and tried.That too not worked out.&lt;/p&gt;  &lt;p&gt;As usual I asked Google what is this error message by pasting the installation log in search box.Got a good link with Silverlight error messages and their solutions.&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Silverlight 3 installation Error messages : &lt;/u&gt;&lt;a title=&quot;http://blogs.msdn.com/amyd/archive/2009/03/19/silverlight-tools-installation-error-codes.aspx&quot; href=&quot;http://blogs.msdn.com/amyd/archive/2009/03/19/silverlight-tools-installation-error-codes.aspx&quot;&gt;http://blogs.msdn.com/amyd/archive/2009/03/19/silverlight-tools-installation-error-codes.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I figured out that there are 2 patches which are stopping me from installation.They are KB967143 and KB956453 and the solution was to manually uninstall those.But when I tried uninstalling it said “&lt;u&gt;Update removal was disallowed by policy&lt;/u&gt;”.What policy ? Its My machine and my login with admin privileges.I haven’t set any policy.&lt;/p&gt;  &lt;p&gt;After a google I came to know more things about the patches.There are different types of patches and these patches fall into &lt;strong&gt;UNINSTALLABLE patch&lt;/strong&gt; category.The only solution was to reinstall the application without applying those patches.&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Uninstallable patches&lt;/u&gt;:&lt;a title=&quot;http://msdn.microsoft.com/en-us/library/aa372102%28VS.85%29.aspx&quot; href=&quot;http://msdn.microsoft.com/en-us/library/aa372102%28VS.85%29.aspx&quot;&gt;http://msdn.microsoft.com/en-us/library/aa372102%28VS.85%29.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Again uninstalling and installing VS 2008.Then Silverlight 3.Next series was VS 2010 beta 2 and Silverlight 4 beta.Tested whether the old project is running or not in VS 2008 and creation of Silverlight 3 and 4 projects in VS 2008 and VS 2010 respectively.Overall cost - a weekend and 2 week days.&lt;/p&gt;  &lt;p&gt;Sometimes I am getting error message “VB.Net compiler is not responding” when I compile Silverlight 3 projects in VS 2008.But not consistent.Other than that everything works perfect.&lt;/p&gt;  </description><link>http://silverlightedweb.blogspot.com/2010/03/silverlight-installation-issues-i-faced.html</link><author>noreply@blogger.com (Joymon)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-157548025909494117</guid><pubDate>Tue, 02 Mar 2010 14:15:00 +0000</pubDate><atom:updated>2010-03-02T19:45:03.569+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Bug</category><category domain="http://www.blogger.com/atom/ns#">Silverlight 4</category><category domain="http://www.blogger.com/atom/ns#">VS 2010 Beta</category><title>Add Reference is empty in Silverlight 4 Beta</title><description>&lt;p&gt;As I told in the last post ,I have started with the Silverlight 4 research using Visual Studio 2010 beta 2 .The first thing I noted is the add reference box in Silverlight project is empty.&lt;img src=&quot;http://lh5.ggpht.com/_jIJDXxbTxiU/S40bxJhfCuI/AAAAAAAAAKg/o_q9gZi-bd0/s576/SL4NoReference.jpg&quot; /&gt; &lt;/p&gt;  &lt;p&gt;According to Microsoft this is a bug and has fixed.    &lt;br /&gt;&lt;u&gt;Workaround&lt;/u&gt;     &lt;br /&gt;In the add reference dialog manually browse the dll from the folder [Install Drive]:\Program Files\Microsoft SDKs\Silverlight\v4.0\Libraries\Client&lt;/p&gt;  &lt;p&gt;&lt;a title=&quot;https://connect.microsoft.com/VisualStudio/feedback/details/520040/missing-list-of-components-from-add-reference-in-silverlight-4-0-projects&quot; href=&quot;https://connect.microsoft.com/VisualStudio/feedback/details/520040/missing-list-of-components-from-add-reference-in-silverlight-4-0-projects&quot;&gt;https://connect.microsoft.com/VisualStudio/feedback/details/520040/missing-list-of-components-from-add-reference-in-silverlight-4-0-projects&lt;/a&gt;     &lt;br /&gt;&lt;a title=&quot;http://forums.silverlight.net/forums/p/150240/335233.aspx&quot; href=&quot;http://forums.silverlight.net/forums/p/150240/335233.aspx&quot;&gt;http://forums.silverlight.net/forums/p/150240/335233.aspx&lt;/a&gt;&lt;/p&gt;  </description><link>http://silverlightedweb.blogspot.com/2010/03/add-reference-is-empty-in-silverlight-4.html</link><author>noreply@blogger.com (Joymon)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="http://lh5.ggpht.com/_jIJDXxbTxiU/S40bxJhfCuI/AAAAAAAAAKg/o_q9gZi-bd0/s72-c/SL4NoReference.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-3304097561441355459</guid><pubDate>Sat, 27 Feb 2010 11:49:00 +0000</pubDate><atom:updated>2010-02-27T17:19:25.578+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Silverlight 3</category><category domain="http://www.blogger.com/atom/ns#">Silverlight 4</category><title>Return of the blogger</title><description>&lt;p&gt;I was not able to blog more after joining my current company because of an important project.That project was in Silverlight 3 to show an existing big business application can be ported to Silverlight 3 and runs properly.&lt;/p&gt;  &lt;p&gt;We achieved our goal this week and the client accepted the same.According to my small experience that project will be the biggest business application ever built using Silverlight or even RIA technologies.Sorry I am not in a position to tell any more details about that application due to NDA.&lt;/p&gt;  &lt;p&gt;Anyway we are progressing to port the same to Silverlight 4 and the research for that is already started. Thats it for now.Stay subscribed for more news.&amp;#160; &lt;/p&gt;  </description><link>http://silverlightedweb.blogspot.com/2010/02/return-of-blogger.html</link><author>noreply@blogger.com (Joymon)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-190920008811290333</guid><pubDate>Fri, 29 Jan 2010 13:33:00 +0000</pubDate><atom:updated>2010-01-29T19:03:00.721+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Media Player</category><title>Silverlight Media Framework v1.1 Released</title><description>&lt;p&gt;This open source framework will make developer’s work much easier when they develop a media player for Silverlight.&lt;/p&gt;  &lt;p&gt;More details in &lt;a href=&quot;http://smf.codeplex.com/&quot;&gt;codeplex&lt;/a&gt; along with &lt;a href=&quot;http://silverlight.net/learn/videos/silverlight-media-framework/&quot;&gt;videos&lt;/a&gt; shows how to use it.&lt;/p&gt;  </description><link>http://silverlightedweb.blogspot.com/2010/01/silverlight-media-framework-v11.html</link><author>noreply@blogger.com (Joymon)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-6709069052220754951</guid><pubDate>Fri, 29 Jan 2010 13:32:00 +0000</pubDate><atom:updated>2010-01-29T19:02:00.593+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Documents</category><title>PDF Viewer for Silverlight</title><description>&lt;p&gt;It seems the days of HTML overlay is coming to an end.A pdf viewer for Silverlight is ready by &lt;a href=&quot;http://firstfloorsoftware.com&quot;&gt;first floor software&lt;/a&gt; who gives &lt;a href=&quot;http://firstfloorsoftware.com/silverlightspy/&quot;&gt;Silverlight spy&lt;/a&gt;.Read the details &lt;a href=&quot;http://firstfloorsoftware.com/blog/pdf-for-silverlight-preview/&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;  &lt;p&gt;See it in action &lt;a href=&quot;http://firstfloorsoftware.com/liveapps/PDF-for-Silverlight/&quot;&gt;here&lt;/a&gt;&lt;/p&gt;  </description><link>http://silverlightedweb.blogspot.com/2010/01/pdf-viewer-for-silverlight.html</link><author>noreply@blogger.com (Joymon)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-2557474662235437982</guid><pubDate>Mon, 25 Jan 2010 14:35:00 +0000</pubDate><atom:updated>2010-01-25T20:06:36.374+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">MEF</category><title>What is Managed Entity Framework - MEF</title><description>&lt;p&gt;After joining in new company I rarely get time to learn new technologies than my previous company.Obviously its due to more responsibilities.But this week end I was managed to find some time to learn &lt;strong&gt;MEF (Managed Entity Framework)&lt;/strong&gt; which was introduced some time back.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;In simple words its all about Export,Import and Composition.ie you export a type or property then you import into another property which is present in another class.For this to happen there should be somebody in the middle.That is composition.&lt;/strong&gt;&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;The export and import takes place by using attributes.Just decorate the class or property with the attribute export or import to achieve the functionality.For composition you just need one line code :-)&lt;/p&gt;  &lt;p&gt;&lt;u&gt;Exporting one type&lt;/u&gt;&lt;/p&gt;  &lt;div style=&quot;border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4&quot;&gt;   &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none&quot;&gt;[Export(&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Emp&amp;quot;&lt;/span&gt;)] &lt;br /&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; Employee&lt;br /&gt;{&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;The above code just exports one class.Lets see how this is being used or imported.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4&quot;&gt;&lt;br /&gt;  &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;class&lt;/span&gt; EmployeeViewModel&lt;br /&gt;{&lt;br /&gt;    [Import (&lt;span style=&quot;color: #006080&quot;&gt;&amp;quot;Emp&amp;quot;&lt;/span&gt;)]&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; Employee Current { get; set; }&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;The employee view model class receives the exported type as Current.This code it not completed.To complete the code we need to compose.It is done by the line below.&lt;/p&gt;&lt;br /&gt;&lt;br /&gt;&lt;div style=&quot;border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4&quot;&gt;&lt;br /&gt;  &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;public&lt;/span&gt; EmployeeViewModel()&lt;br /&gt;{&lt;br /&gt;    PartInitializer.SatisfyImports(&lt;span style=&quot;color: #0000ff&quot;&gt;this&lt;/span&gt;);&lt;br /&gt;    MessageBox.Show(Current.ToString());&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;This is the constructor of EmployeeViewModel class and the first line does the composition and after that if we access the object it will be initialized and ready for use.In this case it will display the default ToString method’s output ie the class name.&lt;br/&gt;&lt;br /&gt;This is the basic concept of MEF.This can be used in data binding and for collection types etc…Next time will discuss about a data binding and MEF. &lt;br/&gt;&lt;br /&gt;The project contains a reference to the dll System.ComponentModel.Composition.dll.You can locate this file from the attached sample or in the Silverlight 4 installation.&lt;br/&gt;&lt;br /&gt;Sample can be downloaded from &lt;a href=&quot;http://cid-890c06c8106550a0.skydrive.live.com/self.aspx/BlogSamples/SilverlightedWeb/MEF%5E_1.zip&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;  </description><link>http://silverlightedweb.blogspot.com/2010/01/what-is-managed-entity-framework-mef.html</link><author>noreply@blogger.com (Joymon)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-1028656412738086787</guid><pubDate>Sun, 17 Jan 2010 13:42:00 +0000</pubDate><atom:updated>2010-01-17T19:12:34.036+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Performance Optimization</category><category domain="http://www.blogger.com/atom/ns#">Silverlight 3</category><title>Performance optimization in Silverlight 3</title><description>&lt;p&gt;Just now got a good link in MSDN for performance optimization in Silverlight 3 applications.&lt;/p&gt;  &lt;p&gt;&lt;a title=&quot;http://msdn.microsoft.com/en-gb/library/cc189071%28VS.95%29.aspx&quot; href=&quot;http://msdn.microsoft.com/en-gb/library/cc189071%28VS.95%29.aspx&quot;&gt;http://msdn.microsoft.com/en-gb/library/cc189071%28VS.95%29.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Don’t know when can I get a chance to apply this in my current project :-(&lt;/p&gt;  </description><link>http://silverlightedweb.blogspot.com/2010/01/performance-optimization-in-silverlight.html</link><author>noreply@blogger.com (Joymon)</author><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-3908500844524715362</guid><pubDate>Tue, 29 Dec 2009 13:33:00 +0000</pubDate><atom:updated>2010-01-04T14:17:57.617+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Browser Interaction</category><category domain="http://www.blogger.com/atom/ns#">Javascript</category><title>Expression evaluation in Silverlight using eval</title><description>&lt;p align=&quot;justify&quot;&gt;One of the &lt;a href=&quot;http://joymonscode.blogspot.com/2009/12/evaluating-arithmetic-expressions-using.html&quot;&gt;previous posts&lt;/a&gt; in my &lt;a href=&quot;http://joymonscode.blogspot.com&quot;&gt;general programming blog&lt;/a&gt; talks about evaluating the arithmetic expressions using the DataColumn and DataTables.The requirement was simple.You are given with an arithmetic expression say “(2+2)*3” as string. May be a user entered expression.You need to evaluate the given expression and show the answer.&lt;/p&gt;  &lt;p align=&quot;justify&quot;&gt;In .Net it is easier.Use a DataColumn with the given expression and it will calculate the result for you.But when we come to Silverlight the things get harder.There is no concept of DataSet or DataTable in Silverlight.Rather the ADO.Net is not there.So what can we do?&lt;/p&gt;  &lt;p align=&quot;justify&quot;&gt;One solution is to have a WCF server call which accepts the expression as string and use the ADO.Net DataColumn at server-side and return back the result.Obviously you can achieve that since the server is just a .Net application with ADO.Net support.But is that the better solution? I will say No because we have another alternative.&lt;/p&gt;  &lt;p align=&quot;justify&quot;&gt;Its nothing but the famous eval function of javascript.I think all of you know how Silverlight can communicate with Javascript.If not please read this &lt;a href=&quot;http://silverlightedweb.blogspot.com/2008/05/silverlight-javascript-communication.html&quot;&gt;post&lt;/a&gt; about the same.&lt;/p&gt;  &lt;p&gt;Here goes the solution.Get your expression.Pass it to the &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.browser.htmlwindow.eval%28VS.95%29.aspx&quot;&gt;eval&lt;/a&gt; method of &lt;a href=&quot;http://msdn.microsoft.com/en-us/library/system.windows.browser.htmlwindow(VS.95).aspx&quot;&gt;HtmlWindow&lt;/a&gt;.Use the return value properly. &lt;/p&gt;  &lt;div style=&quot;border-right: gray 1px solid; padding-right: 4px; border-top: gray 1px solid; padding-left: 4px; font-size: 8pt; padding-bottom: 4px; margin: 20px 0px 10px; overflow: auto; border-left: gray 1px solid; width: 97.5%; cursor: text; max-height: 200px; line-height: 12pt; padding-top: 4px; border-bottom: gray 1px solid; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; background-color: #f4f4f4&quot;&gt;   &lt;pre style=&quot;padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none&quot;&gt;&lt;span style=&quot;color: #0000ff&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: #0000ff&quot;&gt;double&lt;/span&gt; Evaluate(&lt;span style=&quot;color: #0000ff&quot;&gt;string&lt;/span&gt; expression)&lt;br /&gt;{&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;object&lt;/span&gt; obj = HtmlPage.Window.Eval(expression);&lt;br /&gt;    &lt;span style=&quot;color: #0000ff&quot;&gt;return&lt;/span&gt; Convert.ToDouble(obj);&lt;br /&gt;}&lt;/pre&gt;&lt;br /&gt;&lt;/div&gt;  </description><link>http://silverlightedweb.blogspot.com/2009/12/expression-evaluation-in-silverlight.html</link><author>noreply@blogger.com (Joymon)</author><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-8603776122273127789.post-6434153955249088704</guid><pubDate>Wed, 16 Dec 2009 14:29:00 +0000</pubDate><atom:updated>2009-12-16T19:59:02.070+05:30</atom:updated><category domain="http://www.blogger.com/atom/ns#">Silverlight 4</category><title>Referring Silverlight 4 DLLs in WPF</title><description>&lt;p&gt;Finally MSFT did it.Now we can use Silverlight assemblies in WPF without recompilation.In the older days we have to link the files to other solution and compile for Silverlight and WPF separately.Now that is over.Share your assemblies…&lt;/p&gt;  &lt;p&gt;See what the &lt;a href=&quot;http://blogs.msdn.com/clrteam/archive/2009/12/01/sharing-silverlight-assemblies-with-net-apps.aspx&quot;&gt;CLR team says&lt;/a&gt; about this.&lt;/p&gt;  </description><link>http://silverlightedweb.blogspot.com/2009/12/referring-silverlight-4-dlls-in-wpf.html</link><author>noreply@blogger.com (Joymon)</author><thr:total>0</thr:total></item></channel></rss>