<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ganshani.com &#187; Silverlight</title>
	<atom:link href="http://www.ganshani.com/category/technical-repository/silverlight/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ganshani.com</link>
	<description>Puneet Ghanshani - .NET, Silverlight, Sharepoint Articles, Blogs, Poems, Photograph</description>
	<lastBuildDate>Sat, 24 Apr 2010 10:17:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Silverlight Interview Questions &#8211; I</title>
		<link>http://www.ganshani.com/2010/02/12/silverlight-interview-questions-i/</link>
		<comments>http://www.ganshani.com/2010/02/12/silverlight-interview-questions-i/#comments</comments>
		<pubDate>Fri, 12 Feb 2010 09:20:21 +0000</pubDate>
		<dc:creator>Punit Ganshani</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Interview]]></category>
		<category><![CDATA[questions]]></category>

		<guid isPermaLink="false">http://www.ganshani.com/?p=548</guid>
		<description><![CDATA[
			
				
			
		
Hello folks,
Marching forward, I will post a series of Interview Questions on Silverlight.  This will cover questions at each level &#8211; easy, intermediate and advanced.  And I am sure, other sites &#38; users would post these on many other sites too  
So keep watching this space. Some questions below to start with
Level: Developer 

What [...]


<h2>Related posts:</h2><ul><li><a href='http://www.ganshani.com/2009/09/03/hosting-silverlight-as-desktop-applications-i/' rel='bookmark' title='Permanent Link: Hosting Silverlight as Desktop Applications &#8211; I'>Hosting Silverlight as Desktop Applications &#8211; I</a></li>
<li><a href='http://www.ganshani.com/2009/09/17/silverlight-wpf-mvvm/' rel='bookmark' title='Permanent Link: Silverlight &#038; WPF: MVVM'>Silverlight &#038; WPF: MVVM</a></li>
<li><a href='http://www.ganshani.com/2009/07/14/silverlight-host-for-sharepoint/' rel='bookmark' title='Permanent Link: Silverlight Host for Sharepoint'>Silverlight Host for Sharepoint</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.ganshani.com%2F2010%2F02%2F12%2Fsilverlight-interview-questions-i%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.ganshani.com%2F2010%2F02%2F12%2Fsilverlight-interview-questions-i%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Hello folks,</p>
<p>Marching forward, I will post a series of Interview Questions on Silverlight.  This will cover questions at each level &#8211; easy, intermediate and advanced.  And I am sure, other sites &amp; users would post these on many other sites too <img src='http://www.ganshani.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So keep watching this space. Some questions below to start with</p>
<p><strong>Level: Developer</strong><strong> </strong></p>
<ul>
<li>What is the role of Silverlight Plugin in the Silverlight Application Life-Cycle?</li>
<li>What does the keyword &#8216;type&#8217; signify in the Silverlight Hosting page.
<pre class="brush: xml">
&lt;object data=&quot;data:application/x-silverlight-2,&quot;
type=&quot;application/x-silverlight-2&quot; width=&quot;100%&quot; height=&quot;100%&quot;&gt;
</pre>
</li>
<li>You have developed an application on Silverlight 2, will it execute on Silverlight 4 platform? Is vice-versa true?</li>
<li>Your organization has blocked download of any software from Internet and you want to deploy your Silverlight Application as Intranet Application.  The users do not have Silverlight plugin installed on their machine; however you have the installable.  How do you plan to deploy your application? Will you change the application code to fit this requirement or change the organization policy?</li>
<li>Your Silverlight application faces some technical errors while it is executed. Where will you write your code to get notification of these errors?</li>
<li>Can any Silverlight Application be viewed on Linux? Or a specific installation is required?</li>
<li>Assume your host page defines the background as White
<pre class="brush: xml">
&lt;param name=&quot;background&quot; value=&quot;white&quot; /&gt;
</pre>
<p>while your MainPage.xaml (that loads initially) defines background as &#8216;Gray&#8217;</p>
<pre class="brush: xml">
&lt;Grid x:Name=&quot;LayoutRoot&quot; Background=&quot;Gray&quot;&gt;
</pre>
<p>What will be the color of the background?</li>
<li>I have two actors to a Silverlight Application &#8211; Employee and Customer. The default page (default.html) should always open Customer view; whereas \view\employee.html should open Employee view.How would you implement this?</li>
<li>What is significance of initParams in
<pre class="brush: xml">
&lt;param name=&quot;initParams&quot; value=&quot;symbol=true&quot; /&gt;
</pre>
</li>
</ul>


<p><h2>Related posts:</h2><ul><li><a href='http://www.ganshani.com/2009/09/03/hosting-silverlight-as-desktop-applications-i/' rel='bookmark' title='Permanent Link: Hosting Silverlight as Desktop Applications &#8211; I'>Hosting Silverlight as Desktop Applications &#8211; I</a></li>
<li><a href='http://www.ganshani.com/2009/09/17/silverlight-wpf-mvvm/' rel='bookmark' title='Permanent Link: Silverlight &#038; WPF: MVVM'>Silverlight &#038; WPF: MVVM</a></li>
<li><a href='http://www.ganshani.com/2009/07/14/silverlight-host-for-sharepoint/' rel='bookmark' title='Permanent Link: Silverlight Host for Sharepoint'>Silverlight Host for Sharepoint</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.ganshani.com/2010/02/12/silverlight-interview-questions-i/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Customizing Splash Screen in Silverlight</title>
		<link>http://www.ganshani.com/2010/02/10/customizing-splash-screen-in-silverlight/</link>
		<comments>http://www.ganshani.com/2010/02/10/customizing-splash-screen-in-silverlight/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 08:12:59 +0000</pubDate>
		<dc:creator>Punit Ganshani</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Splash Screen]]></category>

		<guid isPermaLink="false">http://www.ganshani.com/?p=541</guid>
		<description><![CDATA[
			
				
			
		
Customizing Splash Screen (a screen that loads before the Silverlight application loads) requires some development effort in the host application (could be HTML/ASPX/any other application).
Creating SplashScreen.xaml
First, we create a XAML file &#8211; say SplashScreen.xaml file which displays two things &#8211; a progress bar and a textblock that displays &#8216;% completed&#8217;


&#60;Grid xmlns=&#34;&#60;a href=&#34;http://schemas.microsoft.com/client/2007&#34;&#62;http://schemas.microsoft.com/client/2007&#60;/a&#62;&#34;
        xmlns:x=&#34;&#60;a href=&#34;http://schemas.microsoft.com/winfx/2006/xaml&#34;&#62;http://schemas.microsoft.com/winfx/2006/xaml&#60;/a&#62;&#34;&#62;
   &#60;StackPanel VerticalAlignment=&#34;Center&#34;&#62;
      [...]


<h2>Related posts:</h2><ul><li><a href='http://www.ganshani.com/2010/01/12/right-click-in-silverlight-4/' rel='bookmark' title='Permanent Link: Right Click in Silverlight 4'>Right Click in Silverlight 4</a></li>
<li><a href='http://www.ganshani.com/2010/02/12/silverlight-interview-questions-i/' rel='bookmark' title='Permanent Link: Silverlight Interview Questions &#8211; I'>Silverlight Interview Questions &#8211; I</a></li>
<li><a href='http://www.ganshani.com/2009/09/17/hosting-silverlight-as-desktop-applications-ii/' rel='bookmark' title='Permanent Link: Hosting Silverlight as Desktop Applications &#8211; II'>Hosting Silverlight as Desktop Applications &#8211; II</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.ganshani.com%2F2010%2F02%2F10%2Fcustomizing-splash-screen-in-silverlight%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.ganshani.com%2F2010%2F02%2F10%2Fcustomizing-splash-screen-in-silverlight%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Customizing Splash Screen (a screen that loads before the Silverlight application loads) requires some development effort in the host application (could be HTML/ASPX/any other application).</p>
<h3>Creating SplashScreen.xaml</h3>
<p>First, we create a XAML file &#8211; say <strong>SplashScreen.xaml</strong> file which displays two things &#8211; a progress bar and a textblock that displays &#8216;% completed&#8217;</p>
<pre class="brush: xml">

&lt;Grid xmlns=&quot;&lt;a href=&quot;http://schemas.microsoft.com/client/2007&quot;&gt;http://schemas.microsoft.com/client/2007&lt;/a&gt;&quot;
        xmlns:x=&quot;&lt;a href=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;&gt;http://schemas.microsoft.com/winfx/2006/xaml&lt;/a&gt;&quot;&gt;
   &lt;StackPanel VerticalAlignment=&quot;Center&quot;&gt;
      &lt;Grid&gt;
        &lt;Rectangle x:Name=&quot;&lt;strong&gt;baseBackground&lt;/strong&gt;&quot; Fill=&quot;Black&quot; Stroke=&quot;White&quot; StrokeThickness=&quot;1&quot; Stretch=&quot;Fill&quot; Height=&quot;30&quot; Margin=&quot;100,20&quot;&gt;&lt;/Rectangle&gt;
        &lt;Rectangle x:Name=&quot;&lt;strong&gt;movementBar&lt;/strong&gt;&quot; Fill=&quot;Gray&quot; Height=&quot;28&quot; Margin=&quot;101,20&quot;&gt;
          &lt;Rectangle.RenderTransform&gt;
            &lt;TransformGroup&gt;
              &lt;ScaleTransform x:Name=&quot;&lt;strong&gt;movementBarTransform&lt;/strong&gt;&quot; ScaleX=&quot;0&quot; ScaleY=&quot;1&quot;/&gt;
            &lt;/TransformGroup&gt;
          &lt;/Rectangle.RenderTransform&gt;
        &lt;/Rectangle&gt;
      &lt;/Grid&gt;
      &lt;TextBlock x:Name=&quot;&lt;strong&gt;progressText&lt;/strong&gt;&quot; HorizontalAlignment=&quot;Center&quot; Text=&quot;0% downloaded ...&quot;&gt;&lt;/TextBlock&gt;
    &lt;/StackPanel&gt;
&lt;/Grid&gt;
</pre>
<p>Here, we have a <strong>baseBackground</strong> (that forms background) that is Black in color and small bar that will move <strong>&#8216;movementBar</strong>&#8216; which is Gray in color.</p>
<p>As the page downloads the data, <strong>movementBarTransform</strong> needs to be changed, so that the movementBar appears as if it is increasing. And simultaneously, progressText should display the % downloaded.</p>
<h3>Modifying host file</h3>
<p>Now let&#8217;s modify the host file that loads the Silverlight Application.</p>
<pre class="brush: xml">

&lt;object data=&quot;data:application/x-silverlight,&quot; type=&quot;application/x-silverlight-2&quot; width=&quot;100%&quot; height=&quot;100%&quot;&gt;
   &lt;param name=&quot;source&quot; value=&quot;ClientBin/SplashScreen.xap&quot;/&gt;
   &lt;param name=&quot;onerror&quot; value=&quot;onSilverlightError&quot; /&gt;
   &lt;param name=&quot;background&quot; value=&quot;white&quot; /&gt;
   &lt;param name=&quot;splashscreensource&quot; value=&quot;SplashScreen.xaml&quot; /&gt;
   &lt;param name=&quot;onsourcedownloadprogresschanged&quot; value=&quot;onSourceDownloadProgressChanged&quot; /&gt;
   
   &lt;a href=&quot;&lt;a href=&quot;http://go.microsoft.com/fwlink/?LinkID=115261&quot;&gt;http://go.microsoft.com/fwlink/?LinkID=115261&lt;/a&gt;&quot; style=&quot;text-decoration: none;&quot;&gt;
        &lt;img src=&quot;&lt;a href=&quot;http://go.microsoft.com/fwlink/?LinkId=108181&quot;&gt;http://go.microsoft.com/fwlink/?LinkId=108181&lt;/a&gt;&quot; alt=&quot;Get Microsoft Silverlight&quot; style=&quot;border-style: none&quot;/&gt;
   &lt;/a&gt;
  &lt;/object&gt;
</pre>
<p>The most important line that calls a JS function &#8216;onSourceDownloadProgressChanged&#8217; when some part (bytes) of the XAP is downloaded is:</p>
<pre class="brush: xml">

 &lt;param name=&quot;onsourcedownloadprogresschanged&quot; value=&quot;onSourceDownloadProgressChanged&quot; /&gt;
</pre>
<h3>Adding JS in hosting file</h3>
<pre class="brush: js">

function onSourceDownloadProgressChanged(sender, eventArgs)
        {
       
         sender.findName(&quot;progressText&quot;).Text = Math.round((eventArgs.progress * 100)) + &quot;% downloaded ...&quot;;        
         sender.findName(&quot;movementBarTransform&quot;).ScaleX = eventArgs.progress;        
        }
</pre>
<p>This code snippet calculates the percentage of XAP file downloaded and displays it in the textbox.  It also increases the ScaleX property of ScaleTransform of movementBar as per the progress.</p>
<h3>Testing the Splash Screen</h3>
<p>Now, add some heavy sized ZIP file in the Silverlight application so that your XAP file becomes atleast 5 MB and try to execute the application. </p>
<p>What you would see is a new custom Splash Screen</p>


<p><h2>Related posts:</h2><ul><li><a href='http://www.ganshani.com/2010/01/12/right-click-in-silverlight-4/' rel='bookmark' title='Permanent Link: Right Click in Silverlight 4'>Right Click in Silverlight 4</a></li>
<li><a href='http://www.ganshani.com/2010/02/12/silverlight-interview-questions-i/' rel='bookmark' title='Permanent Link: Silverlight Interview Questions &#8211; I'>Silverlight Interview Questions &#8211; I</a></li>
<li><a href='http://www.ganshani.com/2009/09/17/hosting-silverlight-as-desktop-applications-ii/' rel='bookmark' title='Permanent Link: Hosting Silverlight as Desktop Applications &#8211; II'>Hosting Silverlight as Desktop Applications &#8211; II</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.ganshani.com/2010/02/10/customizing-splash-screen-in-silverlight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ClientAccessPolicy Sample</title>
		<link>http://www.ganshani.com/2010/01/21/clientaccesspolicy-sample/</link>
		<comments>http://www.ganshani.com/2010/01/21/clientaccesspolicy-sample/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 13:35:16 +0000</pubDate>
		<dc:creator>Punit Ganshani</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[client access policy]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://www.ganshani.com/?p=531</guid>
		<description><![CDATA[
			
				
			
		
Recently I have delivered a 4-day training session on Silverlight 4 and many participants asked for a sample ClientAccessPolicy.xml file. So this is for those who want it  


&#60;?xml version=&#34;1.0&#34; encoding=&#34;utf-8&#34;?&#62;
&#60;access-policy&#62;
  &#60;cross-domain-access&#62;
    &#60;policy&#62;
      &#60;allow-from http-request-headers=&#34;*&#34;&#62;
        &#60;domain uri=&#34;*&#34;/&#62;
      &#60;/allow-from&#62;
      &#60;grant-to&#62;
        &#60;resource path=&#34;/&#34; include-subpaths=&#34;true&#34;/&#62;
      &#60;/grant-to&#62;
    &#60;/policy&#62;
  &#60;/cross-domain-access&#62;
&#60;/access-policy&#62;

Just change the &#8220;*&#8221; to &#8220;*.xyz.com&#8221; to restrict permissions to [...]


<h2>Related posts:</h2><ul><li><a href='http://www.ganshani.com/2009/09/23/silverlight-training-kit/' rel='bookmark' title='Permanent Link: Silverlight Training Kit'>Silverlight Training Kit</a></li>
<li><a href='http://www.ganshani.com/2010/01/11/printing-in-silverlight-4/' rel='bookmark' title='Permanent Link: Printing in Silverlight 4'>Printing in Silverlight 4</a></li>
<li><a href='http://www.ganshani.com/2010/01/12/right-click-in-silverlight-4/' rel='bookmark' title='Permanent Link: Right Click in Silverlight 4'>Right Click in Silverlight 4</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.ganshani.com%2F2010%2F01%2F21%2Fclientaccesspolicy-sample%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.ganshani.com%2F2010%2F01%2F21%2Fclientaccesspolicy-sample%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Recently I have delivered a 4-day training session on Silverlight 4 and many participants asked for a sample ClientAccessPolicy.xml file. So this is for those who want it <img src='http://www.ganshani.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<pre class="brush: xml">

&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;access-policy&gt;
  &lt;cross-domain-access&gt;
    &lt;policy&gt;
      &lt;allow-from http-request-headers=&quot;*&quot;&gt;
        &lt;domain uri=&quot;*&quot;/&gt;
      &lt;/allow-from&gt;
      &lt;grant-to&gt;
        &lt;resource path=&quot;/&quot; include-subpaths=&quot;true&quot;/&gt;
      &lt;/grant-to&gt;
    &lt;/policy&gt;
  &lt;/cross-domain-access&gt;
&lt;/access-policy&gt;
</pre>
<p>Just change the &#8220;*&#8221; to &#8220;*.xyz.com&#8221; to restrict permissions to request originating from<span style="font-family: mceinline;"> </span><span style="font-family: mceinline;">xyz.com</span></p>
<pre class="brush: xml">

&lt;domain uri=&quot;*&quot;/&gt;
</pre>
<p>Happy creating of WCF services for Silverlight &amp; Flash..</p>


<p><h2>Related posts:</h2><ul><li><a href='http://www.ganshani.com/2009/09/23/silverlight-training-kit/' rel='bookmark' title='Permanent Link: Silverlight Training Kit'>Silverlight Training Kit</a></li>
<li><a href='http://www.ganshani.com/2010/01/11/printing-in-silverlight-4/' rel='bookmark' title='Permanent Link: Printing in Silverlight 4'>Printing in Silverlight 4</a></li>
<li><a href='http://www.ganshani.com/2010/01/12/right-click-in-silverlight-4/' rel='bookmark' title='Permanent Link: Right Click in Silverlight 4'>Right Click in Silverlight 4</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.ganshani.com/2010/01/21/clientaccesspolicy-sample/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>NotificationWindow in Silverlight (Out of Browser Apps)</title>
		<link>http://www.ganshani.com/2010/01/13/notificationwindow-in-silverlight-out-of-browser-apps/</link>
		<comments>http://www.ganshani.com/2010/01/13/notificationwindow-in-silverlight-out-of-browser-apps/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 05:58:06 +0000</pubDate>
		<dc:creator>Punit Ganshani</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[NotificationWindow]]></category>

		<guid isPermaLink="false">http://www.ganshani.com/?p=525</guid>
		<description><![CDATA[
			
				
			
		
Silverlight 4 brings another feature to desk &#8211; NotificationWindow.  NotificationWindow is different from PopUp in following ways:

NotificationWindow opens as a Splash Screen, while PopUp does not.
NotificationWindow has an expiry time (set in MilliSeconds); while PopUp needs to be closed explicitly
NotfificationWindow can be implemented only for Out-Of-Browser applications; PopUp can be used for both Web and Out-Of-Browser [...]


<h2>Related posts:</h2><ul><li><a href='http://www.ganshani.com/2010/01/12/right-click-in-silverlight-4/' rel='bookmark' title='Permanent Link: Right Click in Silverlight 4'>Right Click in Silverlight 4</a></li>
<li><a href='http://www.ganshani.com/2009/08/20/designing-a-popup-in-silverlight/' rel='bookmark' title='Permanent Link: Designing a PopUp in Silverlight'>Designing a PopUp in Silverlight</a></li>
<li><a href='http://www.ganshani.com/2009/09/07/wpf-vs-wpf-xbap-vs-silverlight/' rel='bookmark' title='Permanent Link: WPF vs WPF XBAP vs Silverlight'>WPF vs WPF XBAP vs Silverlight</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.ganshani.com%2F2010%2F01%2F13%2Fnotificationwindow-in-silverlight-out-of-browser-apps%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.ganshani.com%2F2010%2F01%2F13%2Fnotificationwindow-in-silverlight-out-of-browser-apps%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Silverlight 4 brings another feature to desk &#8211; NotificationWindow.  NotificationWindow is different from PopUp in following ways:</p>
<ul>
<li>NotificationWindow opens as a Splash Screen, while PopUp does not.</li>
<li>NotificationWindow has an expiry time (set in MilliSeconds); while PopUp needs to be closed explicitly</li>
<li>NotfificationWindow can be implemented only for Out-Of-Browser applications; PopUp can be used for both Web and Out-Of-Browser applications</li>
</ul>
<p>With that, let&#8217;s see how to implement NotificationWindow for Silverlight Applications.</p>
<p><em><span style="font-family: mceinline;">Statement &#8211; Create NotificationWindow to denote a Upgrade Window</span></em></p>
<p>First, we will design a NotificationWindow &#8211; Create a New Silverlight UserControl and give it name: UpgradeWindow</p>
<pre class="brush: xml">

    &lt;Grid x:Name=&quot;LayoutRoot&quot; Background=&quot;White&quot;&gt;
        &lt;Border x:Name=&quot;Frame&quot; Width=&quot;300&quot; Height=&quot;100&quot; Background=&quot;LightYellow&quot;&gt;
            &lt;StackPanel Orientation=&quot;Vertical&quot;&gt;
                &lt;Border Width=&quot;290&quot; Height=&quot;24&quot; CornerRadius=&quot;4&quot; Margin=&quot;2,4,2,4&quot;&gt;
                    &lt;Border.Background&gt;
                        &lt;LinearGradientBrush StartPoint=&quot;0.5,0.0&quot; EndPoint=&quot;0.5,1.0&quot;&gt;
                            &lt;GradientStop Offset=&quot;0.2&quot; Color=&quot;#FF186220&quot; /&gt;
                            &lt;GradientStop Offset=&quot;0.9&quot; Color=&quot;#FFFFFFFF&quot; /&gt;
                            &lt;GradientStop Offset=&quot;0.1&quot; Color=&quot;#FF11A111&quot; /&gt;
                        &lt;/LinearGradientBrush&gt;
                    &lt;/Border.Background&gt;
                    &lt;TextBlock Text=&quot;{Binding Title, Mode=OneWay}&quot; FontSize=&quot;12&quot; FontWeight=&quot;Bold&quot; Foreground=&quot;Black&quot; Margin=&quot;4&quot; /&gt;
                &lt;/Border&gt;
                &lt;TextBlock Width=&quot;240&quot; Text=&quot;{Binding Content, Mode=OneWay}&quot; FontSize=&quot;11&quot; Foreground=&quot;#FF202020&quot; TextWrapping=&quot;Wrap&quot; Margin=&quot;4&quot; /&gt;
            &lt;/StackPanel&gt;
        &lt;/Border&gt;
    &lt;/Grid&gt;
 
</pre>
<p>Next, we define a Model class for UpgradeWindow &#8211; UpgradeWindowModel.cs</p>
<pre class="brush: csharp">

public class UpgradeWindowModel : INotifyPropertyChanged
    {
        private string _title;
        public string Title
        {
            get
            {
                return _title;
            }
            set
            {
                _title = value;
                OnPropertyChanged(value);
            }
        }

        private string _content;
        public string Content
        {
            get
            {
                return _content;
            }
            set
            {
                _content = value;
                OnPropertyChanged(value);
            }
        }

        public event PropertyChangedEventHandler PropertyChanged;

        public void OnPropertyChanged(string propertyName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
            }
        }
    }
</pre>
<p>Further, we invoke this UpgradeWindow in our MainPage.cs</p>
<pre class="brush: csharp">

public partial class MainPage : UserControl
    {
        public MainPage()
        {
            InitializeComponent();
            LoadPopUpWindowInOutofBrowser();
        }

        private void LoadPopUpWindowInOutofBrowser()
        {
            NotificationWindow win = new NotificationWindow();
            UpgradeWindow un = new UpgradeWindow();
            un.DataContext = new UpgradeWindowModel { Title = &quot;Checking for upgrades&quot;,
                                                    Content =&quot;Downloading content...&quot; };
            win.Width = un.Width;
            win.Height = un.Height;
            win.Content = un;
            win.Show(10000);
        }
    }
</pre>
<p>And, the NotificationWindow will be displayed when the application is executed.</p>


<p><h2>Related posts:</h2><ul><li><a href='http://www.ganshani.com/2010/01/12/right-click-in-silverlight-4/' rel='bookmark' title='Permanent Link: Right Click in Silverlight 4'>Right Click in Silverlight 4</a></li>
<li><a href='http://www.ganshani.com/2009/08/20/designing-a-popup-in-silverlight/' rel='bookmark' title='Permanent Link: Designing a PopUp in Silverlight'>Designing a PopUp in Silverlight</a></li>
<li><a href='http://www.ganshani.com/2009/09/07/wpf-vs-wpf-xbap-vs-silverlight/' rel='bookmark' title='Permanent Link: WPF vs WPF XBAP vs Silverlight'>WPF vs WPF XBAP vs Silverlight</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.ganshani.com/2010/01/13/notificationwindow-in-silverlight-out-of-browser-apps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Right Click in Silverlight 4</title>
		<link>http://www.ganshani.com/2010/01/12/right-click-in-silverlight-4/</link>
		<comments>http://www.ganshani.com/2010/01/12/right-click-in-silverlight-4/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 06:27:47 +0000</pubDate>
		<dc:creator>Punit Ganshani</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[right click]]></category>

		<guid isPermaLink="false">http://www.ganshani.com/?p=511</guid>
		<description><![CDATA[
			
				
			
		
Let&#8217;s discuss yet another feature of Silverlight 4 &#8211; right click! This was most wanted feature and Microsoft has really blessed the Silverlight world by giving this feature!
Our solution will display a red colored box. User can right click within the area of the red box to customize it.  On right click, a pop up [...]


<h2>Related posts:</h2><ul><li><a href='http://www.ganshani.com/2009/08/20/designing-a-popup-in-silverlight/' rel='bookmark' title='Permanent Link: Designing a PopUp in Silverlight'>Designing a PopUp in Silverlight</a></li>
<li><a href='http://www.ganshani.com/2010/01/13/notificationwindow-in-silverlight-out-of-browser-apps/' rel='bookmark' title='Permanent Link: NotificationWindow in Silverlight (Out of Browser Apps)'>NotificationWindow in Silverlight (Out of Browser Apps)</a></li>
<li><a href='http://www.ganshani.com/2009/08/21/visifire-charting-in-silverlight/' rel='bookmark' title='Permanent Link: Visifire Charting in Silverlight'>Visifire Charting in Silverlight</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.ganshani.com%2F2010%2F01%2F12%2Fright-click-in-silverlight-4%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.ganshani.com%2F2010%2F01%2F12%2Fright-click-in-silverlight-4%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Let&#8217;s discuss yet another feature of Silverlight 4 &#8211; right click! This was most wanted feature and Microsoft has really blessed the Silverlight world by giving this feature!</p>
<blockquote><p>Our solution will display a red colored box. User can right click within the area of the red box to customize it.  On right click, a pop up will be displayed which will allow the user to change the width &amp; height of the red box. This is the simplest example to demonstrate right click in Silverlight 4</p></blockquote>
<p>The design part (XAML):-</p>
<pre class="brush: xml">
&lt;UserControl x:Class=&quot;SilverlightRightClick.MainPage&quot;
xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
xmlns:d=&quot;http://schemas.microsoft.com/expression/blend/2008&quot;
xmlns:mc=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot;
mc:Ignorable=&quot;d&quot;
d:DesignHeight=&quot;302&quot; d:DesignWidth=&quot;345&quot;&gt;

&lt;Grid x:Name=&quot;LayoutRoot&quot; Background=&quot;White&quot;&gt;
&lt;TextBlock Text=&quot;Right-click to customize&quot; FontWeight=&quot;Bold&quot; Margin=&quot;12,0,0,0&quot;/&gt;

&lt;Rectangle Height=&quot;254&quot; HorizontalAlignment=&quot;Left&quot; Margin=&quot;12,24,0,0&quot; Name=&quot;frame&quot;
Stroke=&quot;Black&quot; StrokeThickness=&quot;4&quot; VerticalAlignment=&quot;Top&quot; Width=&quot;320&quot; RadiusX=&quot;15&quot; RadiusY=&quot;15&quot; Fill=&quot;Red&quot;
MouseRightButtonDown=&quot;frame_MouseRightButtonDown&quot;
MouseRightButtonUp=&quot;frame_MouseRightButtonUp&quot; /&gt;

&lt;Popup x:Name=&quot;pop&quot;&gt;
&lt;Border Background=&quot;LightBlue&quot; Margin=&quot;10&quot; BorderBrush=&quot;Blue&quot; CornerRadius=&quot;5&quot; BorderThickness=&quot;3&quot;&gt;
&lt;Grid Width=&quot;235&quot; Height=&quot;138&quot;&gt;
&lt;TextBlock Text=&quot;Customize:&quot; FontWeight=&quot;Bold&quot; HorizontalAlignment=&quot;Center&quot; Margin=&quot;83,0,83,116&quot; /&gt;
&lt;TextBlock Height=&quot;23&quot; HorizontalAlignment=&quot;Left&quot; Margin=&quot;19,30,0,0&quot; Name=&quot;textBlock1&quot; Text=&quot;Width:&quot; VerticalAlignment=&quot;Top&quot; Width=&quot;60&quot; /&gt;
&lt;Slider Height=&quot;23&quot; Name=&quot;slWidth&quot; Margin=&quot;114,31,31,84&quot; Value=&quot;320&quot; Minimum=&quot;10&quot; Maximum=&quot;320&quot; ValueChanged=&quot;slWidth_ValueChanged&quot; /&gt;
&lt;TextBlock Height=&quot;23&quot; HorizontalAlignment=&quot;Left&quot; Margin=&quot;19,72,0,0&quot; Name=&quot;Height&quot; Text=&quot;Height:&quot; VerticalAlignment=&quot;Top&quot; Width=&quot;60&quot; /&gt;
&lt;Slider Height=&quot;23&quot; Margin=&quot;114,72,31,43&quot; Name=&quot;slheight&quot; Minimum=&quot;10&quot; Value=&quot;254&quot; Maximum=&quot;254&quot; ValueChanged=&quot;slheight_ValueChanged&quot; /&gt;
&lt;Button Content=&quot;Done&quot; Height=&quot;23&quot; HorizontalAlignment=&quot;Left&quot; Margin=&quot;129,109,0,0&quot; Name=&quot;btnDone&quot; Click=&quot;btnDone_Click&quot; VerticalAlignment=&quot;Top&quot; Width=&quot;75&quot; /&gt;
&lt;/Grid&gt;
&lt;/Border&gt;
&lt;/Popup&gt;
&lt;/Grid&gt;
&lt;/UserControl&gt;
</pre>
<p>The C# code for this XAML is:</p>
<pre class="brush: csharp">
namespace SilverlightRightClick
{
public partial class MainPage : UserControl
{
public MainPage()
{
InitializeComponent();
}

private void frame_MouseRightButtonDown(object sender, MouseButtonEventArgs e)
{
e.Handled = true;
}

private void frame_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
{
pop.HorizontalOffset = e.GetPosition(null).X + 2;
pop.VerticalOffset = e.GetPosition(null).Y + 2;
pop.IsOpen = true;
}

private void slheight_ValueChanged(object sender, RoutedPropertyChangedEventArgs&lt;double&gt; e)
{
if (frame == null) return;
frame.Height = slheight.Value;
}

private void slWidth_ValueChanged(object sender, RoutedPropertyChangedEventArgs&lt;double&gt; e)
{
if (frame == null) return;
frame.Width = slWidth.Value;
}

private void btnDone_Click(object sender, RoutedEventArgs e)
{
pop.IsOpen = false;
}
}
}
</pre>
<p>Just execute this code and right click on the red colored box!</p>


<p><h2>Related posts:</h2><ul><li><a href='http://www.ganshani.com/2009/08/20/designing-a-popup-in-silverlight/' rel='bookmark' title='Permanent Link: Designing a PopUp in Silverlight'>Designing a PopUp in Silverlight</a></li>
<li><a href='http://www.ganshani.com/2010/01/13/notificationwindow-in-silverlight-out-of-browser-apps/' rel='bookmark' title='Permanent Link: NotificationWindow in Silverlight (Out of Browser Apps)'>NotificationWindow in Silverlight (Out of Browser Apps)</a></li>
<li><a href='http://www.ganshani.com/2009/08/21/visifire-charting-in-silverlight/' rel='bookmark' title='Permanent Link: Visifire Charting in Silverlight'>Visifire Charting in Silverlight</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.ganshani.com/2010/01/12/right-click-in-silverlight-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Printing in Silverlight 4</title>
		<link>http://www.ganshani.com/2010/01/11/printing-in-silverlight-4/</link>
		<comments>http://www.ganshani.com/2010/01/11/printing-in-silverlight-4/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 05:46:30 +0000</pubDate>
		<dc:creator>Punit Ganshani</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Datagrid]]></category>
		<category><![CDATA[printing]]></category>

		<guid isPermaLink="false">http://www.ganshani.com/?p=476</guid>
		<description><![CDATA[
			
				
			
		
Another cool feature that Microsoft has included in Silverlight 4 is the ability to Print any UI Element to any printer and that too, without any complicated code. Let&#8217;s have a quick look at implementing this.
Printing starts with the PrintDocument class.  This class exposes several events &#8211; we shall use only one at this moment [...]


<h2>Related posts:</h2><ul><li><a href='http://www.ganshani.com/2009/09/03/controlstoryboardaction-in-silverlight-3/' rel='bookmark' title='Permanent Link: ControlStoryboardAction in Silverlight 3'>ControlStoryboardAction in Silverlight 3</a></li>
<li><a href='http://www.ganshani.com/2009/07/09/silverlight-2-best-practices-i/' rel='bookmark' title='Permanent Link: Silverlight 2 &#8211; Best Practices &#8211; I'>Silverlight 2 &#8211; Best Practices &#8211; I</a></li>
<li><a href='http://www.ganshani.com/2009/07/13/silverlight-2-best-practices-iv/' rel='bookmark' title='Permanent Link: Silverlight 2 Best Practices &#8211; IV'>Silverlight 2 Best Practices &#8211; IV</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.ganshani.com%2F2010%2F01%2F11%2Fprinting-in-silverlight-4%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.ganshani.com%2F2010%2F01%2F11%2Fprinting-in-silverlight-4%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Another cool feature that Microsoft has included in Silverlight 4 is the ability to Print <strong><span style="text-decoration: underline;">any</span></strong> UI Element to <strong><span style="text-decoration: underline;">any</span></strong> printer and that too, without any complicated code. Let&#8217;s have a quick look at implementing this.</p>
<p>Printing starts with the <strong><span style="color: #0000ff;">PrintDocument </span></strong>class.  This class exposes several events &#8211; we shall use only one at this moment &#8211; that are used to call back to ask you about how to print individual pages.</p>
<p>Initial code:</p>
<pre class="brush: csharp">

PrintDocument docDataGrid = new PrintDocument();
docDataGrid.DocumentName = &quot;Data Grid Print using Silverlight 4&quot;;
docDataGrid.PrintPage += new EventHandler&lt;PrintPageEventArgs&gt;(docDataGrid_PrintPage);
docDataGrid.Print();
</pre>
<p>We first defined a friendly DocumentName. This DocumentName is displayed in the Printer Spooler when printing starts. PrintPage is the core function that is invoked when page is printed, so formating and assigning of content should be done in this function.</p>
<pre class="brush: csharp">

void docDataGrid_PrintPage(object sender, PrintPageEventArgs e)
{

// Stretch to the size of the printed page

dataGrid1.Width = e.PrintableArea.Width;

dataGrid1.Height = e.PrintableArea.Height;

// Assign the XAML element to be printed

e.PageVisual = dataGrid1;

// Specify whether to call again for another page

e.HasMorePages = false;

}
</pre>
<p>What&#8217;s happening here? Initially we are resizing the control to be printed (here dataGrid1) to the size of PrintableArea.  This ensures that the page does not remain blank.</p>
<p>Then, we assign the PageVisual property to the element that needs to be printed.  If this is skipped, no content will be printed.</p>
<p>HasMorePages flag indicates whether there are set of trailing pages that need to be printed as well.  If this is set to true, the same method (docDataGrid_PrintPage) will be invoked again.</p>


<p><h2>Related posts:</h2><ul><li><a href='http://www.ganshani.com/2009/09/03/controlstoryboardaction-in-silverlight-3/' rel='bookmark' title='Permanent Link: ControlStoryboardAction in Silverlight 3'>ControlStoryboardAction in Silverlight 3</a></li>
<li><a href='http://www.ganshani.com/2009/07/09/silverlight-2-best-practices-i/' rel='bookmark' title='Permanent Link: Silverlight 2 &#8211; Best Practices &#8211; I'>Silverlight 2 &#8211; Best Practices &#8211; I</a></li>
<li><a href='http://www.ganshani.com/2009/07/13/silverlight-2-best-practices-iv/' rel='bookmark' title='Permanent Link: Silverlight 2 Best Practices &#8211; IV'>Silverlight 2 Best Practices &#8211; IV</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.ganshani.com/2010/01/11/printing-in-silverlight-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Loading ResourceDictionary in Silverlight</title>
		<link>http://www.ganshani.com/2010/01/07/loading-resourcedictionary-in-silverlight/</link>
		<comments>http://www.ganshani.com/2010/01/07/loading-resourcedictionary-in-silverlight/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 06:47:05 +0000</pubDate>
		<dc:creator>Punit Ganshani</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[resourcedictionary]]></category>
		<category><![CDATA[themes]]></category>

		<guid isPermaLink="false">http://www.ganshani.com/?p=468</guid>
		<description><![CDATA[
			
				
			
		
ResourceDictionary in Silverlight consists of styles, pallates, and other static resources.
These static resources &#8211; styles &#8211; can be bound to UIElements in the view when the view is loaded.  However once the view is loaded, any change in the resources will not affect the loaded view.  Views that are loaded after the change in resource dictionary [...]


<h2>Related posts:</h2><ul><li><a href='http://www.ganshani.com/2009/12/16/dynamic-theme-in-silverlight-3/' rel='bookmark' title='Permanent Link: Dynamic Theme in Silverlight 3'>Dynamic Theme in Silverlight 3</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.ganshani.com%2F2010%2F01%2F07%2Floading-resourcedictionary-in-silverlight%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.ganshani.com%2F2010%2F01%2F07%2Floading-resourcedictionary-in-silverlight%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>ResourceDictionary in Silverlight consists of styles, pallates, and other static resources.</p>
<p>These static resources &#8211; styles &#8211; can be bound to UIElements in the view when the view is loaded.  However once the view is loaded, any change in the resources will not affect the loaded view.  Views that are loaded after the change in resource dictionary will undergo the changes.  Let&#8217;s take an example:</p>
<p>There are two ResourceDictionary files. One defines the background of Button as &#8216;Black&#8217; and the other defines it as &#8216;White&#8217;</p>
<p>Initially, Black RD is applied so when the view is created, button (btnButton1) appears black.</p>
<p>Now lets apply White RD dynamically.  This will not change the color of already loaded button (btnButton1) and it will appear as Black.</p>
<p>But any Button that is loaded after this change (application of White RD) will appear White in color.</p>
<p>Now the question comes, how to achieve this change behavior dynamically &#8211; through C# code &#8211; lets see that.</p>
<blockquote><pre class="brush: csharp">

ResourceDictionary dictionary = Application.Current.Resources as ResourceDictionary; XDocument xaml = XDocument.Load(@&quot;WhiteTheme.xaml&quot;);
ResourceDictionary rd = XamlReader.Load(xaml.ToString()) as ResourceDictionary;
dictionary.MergedDictionaries.Clear();
dictionary.Clear(); dictionary.MergedDictionaries.Add(rd);
</pre>
</blockquote>
<p>This code snippet will load the <span style="color: #800000;">WhiteTheme.xaml </span>(a ResourceDictionary file) dynamically by removing the existing applied ResourceDictionary (<span style="color: #800000;">BlackTheme.xaml</span>)</p>


<p><h2>Related posts:</h2><ul><li><a href='http://www.ganshani.com/2009/12/16/dynamic-theme-in-silverlight-3/' rel='bookmark' title='Permanent Link: Dynamic Theme in Silverlight 3'>Dynamic Theme in Silverlight 3</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.ganshani.com/2010/01/07/loading-resourcedictionary-in-silverlight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adieu 2009!</title>
		<link>http://www.ganshani.com/2010/01/04/adieu-2009/</link>
		<comments>http://www.ganshani.com/2010/01/04/adieu-2009/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 09:09:20 +0000</pubDate>
		<dc:creator>Punit Ganshani</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Miscellenous]]></category>
		<category><![CDATA[Off-track]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Winform]]></category>
		<category><![CDATA[2009]]></category>
		<category><![CDATA[2010]]></category>
		<category><![CDATA[whats new]]></category>

		<guid isPermaLink="false">http://www.ganshani.com/?p=460</guid>
		<description><![CDATA[
			
				
			
		
Fifty five! That is 79% more activity on ganshani.com than activities before the year 2009! This means more information on this site, better &#38; more code, more visitors, and more knowledge transfer.
2009 was a real good year for the readers of this site.  We are glad to have added 55 posts in this year.. All focusing [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.ganshani.com%2F2010%2F01%2F04%2Fadieu-2009%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.ganshani.com%2F2010%2F01%2F04%2Fadieu-2009%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p><span style="color: #0000ff;">Fifty five!</span> That is <span style="color: #ff0000; font-size: 22px;">79% </span>more activity on <a href="http://www.ganshani.com" target="_self">ganshani.com</a> than activities before the year 2009! This means more information on this site, better &amp; more code, more visitors, and more knowledge transfer.</p>
<p>2009 was a real good year for the readers of this site.  We are glad to have added<span style="color: #800000;"><span style="font-size: 22px;"> <strong>55</strong></span> </span>posts in this year.. All focusing majorly on three areas:</p>
<ul>
<li><span style="color: #0000ff;">Silverlight &#8211; 25 posts &#8211; 45.5 %</span></li>
<li>Winform &#8211; 19 posts &#8211; 34.5 %</li>
<li>Off-track &#8211; 11 posts &#8211; 20 %</li>
</ul>
<p>The average time on site increased with <strong><span style="color: #0000ff;font-size: 22px;">87.74%</span></strong> new visitors to the site &#8211; this surely means, that the areas of concentration are much liked by. <img src='http://www.ganshani.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><span style="color: #0000ff; font-size: 22px;">10 most <strong><span style="text-decoration: underline;">visited</span></strong> </span>links in the order of popularity:-</p>
<ul>
<li><a href="http://www.ganshani.com/2009/09/23/silverlight-training-kit/" target="_blank">Silverlight Training Kit</a></li>
<li><a href="http://www.ganshani.com/2009/12/16/dynamic-theme-in-silverlight-3/" target="_blank">Dynamic Themes in Silverlight 3</a></li>
<li><a href="http://www.ganshani.com/2008/06/28/bluetooth-with-csharp/" target="_blank">Bluetooth with C#</a></li>
<li><a href="http://www.ganshani.com/2009/08/26/installation-failed-with-error-code-0x80091007-the-hash-value-is-not-correct/" target="_blank">Installation Error Code Silverlight</a> - 0&#215;80091007-the-hash-value-is-not-correct</li>
<li><a href="http://www.ganshani.com/2009/09/11/list-vs-observablecollection/" target="_blank">List vs Observable Collection</a></li>
<li><a href="http://www.ganshani.com/2008/05/06/date-format-in-gridview-aspnet-20/" target="_blank">Date Format in ASP.NET</a></li>
<li>Hosting Silverlight as Desktop Applications &#8211; <a href="http://www.ganshani.com/2009/09/03/hosting-silverlight-as-desktop-applications-i/" target="_blank">One</a> and <a href="http://www.ganshani.com/2009/09/17/hosting-silverlight-as-desktop-applications-ii/" target="_blank">Two</a></li>
<li><a href="http://www.ganshani.com/2009/02/24/exception-message-box-in-c/" target="_blank">Exception MessageBox in C#</a> </li>
<li>Silverlight Best Practices &#8211; <a href="http://www.ganshani.com/2009/07/09/silverlight-2-best-practices-i/" target="_blank">One</a>, <a href="http://www.ganshani.com/2009/07/10/silverlight-2-best-practices-ii/" target="_blank">Two</a>, <a href="http://www.ganshani.com/2009/07/10/silverlight-2-best-practices-iii/" target="_blank">Three</a>, <a href="http://www.ganshani.com/2009/07/13/silverlight-2-best-practices-iv/" target="_blank">Four</a></li>
<li><a href="http://www.ganshani.com/2009/12/15/floating-container-in-silverlight-3/" target="_blank">Floating Container in Silverlight</a></li>
</ul>
<p>What more..  The site saw a newer look with lot of great features like</p>
<ul>
<li>Better Look and Feel with <span style="color: #0000ff;">WPCandy</span> Theme</li>
<li>Fantastic <a href="http://www.ganshani.com/2008/05/02/gallery/" target="_blank">Gallery</a></li>
<li><span style="color: #0000ff;"><a href="http://www.twitter.com/punitganshani" target="_blank">Twitter</a></span>, <span style="color: #0000ff;">Facebook</span>, <span style="color: #0000ff;">MySpace </span>integration,</li>
<li><span style="color: #0000ff;"><a href="http://www.ganshani.com/contact-me/" target="_blank">Contact form</a></span> for quicker information,</li>
<li>3 <span style="color: #0000ff;"><a href="http://www.ganshani.com/training-kits/" target="_blank">Training Kits</a></span> &#8211; Silverlight, DLINQ and NDoc</li>
<li>and got listed @ <span style="color: #0000ff;">BlogAdda</span></li>
</ul>
<p>So with lot of movement, we are ready to scale newer heights in 2010.  But this needs a continued support from you.  Let us know what you wish to have on our site&#8230;</p>
<p>Wishing you a happy new year!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ganshani.com/2010/01/04/adieu-2009/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Silverlight 4 Security Overview White Paper</title>
		<link>http://www.ganshani.com/2009/12/28/silverlight-4-security-overview-white-paper/</link>
		<comments>http://www.ganshani.com/2009/12/28/silverlight-4-security-overview-white-paper/#comments</comments>
		<pubDate>Mon, 28 Dec 2009 12:29:03 +0000</pubDate>
		<dc:creator>Punit Ganshani</dc:creator>
				<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://www.ganshani.com/?p=458</guid>
		<description><![CDATA[
			
				
			
		
I came through a wonderful link that focuses on Security with Silverlight 3 and Silverlight 4 applications.  Kudos to Nick, who has explained this wonderfully&#8230;
For all my readers, do read this post&#8230; Its wonderful!
@Nick: Thanks man!
Link: http://blogs.msdn.com/nickkramer/archive/2009/11/20/silverlight-4-security-overview-white-paper.aspx


Related posts:WPF vs WPF XBAP vs Silverlight
Silverlight &#038; WPF: MVVM
Silverlight 2.0 &#8211; Advantages, Limitations &#038; Tools



<h2>Related posts:</h2><ul><li><a href='http://www.ganshani.com/2009/09/07/wpf-vs-wpf-xbap-vs-silverlight/' rel='bookmark' title='Permanent Link: WPF vs WPF XBAP vs Silverlight'>WPF vs WPF XBAP vs Silverlight</a></li>
<li><a href='http://www.ganshani.com/2009/09/17/silverlight-wpf-mvvm/' rel='bookmark' title='Permanent Link: Silverlight &#038; WPF: MVVM'>Silverlight &#038; WPF: MVVM</a></li>
<li><a href='http://www.ganshani.com/2008/06/19/silverlight-20-advantages-limitations-tools/' rel='bookmark' title='Permanent Link: Silverlight 2.0 &#8211; Advantages, Limitations &#038; Tools'>Silverlight 2.0 &#8211; Advantages, Limitations &#038; Tools</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.ganshani.com%2F2009%2F12%2F28%2Fsilverlight-4-security-overview-white-paper%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.ganshani.com%2F2009%2F12%2F28%2Fsilverlight-4-security-overview-white-paper%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I came through a wonderful link that focuses on Security with Silverlight 3 and Silverlight 4 applications.  Kudos to Nick, who has explained this wonderfully&#8230;</p>
<p>For all my readers, do read this post&#8230; Its wonderful!</p>
<p>@Nick: Thanks man!</p>
<p>Link: <a href="http://blogs.msdn.com/nickkramer/archive/2009/11/20/silverlight-4-security-overview-white-paper.aspx">http://blogs.msdn.com/nickkramer/archive/2009/11/20/silverlight-4-security-overview-white-paper.aspx</a></p>


<p><h2>Related posts:</h2><ul><li><a href='http://www.ganshani.com/2009/09/07/wpf-vs-wpf-xbap-vs-silverlight/' rel='bookmark' title='Permanent Link: WPF vs WPF XBAP vs Silverlight'>WPF vs WPF XBAP vs Silverlight</a></li>
<li><a href='http://www.ganshani.com/2009/09/17/silverlight-wpf-mvvm/' rel='bookmark' title='Permanent Link: Silverlight &#038; WPF: MVVM'>Silverlight &#038; WPF: MVVM</a></li>
<li><a href='http://www.ganshani.com/2008/06/19/silverlight-20-advantages-limitations-tools/' rel='bookmark' title='Permanent Link: Silverlight 2.0 &#8211; Advantages, Limitations &#038; Tools'>Silverlight 2.0 &#8211; Advantages, Limitations &#038; Tools</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.ganshani.com/2009/12/28/silverlight-4-security-overview-white-paper/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>RichTextBox in Silverlight 4</title>
		<link>http://www.ganshani.com/2009/12/24/richtextbox-in-silverlight-4/</link>
		<comments>http://www.ganshani.com/2009/12/24/richtextbox-in-silverlight-4/#comments</comments>
		<pubDate>Thu, 24 Dec 2009 04:39:11 +0000</pubDate>
		<dc:creator>Punit Ganshani</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://www.ganshani.com/?p=455</guid>
		<description><![CDATA[
			
				
			
		
I was trying my hands on Silverlight 4 Beta version and found this is wonderful control &#8211; RichTextBox.. This was much needed on Web Platform and Microsoft has really made it work simple&#8230; Rather, thanks to the invention of XAML!
This small control supports many features. Some of them are:

Formatting of text at runtime &#8211; font, [...]


<h2>Related posts:</h2><ul><li><a href='http://www.ganshani.com/2009/09/03/controlstoryboardaction-in-silverlight-3/' rel='bookmark' title='Permanent Link: ControlStoryboardAction in Silverlight 3'>ControlStoryboardAction in Silverlight 3</a></li>
<li><a href='http://www.ganshani.com/2009/09/17/hosting-silverlight-as-desktop-applications-ii/' rel='bookmark' title='Permanent Link: Hosting Silverlight as Desktop Applications &#8211; II'>Hosting Silverlight as Desktop Applications &#8211; II</a></li>
<li><a href='http://www.ganshani.com/2009/08/20/designing-a-popup-in-silverlight/' rel='bookmark' title='Permanent Link: Designing a PopUp in Silverlight'>Designing a PopUp in Silverlight</a></li>
</ul>]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fwww.ganshani.com%2F2009%2F12%2F24%2Frichtextbox-in-silverlight-4%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fwww.ganshani.com%2F2009%2F12%2F24%2Frichtextbox-in-silverlight-4%2F&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I was trying my hands on Silverlight 4 Beta version and found this is wonderful control &#8211; RichTextBox.. This was much needed on Web Platform and Microsoft has really made it work simple&#8230; Rather, thanks to the invention of XAML!</p>
<p>This small control supports many features. Some of them are:</p>
<ul>
<li>Formatting of text at runtime &#8211; font, color, bold, italics, underline, etc.</li>
<li>Addition of inline UI Elements in the Text Box itself.</li>
<li>Read / Write only modes both supported.</li>
<li>Hyperlinks can also be inserted in the text.</li>
</ul>
<p>Let&#8217;s do some scripting. Two ways to work:-</p>
<p><strong><span style="text-decoration: underline;">Way 1: Texting through XAML</span></strong></p>
<div id="_mcePaste" style="text-decoration: underline; position: absolute; left: -10000px; top: 142px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden; display: inline !important;">
<pre class="brush: xml">&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot; style=&quot;text-decoration: underline; position: absolute; left: -10000px; top: 142px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;RichTextArea VerticalScrollBarVisibility=&quot;Auto&quot; x:Name=&quot;richTextBox&quot;&gt;&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot; style=&quot;text-decoration: underline; position: absolute; left: -10000px; top: 142px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;Paragraph&gt; This is a &lt;Bold&gt;sample&lt;/Bold&gt; text. &lt;/Paragraph&gt;&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot; style=&quot;text-decoration: underline; position: absolute; left: -10000px; top: 142px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;&lt;/RichTextArea&gt;&lt;/div&gt;
&lt;div id=&quot;_mcePaste&quot; style=&quot;text-decoration: underline; position: absolute; left: -10000px; top: 142px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;&quot;&gt;</pre>
</div>
<pre class="brush: xml">

&lt;RichTextArea VerticalScrollBarVisibility=&quot;Auto&quot; x:Name=&quot;richTextBox&quot;&gt;

&lt;Paragraph&gt; This is a &lt;Bold&gt;sample&lt;/Bold&gt; text. &lt;/Paragraph&gt;

&lt;/RichTextArea&gt;
</pre>
<p><strong><span style="text-decoration: underline;">Way 2: Texting through C# Code</span></strong></p>
<pre class="brush: csharp">

// Create a Run of plain text and some bold text.

Run myRun1 = new Run();

myRun1.Text = &quot;This is a &quot;;

Bold myBold = new Bold();

myBold.Inlines.Add(&quot;sample&quot;);

Run myRun2 = new Run();

myRun2.Text = &quot;text.&quot;;

// Create a paragraph and add the Run and Bold to it.

Paragraph myParagraph = new Paragraph();

myParagraph.Inlines.Add(myRun1);

myParagraph.Inlines.Add(myBold);

myParagraph.Inlines.Add(myRun2);

// Add the paragraph to the RichTextArea.

richTextBox.Blocks.Add(myParagraph);

//Add the RichTextArea to the StackPanel.

stackPanel.Children.Add(richTextBox);
</pre>
<p>Hope this helps!</p>


<p><h2>Related posts:</h2><ul><li><a href='http://www.ganshani.com/2009/09/03/controlstoryboardaction-in-silverlight-3/' rel='bookmark' title='Permanent Link: ControlStoryboardAction in Silverlight 3'>ControlStoryboardAction in Silverlight 3</a></li>
<li><a href='http://www.ganshani.com/2009/09/17/hosting-silverlight-as-desktop-applications-ii/' rel='bookmark' title='Permanent Link: Hosting Silverlight as Desktop Applications &#8211; II'>Hosting Silverlight as Desktop Applications &#8211; II</a></li>
<li><a href='http://www.ganshani.com/2009/08/20/designing-a-popup-in-silverlight/' rel='bookmark' title='Permanent Link: Designing a PopUp in Silverlight'>Designing a PopUp in Silverlight</a></li>
</ul></p>]]></content:encoded>
			<wfw:commentRss>http://www.ganshani.com/2009/12/24/richtextbox-in-silverlight-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
