<?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>Rajeesh&#039;s Blog &#187; Siliverlight</title>
	<atom:link href="http://www.rajeeshcv.com/category/net/siliverlight/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rajeeshcv.com</link>
	<description>Sharing my knowledge</description>
	<lastBuildDate>Sun, 18 Jul 2010 06:09:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Silverlight 2 released</title>
		<link>http://www.rajeeshcv.com/2008/10/silverlight-2-released/</link>
		<comments>http://www.rajeeshcv.com/2008/10/silverlight-2-released/#comments</comments>
		<pubDate>Wed, 15 Oct 2008 15:47:03 +0000</pubDate>
		<dc:creator>Rajeesh</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Siliverlight]]></category>
		<category><![CDATA[Silverlight]]></category>

		<guid isPermaLink="false">http://www.rajeeshcv.com/2008/10/silverlight-2-released/</guid>
		<description><![CDATA[
Silverlight 2 is out now with new features like rich set of controls, improved Text Rendering capabilities, rich networking support including calling secured(SSL) services etc&#8230;
Moreover Microsoft is partnered with Soyatec to sponsor tools for developing Silverlight applications using cross platform Eclipse development platform. eclipse2SL is first of that kind.
eclipse2SL is an open source tools integrated [...]]]></description>
			<content:encoded><![CDATA[<p>
<p>Silverlight 2 is out now with new features like rich set of controls, improved Text Rendering capabilities, rich networking support including calling secured(SSL) services etc&#8230;</p>
<p>Moreover Microsoft is partnered with <a href="http://www.soyatec.com" target="_blank">Soyatec</a> to sponsor tools for developing Silverlight applications using cross platform Eclipse development platform. <a href="http://www.eclipse4sl.org/" target="_blank">eclipse2SL</a> is first of that kind.</p>
<p><a href="http://www.eclipse4sl.org/" target="_blank">eclipse2SL</a> is an open source tools integrated with the Eclipse development platform that enable Java developers to use the Eclipse platform to create applications that run on the Microsoft Silverlight runtime platform. Specifically, the project will be an Eclipse plug-in that works with the Eclipse Integrated Development Environment (IDE) and Eclipse Rich Client Platform (RCP) to provide both a Silverlight development environment and greater interoperability between Silverlight and Java, to facilitate the integration of Silverlight-based applications into Java-based web sites and services.</p>
<p>&#160;</p>
<p><span id="more-69"></span></p>
<p>As an addition to the control set Microsoft is releasing Silverlight Toolkit by end of this month with more UI controls.</p>
<p><a href="http://www.rajeeshcv.com/wp-content/uploads/2008/10/controlsppct-4-thumb.jpg"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="385" alt="Silverlight 2  toolkit" src="http://www.rajeeshcv.com/wp-content/uploads/2008/10/controlsppct-4-thumb-thumb.jpg" width="406" border="0" /></a> </p>
<p><strong><u>Silverlight 2 resources        </p>
<p></u></strong>To get the basic understanding go to <a href="http://silverlight.net/GetStarted/" target="_blank">Get started</a></p>
<p>And here are some good articles written by Scott Guthrie</p>
<li><a href="http://weblogs.asp.net/scottgu/pages/silverlight-2-end-to-end-tutorial-building-a-digg-search-client.aspx">Part 0: Introduction</a> </li>
<li><a href="http://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-1-creating-quot-hello-world-quot-with-silverlight-2-and-vs-2008.aspx">Part 1: Creating &quot;Hello World&quot; with Silverlight 2 and VS 2008</a> </li>
<li><a href="http://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-2-using-layout-management.aspx">Part 2: Using Layout Management</a> </li>
<li><a href="http://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-3-using-networking-to-retrieve-data-and-populate-a-datagrid.aspx">Part 3: Using Networking to Retrieve Data and Populate a DataGrid</a> </li>
<li><a href="http://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-4-using-style-elements-to-better-encapsulate-look-and-feel.aspx">Part 4: Using Style Elements to Better Encapsulate Look and Feel</a> </li>
<li><a href="http://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-5-using-the-listbox-and-databinding-to-display-list-data.aspx">Part 5: Using the ListBox and DataBinding to Display List Data</a> </li>
<li><a href="http://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-6-using-user-controls-to-implement-master-detail-scenarios.aspx">Part 6: Using User Controls to Implement Master/Details Scenarios</a> </li>
<li><a href="http://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-7-using-control-templates-to-customize-a-control-s-look-and-feel.aspx">Part 7: Using Templates to Customize Control Look and Feel</a> </li>
<li><a href="http://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-8-creating-a-digg-desktop-application-using-wpf.aspx">Part 8: Creating a Digg Desktop Version of our Application using WPF</a>
</p>
</li>
]]></content:encoded>
			<wfw:commentRss>http://www.rajeeshcv.com/2008/10/silverlight-2-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>1px line issue in silverlight</title>
		<link>http://www.rajeeshcv.com/2008/05/1px-line-issue-in-silverlight/</link>
		<comments>http://www.rajeeshcv.com/2008/05/1px-line-issue-in-silverlight/#comments</comments>
		<pubDate>Sat, 24 May 2008 10:13:43 +0000</pubDate>
		<dc:creator>Rajeesh</dc:creator>
				<category><![CDATA[Siliverlight]]></category>

		<guid isPermaLink="false">http://www.rajeeshcv.com/2008/05/1px-line-issue-in-silverlight/</guid>
		<description><![CDATA[You might have noticed an issue when creating a line with 1px stroke thickness, when rendering the stroke thickness is more than 1px which is not we are expecting.

Output of this looks like below

Actually this is happening because, the rendering algorithm used inside.
&#160;
So what we need to do to fix this issue&#8230;&#8230;???
Fix: Very simple, add [...]]]></description>
			<content:encoded><![CDATA[<p>You might have noticed an issue when creating a line with 1px stroke thickness, when rendering the stroke thickness is more than 1px which is not we are expecting.</p>
<p><img height="33" alt="Image" src="http://www.rajeeshcv.com/wp-content/uploads/2008/05/image.png" width="450" /></p>
<p>Output of this looks like below</p>
<p><img height="52" alt="Image" src="http://www.rajeeshcv.com/wp-content/uploads/2008/05/image-1.png" width="235" /></p>
<p>Actually this is happening because, the rendering algorithm used inside.</p>
<p>&nbsp;</p>
<p>So what we need to do to fix this issue&#8230;&#8230;???</p>
<p><strong>Fix:</strong> Very simple, add a translate transformation of 0.5 for both X and Y axis.</p>
<p><img height="68" alt="Image" src="http://www.rajeeshcv.com/wp-content/uploads/2008/05/image-2.jpg" width="450" /></p>
<p>&nbsp;</p>
<p>Now if you run, u will get a correct 1px line.</p>
<p><img height="59" alt="Image" src="http://www.rajeeshcv.com/wp-content/uploads/2008/05/image-3.jpg" width="239" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rajeeshcv.com/2008/05/1px-line-issue-in-silverlight/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating a custom silverlight control</title>
		<link>http://www.rajeeshcv.com/2008/05/creating-a-custom-silverlight-control/</link>
		<comments>http://www.rajeeshcv.com/2008/05/creating-a-custom-silverlight-control/#comments</comments>
		<pubDate>Fri, 02 May 2008 00:43:22 +0000</pubDate>
		<dc:creator>Rajeesh</dc:creator>
				<category><![CDATA[Siliverlight]]></category>

		<guid isPermaLink="false">http://www.rajeeshcv.com/2008/05/creating-a-custom-silverlight-control/</guid>
		<description><![CDATA[Download the complete source code from here
In this post, I will explain how to create a custom control in silverlight. The control we create is a simple control which will draw a circle, the radius of the circle is controlled through the exposed public property.
This is a simple control, but hope this will give you [...]]]></description>
			<content:encoded><![CDATA[<p>Download the <a title="Source code" href="http://www.rajeeshcv.com/download/SimpleControl.zip">complete source code from here</a></p>
<p>In this post, I will explain how to create a custom control in silverlight. The control we create is a simple control which will draw a circle, the radius of the circle is controlled through the exposed public property.</p>
<p>This is a simple control, but hope this will give you an idea about the approach to the custom control development in silverlight.</p>
<p><strong>Create a the Silverlight class library project first</strong></p>
<p><img height="272" alt="step1" src="http://www.rajeeshcv.com/wp-content/uploads/2008/05/step1.gif" width="400" /></p>
<p>I have named the solution and project as &#8220;SimpleControl&#8221;, after the class library is created, you will get a default class &#8220;Class1.cs&#8221;</p>
<p><span id="more-12"></span></p>
<p>delete that file. We don&#8217;t need that one; we will be creating a new one later.</p>
<p>
<img height="154" alt="step2" src="http://www.rajeeshcv.com/wp-content/uploads/2008/05/step2.gif" width="246" /></p>
<p>&nbsp;</p>
<p>Add a new text file to the project and give it&#8217;s name &#8220;<strong>HostingSurface.xaml</strong>&#8220;</p>
<p><img height="243" alt="step3" src="http://www.rajeeshcv.com/wp-content/uploads/2008/05/step3.gif" width="400" /></p>
<p>&nbsp;</p>
<p>This xaml file is the root canvas for our control. After completing this, you have change the build action for this xaml file. Change the build action to &#8220;<strong>Embedded Resource</strong>&#8220;</p>
<p><img height="386" alt="step4" src="http://www.rajeeshcv.com/wp-content/uploads/2008/05/step4.gif" width="247" /></p>
<p>&nbsp;</p>
<p>Now we will, create the canvas using the xaml code…</p>
<p><img height="114" alt="step5" src="http://www.rajeeshcv.com/wp-content/uploads/2008/05/step5.gif" width="400" /></p>
<p>&nbsp;</p>
<p>Inside this canvas, we will place the circle element that we are going to create.</p>
<p>
Next, we need to create a class that will, does the actual rendering logic. For that, create a class called &#8220;HostingSurface.xaml.cs&#8221;</p>
<p><img height="242" alt="step6" src="http://www.rajeeshcv.com/wp-content/uploads/2008/05/step6.gif" width="400" /></p>
<p>Derive that class from the base &#8220;Control&#8221; class and we need two variables &#8220;hostingCanvas&#8221; and &#8220;circle&#8221;. &#8220;hostingCanvas&#8221; will point to the root canvas we created in the xaml file. And the &#8220;circle&#8221; variable, will hold the actual Ellipse element.</p>
<p>
We have created a public property &#8220;Radius&#8221; which will control the radius of our circle. We will implement this later.</p>
<p>
Now, we need to load the xaml file and need to initialize the &#8220;hostingCanvas&#8221; variable. For that we use the &#8220;InitializeXaml(…)&#8221; function.</p>
<p><img height="134" alt="step7" src="http://www.rajeeshcv.com/wp-content/uploads/2008/05/step7-2.png" width="450" /></p>
<p>Since, we want to separate the rendering xaml from the code, for that purpose we are going to add a xaml file called &#8220;SimpleCircle.xaml&#8221; into the project. Otherwise, you can hardcode this string value in the class file itself, doing that will make the code unmanageable.</p>
<p><img height="255" alt="step8" src="http://www.rajeeshcv.com/wp-content/uploads/2008/05/step8.png" width="400" /></p>
<p>Mark this xaml file as embedded resource.</p>
<p><img height="295" alt="step9" src="http://www.rajeeshcv.com/wp-content/uploads/2008/05/step9.png" width="247" /></p>
<p>Then create an Ellipse element. Here we have created an Ellipse element with width and Height 100 pixels and filled it with the red color.</p>
<p><img height="128" alt="step10" src="http://www.rajeeshcv.com/wp-content/uploads/2008/05/step10.png" width="450" /></p>
<p>We want this file to be loaded, for that go to the HostingSurface.xaml.cs file and read the embedded &#8220;SimpleCircle.xaml&#8221; file and convert into a Ellipse element. Here we have used XamlReader.Load(…) method to do this. After the circle variable is initialized, we add that element to the root canvas of our control (&#8220;hostingCanvas&#8221;).</p>
<p><img height="240" alt="step11" src="http://www.rajeeshcv.com/wp-content/uploads/2008/05/step11.png" width="450" /></p>
<p>Now, we have the circle element. And we have to update the width and Height when the value of Radius is set.</p>
<p><img height="221" alt="step12" src="http://www.rajeeshcv.com/wp-content/uploads/2008/05/step12.png" width="261" /></p>
<p>And we have completed the simple control. For testing this we need a Silverlight Application project. So create a silverlight application project and add that to our solution. Use the &#8220;Generate an HTML test page&#8221; option while creating this project.</p>
<p><img height="257" alt="step13" src="http://www.rajeeshcv.com/wp-content/uploads/2008/05/step13.gif" width="400" /></p>
<p><img height="329" alt="step14" src="http://www.rajeeshcv.com/wp-content/uploads/2008/05/step14.png" width="400" /></p>
<p>Add the &#8220;SimpletControl&#8221; reference to the newly created siliverlight application project.</p>
<p><img height="103" alt="step15" src="http://www.rajeeshcv.com/wp-content/uploads/2008/05/step15.png" width="400" /></p>
<p>&nbsp;</p>
<p>You need to add, the namespace in the Page.xaml, like this</p>
<p><strong>xmlns:Simple=&#8221;clr-namespace:SimpleControl;assembly=SimpleControl&#8221;</strong></p>
<p><strong>Add the our new control also to the page.xaml</strong></p>
<p><img height="114" alt="step16" src="http://www.rajeeshcv.com/wp-content/uploads/2008/05/step16.png" width="400" /></p>
<p>&nbsp;</p>
<p>Now run the application, you can see a red circle inside a black rectangle.</p>
<p>Hope you all got some fair idea about the custom control development in silverlight. I have included complete screen shot, to just make sure everybody understand the flow.</p>
<p>You can download the complete source from <a title="Silverlight custom control" href="http://www.rajeeshcv.com/download/SimpleControl.zip">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.rajeeshcv.com/2008/05/creating-a-custom-silverlight-control/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
