<?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>Designer Silverlight &#187; backgrounds</title>
	<atom:link href="http://www.designersilverlight.com/category/backgrounds/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.designersilverlight.com</link>
	<description>Matthias Shapiro's Silverlight &#38; WPF Blog - Because Developers Get All The Good Blogs</description>
	<lastBuildDate>Thu, 26 Jan 2012 06:45:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>How To Create a Flexible Striped Gradient In Silverlight and WPF</title>
		<link>http://www.designersilverlight.com/2010/01/13/how-to-create-a-flexible-striped-gradient-in-silverlight-and-wpf/</link>
		<comments>http://www.designersilverlight.com/2010/01/13/how-to-create-a-flexible-striped-gradient-in-silverlight-and-wpf/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 00:35:34 +0000</pubDate>
		<dc:creator>Matthias Shapiro</dc:creator>
				<category><![CDATA[backgrounds]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[Silverlight 3]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[XAML]]></category>
		<category><![CDATA[gradient brush]]></category>

		<guid isPermaLink="false">http://www.designersilverlight.com/2010/01/13/how-to-create-a-flexible-striped-gradient-in-silverlight-and-wpf/</guid>
		<description><![CDATA[Thanks to Joe McBride and Jason Alderman, who discovered this technique in some of Microsoft’s theme packs. I&#8217;m trying something a little new&#8230; I&#8217;m going to post all future Silverlight tutorials on CodeRun, an online IDE. Basically, just follow the link below and click &#8220;Run&#8221; and you&#8217;ll see this in action. You can change the [...]]]></description>
			<content:encoded><![CDATA[<p>Thanks to Joe McBride and Jason Alderman, who discovered this technique in some of Microsoft’s theme packs.</p>
<p>I&#8217;m trying something a little new&#8230; I&#8217;m going to post all future Silverlight tutorials on CodeRun, an online IDE. Basically, just follow the link below and click &#8220;Run&#8221; and you&#8217;ll see this in action. You can change the XAML at CodeRun to test it out, which I find exceptionally cool. Let me know if you a) like this or b) hate this.</p>
<p><a href="http://www.coderun.com/ide/?w=2CkJMKTpW0OOUBaXjngIDQ">Open this project on CodeRun</a>.</p>
<p>This is just a little trick to get a nice flexible striped gradient in Silverlight or WPF. Our end product will look like this</p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2010/01/clip_image001.png"><img style="display: inline; border: 0px;" title="clip_image001" src="http://www.designersilverlight.com/wp-content/uploads/2010/01/clip_image001_thumb.png" border="0" alt="clip_image001" width="639" height="50" /></a></p>
<p>Zoomed in:</p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2010/01/clip_image0015.png"><img style="display: inline; border: 0px;" title="clip_image001[5]" src="http://www.designersilverlight.com/wp-content/uploads/2010/01/clip_image0015_thumb.png" border="0" alt="clip_image001[5]" width="180" height="105" /></a></p>
<p>Just adds some nice texture to the app.</p>
<p>First, go to the element you want to apply the gradient to and go to the (you guessed it!) gradient section in the background.</p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2010/01/clip_image0017.png"><img style="display: inline; border: 0px;" title="clip_image001[7]" src="http://www.designersilverlight.com/wp-content/uploads/2010/01/clip_image0017_thumb.png" border="0" alt="clip_image001[7]" width="322" height="136" /></a></p>
<p>This will pull up the default black-to-white gradient that we all know and love. Give it two more gradient stops as close to the center as you can by clicking on the gradient twice. Make the two left stops the color of your stripe. For this example, I’m using a nice blue gradient with some transparency. I think it fits nice with the background. Also make the two right stops fully transparent. Should look something like this:</p>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2010/01/clip_image00111.png"><img style="display: inline; border: 0px;" title="clip_image001[11]" src="http://www.designersilverlight.com/wp-content/uploads/2010/01/clip_image00111_thumb.png" border="0" alt="clip_image001[11]" width="316" height="90" /></a></p>
<p>Dandy. Now click on the arrow to expand our options (seen at the bottom of the image above) and a new set of options open up for us to futz with. Let’s go ahead and set the following options:</p>
<ul>
<li>StartPoint = 0,0</li>
<li>EndPoint = 1.5, 1.5</li>
<li>MappingMode = Absolute</li>
<li>SpreadMethod = Repeat</li>
</ul>
<p><a href="http://www.designersilverlight.com/wp-content/uploads/2010/01/clip_image00113.png"><img style="display: inline; border: 0px;" title="clip_image001[13]" src="http://www.designersilverlight.com/wp-content/uploads/2010/01/clip_image00113_thumb.png" border="0" alt="clip_image001[13]" width="314" height="142" /></a></p>
<p>And that’s it! We can change the visible color to get something a little more appropriate to our background or we can change the EndPoint to make the stripes wider or at a different angle. But that’s all we need.</p>
<p>Here’s the XAML for reference.</p>
<p>&lt;LinearGradientBrush<br />
EndPoint=&#8221;1.5,1.5&#8243;<br />
MappingMode=&#8221;Absolute&#8221;<br />
SpreadMethod=&#8221;Repeat&#8221;<br />
StartPoint=&#8221;0,0&#8243;&gt;<br />
&lt;GradientStop Color=&#8221;#BF125881&#8243;/&gt;<br />
&lt;GradientStop Color=&#8221;#BE6C9AE0&#8243; Offset=&#8221;0.526&#8243;/&gt;<br />
&lt;GradientStop Color=&#8221;Transparent&#8221; Offset=&#8221;0.544&#8243;/&gt;<br />
&lt;GradientStop Color=&#8221;Transparent&#8221; Offset=&#8221;1&#8243;/&gt;<br />
&lt;/LinearGradientBrush&gt;</p>
<iframe src="http://www.facebook.com/plugins/like.php?href=http://www.designersilverlight.com/2010/01/13/how-to-create-a-flexible-striped-gradient-in-silverlight-and-wpf/&amp;layout=standard&amp;show_faces=1&amp;width=450&amp;action=like&amp;colorscheme=light&amp;font=" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:25px"></iframe><div class="tweetthis" style="text-align:left;"><p> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=How+To+Create+a+Flexible+Striped+Gradient+In+Silverlight+and+WPF+http%3A%2F%2Fdesignersilverlight.com%2F%3Fp%3D879" title="Post to Twitter"><img class="nothumb" src="http://www.designersilverlight.com/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter.png" alt="Post to Twitter" /></a> <a target="_blank" rel="nofollow" class="tt" href="http://twitter.com/intent/tweet?text=How+To+Create+a+Flexible+Striped+Gradient+In+Silverlight+and+WPF+http%3A%2F%2Fdesignersilverlight.com%2F%3Fp%3D879" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://www.designersilverlight.com/2010/01/13/how-to-create-a-flexible-striped-gradient-in-silverlight-and-wpf/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
	</channel>
</rss>

