<?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>Silverlight Forums - Silverlight Tutorials, Articles and News</title>
	<atom:link href="http://www.silverlightforums.com/tutorials/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.silverlightforums.com/tutorials/</link>
	<description>Your Silverlight Community</description>
	<lastBuildDate>Wed, 07 Apr 2010 23:11:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>How to read a resource file (.resx) in Silverlight</title>
		<link>http://www.silverlightforums.com/tutorials/?p=200</link>
		<comments>http://www.silverlightforums.com/tutorials/?p=200#comments</comments>
		<pubDate>Wed, 07 Apr 2010 22:48:35 +0000</pubDate>
		<dc:creator>Allan Muller</dc:creator>
				<category><![CDATA[Featured Post]]></category>

		<guid isPermaLink="false">http://www.silverlightforums.com/tutorials/?p=200</guid>
		<description><![CDATA[Resource files are extremely useful. They allow you to store data that is accessible within your Silverlight application and often you will see resource files used for localisation.
A resource file (.resx) allows you to store data in the following format

Name
Value
Comment &#8211; used mainly for your internal knowledge

To read the contents of your resource file try this snippet [...]]]></description>
			<content:encoded><![CDATA[<p>Resource files are extremely useful. They allow you to store data that is accessible within your Silverlight application and often you will see resource files used for localisation.</p>
<p>A resource file (.resx) allows you to store data in the following format</p>
<ul>
<li><strong>Name</strong></li>
<li><strong>Value</strong></li>
<li><strong>Comment</strong> &#8211; used mainly for your internal knowledge</li>
</ul>
<p>To read the contents of your resource file try this snippet of code</p>
<pre class="brush: csharp;">
#region Private Members
private ResourceManager rm = null;
public Dictionary&lt;string, string&gt; Links { get; set; }
#endregion

#region Private Methods
private void LoadData()
        {
            Links = new Dictionary&lt;string, string&gt;();
            rm = new ResourceManager(&quot;Resources.ResourceFile&quot;, Assembly.GetExecutingAssembly());
            foreach (var resource in rm.GetResourceSet(CultureInfo.CurrentCulture, true, true))
            {
                var r = (System.Collections.DictionaryEntry)resource;
                Links.Add(r.Key.ToString(), r.Value.ToString());
            }
            _replayLoaded = true;
            DetermineDataStatus();
        }
#endregion
</pre>
<p>If you have any questions why not post in the <a href="http://www.silverlightforums.com" target="_self">forums</a>?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silverlightforums.com/tutorials/?feed=rss2&amp;p=200</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silverlight: Setting MIME Types for Silverlight in IIS</title>
		<link>http://www.silverlightforums.com/tutorials/?p=174</link>
		<comments>http://www.silverlightforums.com/tutorials/?p=174#comments</comments>
		<pubDate>Tue, 23 Feb 2010 17:05:18 +0000</pubDate>
		<dc:creator>Allan Muller</dc:creator>
				<category><![CDATA[Featured Post 1]]></category>

		<guid isPermaLink="false">http://www.silverlightforums.com/tutorials/?p=174</guid>
		<description><![CDATA[Deploying Silverlight apps is pretty easy but often one of the steps is overlooked. That step is MIME types. (Multipurpose Internet Mail Extensions) MIME types define the content type.
To set the MIME types for Silverlight follow these steps
1. Open up IIS
2. Select &#8216;Default Web site&#8217; from the left hand menu and click on the MIME types [...]]]></description>
			<content:encoded><![CDATA[<p>Deploying Silverlight apps is pretty easy but often one of the steps is overlooked. That step is MIME types. (Multipurpose Internet Mail Extensions) MIME types define the content type.</p>
<p>To set the MIME types for Silverlight follow these steps</p>
<p>1. Open up IIS</p>
<div id="attachment_175" class="wp-caption alignnone" style="width: 560px"><a href="http://www.silverlightforums.com/tutorials/wp-content/uploads/2010/02/2010-02-23_155422.png"><img class="size-full wp-image-175" title="IIS - Select Default Web site and click MIME types" src="http://www.silverlightforums.com/tutorials/wp-content/uploads/2010/02/2010-02-23_155422.png" alt="IIS - Select Default Web site and click MIME types" width="550" height="315" /></a><p class="wp-caption-text">IIS - Select Default Web site and click MIME types</p></div>
<p>2. Select &#8216;Default Web site&#8217; from the left hand menu and click on the MIME types icon (above)</p>
<div id="attachment_176" class="wp-caption alignnone" style="width: 560px"><a href="http://www.silverlightforums.com/tutorials/wp-content/uploads/2010/02/2010-02-23_154458.png"><img class="size-full wp-image-176" title="Select Add MIME Type" src="http://www.silverlightforums.com/tutorials/wp-content/uploads/2010/02/2010-02-23_154458.png" alt="Select Add MIME Type" width="550" height="315" /></a><p class="wp-caption-text">Select Add MIME Type</p></div>
<p>3. Select Add from the actions (above)</p>
<div id="attachment_177" class="wp-caption alignnone" style="width: 366px"><a href="http://www.silverlightforums.com/tutorials/wp-content/uploads/2010/02/2010-02-23_154534.png"><img class="size-full wp-image-177" title="Add the MIME type details" src="http://www.silverlightforums.com/tutorials/wp-content/uploads/2010/02/2010-02-23_154534.png" alt="Add the MIME type details" width="356" height="201" /></a><p class="wp-caption-text">Add the MIME type details</p></div>
<p>4. Enter the MIME type details (above)</p>
<p>5. Click OK</p>
<div id="attachment_179" class="wp-caption alignnone" style="width: 560px"><a href="http://www.silverlightforums.com/tutorials/wp-content/uploads/2010/02/2010-02-23_154641.png"><img class="size-full wp-image-179" title="Restart IIS to take new MIME types" src="http://www.silverlightforums.com/tutorials/wp-content/uploads/2010/02/2010-02-23_154641.png" alt="Restart IIS to take new MIME types" width="550" height="315" /></a><p class="wp-caption-text">Restart IIS to take new MIME types</p></div>
<p>6. Click on &#8216;Default Web site&#8217; again in the left hand pane and then in the &#8216;Manage Web Site&#8217; on the right click <strong>Restart</strong>* (above)</p>
<p>* restarting the website will stop the web server and any sites will not be accessible during the restart</p>
<p>You should then be able to view Silverlight in your web sites.</p>
<p>If you have any comments or thoughts why not start a thread at <a title="silverlight forums" href="http://www.silverlightforums.com" target="_self">Silverlight Forums</a>?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silverlightforums.com/tutorials/?feed=rss2&amp;p=174</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silverlight: Client Access Policy</title>
		<link>http://www.silverlightforums.com/tutorials/?p=148</link>
		<comments>http://www.silverlightforums.com/tutorials/?p=148#comments</comments>
		<pubDate>Tue, 01 Dec 2009 15:54:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Featured Post 1]]></category>
		<category><![CDATA[Silverlight Tutorials]]></category>

		<guid isPermaLink="false">http://www.silverlighttutorials.com/?p=148</guid>
		<description><![CDATA[Have you ever tried to read a RSS feed and been denied access? Or have you tried to read an XML file and for your code to throw up all manner of exceptions? Well with Silverlight 2 Microsoft decided to address the situation. The solution is a simple XML file called ClientAccessPolicy.xml. The Client Access [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever tried to read a RSS feed and been denied access? Or have you tried to read an XML file and for your code to throw up all manner of exceptions? Well with Silverlight 2 Microsoft decided to address the situation. The solution is a simple XML file called ClientAccessPolicy.xml. The Client Access Policy file allows you to grant access to Silverlight applications to access content on your server like RSS feeds, web services and WCF services.</p>
<p><strong>Before</strong> jumping into the code make sure you read the following to ensure that you don&#8217;t have any conflicts.</p>
<p>When accessing a server (in this case for a RSS feed) Silverlight will automatically look for the Client Access Policy file. If the file exists then it will go by the configuration defined inside that. If the Client Access Policy file does not exist Silverlight by default looks for another file called Cross Domain (crossdomain.xml) which is the file format implemented by Adobe Flash. If the Cross Domain file exists then it will use its configuration settings and if both the Client Access Policy and the Cross Domain files do not exist then Silverlight will throw an exception.</p>
<p>For more information on the Cross Domain file please visit <a href="http://crossdomainxml.org/" target="_blank">crossdomainxml.org</a>.</p>
<p>When creating a Cross Access Policy file my advice would be to start with a file that allows full access to everything, test you code works and this fixes the problem. If you wish to lock it down then you can start tweaking it and testing your code to check there is no knock on effects. Below is the code to grant &#8216;full&#8217; access.</p>
<pre class="brush: xml;">
&amp;lt;access-policy&amp;gt;
  &amp;lt;cross-domain-access&amp;gt;
    &amp;lt;policy&amp;gt;
      &amp;lt;allow-from http-request-headers=&amp;amp;quot;SOAPAction&amp;amp;quot;&amp;gt;
        &amp;lt;domain uri=&amp;amp;quot;http://*&amp;amp;quot;/&amp;gt;
        &amp;lt;domain uri=&amp;amp;quot;https://*&amp;amp;quot; /&amp;gt;
      &amp;lt;/allow-from&amp;gt;
      &amp;lt;grant-to&amp;gt;
        &amp;lt;resource include-subpaths=&amp;amp;quot;true&amp;amp;quot; path=&amp;amp;quot;/&amp;amp;quot;/&amp;gt;
      &amp;lt;/grant-to&amp;gt;
    &amp;lt;/policy&amp;gt;
  &amp;lt;/cross-domain-access&amp;gt;
&amp;lt;/access-policy&amp;gt;
</pre>
<p>To lock down the file you have several options but the main two are:</p>
<ol>
<li>&lt;allow-from/&gt; Defines the sites that are allowed to access resources in a certain policy.</li>
<li>&lt;grant-to/&gt; Defines all the server’s resources that are affected by this policy.</li>
</ol>
<p>To only allow certain sites to access your content list the sites domains in the &lt;allow-from /&gt; tags like below:</p>
<pre class="brush: xml;">
&amp;lt;access-policy&amp;gt;
  &amp;lt;cross-domain-access&amp;gt;
    &amp;lt;policy&amp;gt;
      &amp;lt;allow-from http-request-headers=&amp;amp;quot;SOAPAction&amp;amp;quot;&amp;gt;
        &amp;lt;domain uri=&amp;amp;quot;http://silverlightforums.com&amp;amp;quot;/&amp;gt;
        &amp;lt;domain uri=&amp;amp;quot;http://silverlighttutorials.com&amp;amp;quot;/&amp;gt;
      &amp;lt;/allow-from&amp;gt;
      &amp;lt;grant-to&amp;gt;
        &amp;lt;resource include-subpaths=&amp;amp;quot;true&amp;amp;quot; path=&amp;amp;quot;/&amp;amp;quot;/&amp;gt;
      &amp;lt;/grant-to&amp;gt;
    &amp;lt;/policy&amp;gt;
  &amp;lt;/cross-domain-access&amp;gt;
&amp;lt;/access-policy&amp;gt;
</pre>
<p>The above Client Access Policy will only allow access requests made from Silverlightforums.com or Silverlighttutorials.com and all other requests will be blocked. Requests from those two sites will be granted access to all content (including sub-directories).</p>
<p>The following Client Access Policy with allow access to all requests made from Silverlightforums.com but the only grant access to files inside the &#8216;feeds&#8217; directory:</p>
<pre class="brush: xml;">
&amp;lt;access-policy&amp;gt;
  &amp;lt;cross-domain-access&amp;gt;
    &amp;lt;policy&amp;gt;
      &amp;lt;allow-from http-request-headers=&amp;amp;quot;SOAPAction&amp;amp;quot;&amp;gt;
        &amp;lt;domain uri=&amp;amp;quot;http://silverlightforums.com&amp;amp;quot;/&amp;gt;
        &amp;lt;domain uri=&amp;amp;quot;http://silverlighttutorials.com&amp;amp;quot;/&amp;gt;
      &amp;lt;/allow-from&amp;gt;
      &amp;lt;grant-to&amp;gt;
        &amp;lt;resource include-subpaths=&amp;amp;quot;false&amp;amp;quot; path=&amp;amp;quot;/feeds&amp;amp;quot;/&amp;gt;
      &amp;lt;/grant-to&amp;gt;
    &amp;lt;/policy&amp;gt;
  &amp;lt;/cross-domain-access&amp;gt;
&amp;lt;/access-policy&amp;gt;
</pre>
<p>If you are comfortable with XML then setting up a Client Access Policy should be a breeze, but if you have any questions or need any help feel free to ask at <a title="silverlight forums" href="http://www.silverlightforums.com" target="_self">Silverlight Forums</a>.</p>
<p>Further information on the Client Access Policy can be found <a title="Client Access Policy Silverlight" href="http://msdn.microsoft.com/en-us/library/cc645032(VS.95).aspx" target="_blank">here at MSDN</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silverlightforums.com/tutorials/?feed=rss2&amp;p=148</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silverlight: How to read RSS in Silverlight 3</title>
		<link>http://www.silverlightforums.com/tutorials/?p=71</link>
		<comments>http://www.silverlightforums.com/tutorials/?p=71#comments</comments>
		<pubDate>Wed, 16 Sep 2009 22:42:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Featured Post 2]]></category>
		<category><![CDATA[Silverlight Tutorials]]></category>

		<guid isPermaLink="false">http://www.silverlighttutorials.com/?p=71</guid>
		<description><![CDATA[RSS is an essential part of the internet and is almost used on every website from youtube to Silverlight Forums. It&#8217;s no surprise that one of the most common questions I am asked is how do you read RSS in Silverlight? Well the answer is pretty straight forward and I am going to show you [...]]]></description>
			<content:encoded><![CDATA[<p>RSS is an essential part of the internet and is almost used on every website from youtube to <a title="Silverlight Forums" href="http://www.silverlightforums.com/forumdisplay.php?f=8" target="_blank">Silverlight Forums</a>. It&#8217;s no surprise that one of the most common questions I am asked is how do you read RSS in Silverlight? Well the answer is pretty straight forward and I am going to show you how to do it.</p>
<p>For this tutorial I am going to consume an RSS feed from Silverlight Forums.</p>
<p>First create you project and once it&#8217;s setup then right click on &#8216;<strong>References</strong>&#8216; in the Silverlight application as shown</p>
<div id="attachment_133" class="wp-caption alignnone" style="width: 263px"><a href="http://www.silverlighttutorials.com/wp-content/uploads/2009/09/2009-09-16_215528.png"><img class="size-full wp-image-133" title="2009-09-16_215528" src="http://www.silverlighttutorials.com/wp-content/uploads/2009/09/2009-09-16_215528.png" alt="Silverlight Add Reference" width="253" height="329" /></a><p class="wp-caption-text">Silverlight Add Reference</p></div>
<p>Select &#8216;<strong>Add Reference</strong>&#8216; and choose &#8216;<strong>System.ServiceModel.Syndication</strong>&#8216;</p>
<div id="attachment_134" class="wp-caption alignnone" style="width: 492px"><a href="http://www.silverlighttutorials.com/wp-content/uploads/2009/09/2009-09-16_215604.png"><img class="size-full wp-image-134" title="2009-09-16_215604" src="http://www.silverlighttutorials.com/wp-content/uploads/2009/09/2009-09-16_215604.png" alt="Silverlight Add Reference - Synidication" width="482" height="406" /></a><p class="wp-caption-text">Silverlight Add Reference - Syndication</p></div>
<p>Now that the project is setup you can now get on with the coding <img src='http://www.silverlightforums.com/tutorials//wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  On the Xaml I have added a ScrollViewer and a StackPanel. On the ScrollViewer I have set &#8216;<strong>ScrollViewer.VerticalScrollBarVisibility=&#8221;Auto&#8221;</strong>&#8216; to auto so that a vertical scrollbar will be visible.</p>
<pre class="brush: xml;">
&amp;lt;UserControl x:Class=&amp;amp;quot;SilverlightForums_ReadRSS.MainPage&amp;amp;quot;
    xmlns=&amp;amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;amp;quot;
    xmlns:x=&amp;amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;amp;quot;
    xmlns:d=&amp;amp;quot;http://schemas.microsoft.com/expression/blend/2008&amp;amp;quot; xmlns:mc=&amp;amp;quot;http://schemas.openxmlformats.org/markup-compatibility/2006&amp;amp;quot;
    mc:Ignorable=&amp;amp;quot;d&amp;amp;quot; d:DesignWidth=&amp;amp;quot;640&amp;amp;quot; d:DesignHeight=&amp;amp;quot;480&amp;amp;quot;&amp;gt;
  &amp;lt;StackPanel x:Name=&amp;amp;quot;LayoutRoot&amp;amp;quot; Background=&amp;amp;quot;AliceBlue&amp;amp;quot;&amp;gt;
      &amp;lt;HyperlinkButton Content=&amp;amp;quot;Silverlight Forums&amp;amp;quot; NavigateUri=&amp;amp;quot;http://www.silverlightforums.com&amp;amp;quot; TargetName=&amp;amp;quot;_blank&amp;amp;quot; FontSize=&amp;amp;quot;16&amp;amp;quot; FontWeight=&amp;amp;quot;Bold&amp;amp;quot; Foreground=&amp;amp;quot;Black&amp;amp;quot; HorizontalAlignment=&amp;amp;quot;Right&amp;amp;quot; Margin=&amp;amp;quot;50, 50, 50, 0&amp;amp;quot; /&amp;gt;
      &amp;lt;ScrollViewer Height=&amp;amp;quot;100&amp;amp;quot; Margin=&amp;amp;quot;50, 0, 50, 50&amp;amp;quot; Background=&amp;amp;quot;White&amp;amp;quot; ScrollViewer.VerticalScrollBarVisibility=&amp;amp;quot;Auto&amp;amp;quot;&amp;gt;
            &amp;lt;StackPanel x:Name=&amp;amp;quot;LinkList&amp;amp;quot; Height=&amp;amp;quot;Auto&amp;amp;quot; Width=&amp;amp;quot;Auto&amp;amp;quot; /&amp;gt;
      &amp;lt;/ScrollViewer&amp;gt;
        &amp;lt;StackPanel Orientation=&amp;amp;quot;Horizontal&amp;amp;quot; HorizontalAlignment=&amp;amp;quot;Center&amp;amp;quot;&amp;gt;
            &amp;lt;TextBlock Text=&amp;amp;quot;Created by&amp;amp;quot; /&amp;gt;
            &amp;lt;HyperlinkButton Content=&amp;amp;quot;Silverlight Tutorials&amp;amp;quot; NavigateUri=&amp;amp;quot;http://www.silverlighttutorials.com&amp;amp;quot; TargetName=&amp;amp;quot;_blank&amp;amp;quot; Foreground=&amp;amp;quot;Black&amp;amp;quot; /&amp;gt;
            &amp;lt;TextBlock Text=&amp;amp;quot;and&amp;amp;quot; /&amp;gt;
            &amp;lt;HyperlinkButton Content=&amp;amp;quot;Silverlight Forums&amp;amp;quot; NavigateUri=&amp;amp;quot;http://www.silverlightforums.com&amp;amp;quot; TargetName=&amp;amp;quot;_blank&amp;amp;quot; Foreground=&amp;amp;quot;Black&amp;amp;quot; /&amp;gt;
            &amp;lt;TextBlock Text=&amp;amp;quot;.&amp;amp;quot; /&amp;gt;
      &amp;lt;/StackPanel&amp;gt;
    &amp;lt;/StackPanel&amp;gt;
&amp;lt;/UserControl&amp;gt;
</pre>
<p>On the mainpage.xaml.cs I have setup the following private members</p>
<pre class="brush: csharp;">
        #region Private Members
        private Uri RSSUrl;
        private XmlReader reader;
        private SyndicationFeed feed;
        #endregion
</pre>
<p>Then I set the RSS Url to my Uri and then called a method called GetRSSFeed()</p>
<pre class="brush: csharp;">
        private void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            RSSUrl = new Uri(&amp;amp;quot;http://www.silverlightforums.com/external.php?type=RSS2&amp;amp;quot;);
            GetRSSFeed();
        }
</pre>
<p>The GetRSSFeed() method creates and instance of <strong>WebClient</strong> which is used to retrieve data and is best used for a one-time retrieval of data (which is exactly what we are doing!). Once our WebClient is created we can then register the &#8216;DownloadStringCompleted&#8217; event so once our WebClient has completed retriving the data it will trigger that event. To Kick the retrieval of the RSS feed off I call the WebClient.DownloadStringAsync(Uri) helper method.</p>
<pre class="brush: csharp;">
        private void GetRSSFeed()
        {
            WebClient client = new WebClient();
            client.DownloadStringAsync(RSSUrl);
            client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(client_DownloadStringCompleted);
        }
</pre>
<p>Once the download is complete the following is triggered.</p>
<pre class="brush: csharp;">
        private void client_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
        {
            reader = XmlReader.Create(new StringReader(e.Result));
            feed = SyndicationFeed.Load(reader);

            foreach (SyndicationItem item in feed.Items)
            {
                HyperlinkButton link = new HyperlinkButton();
                link.Content = item.Title.Text;
                link.NavigateUri = item.Links.First().Uri;
                link.TargetName = &amp;amp;quot;_blank&amp;amp;quot;;
                LinkList.Children.Add(link);
            }
        }
</pre>
<div id="attachment_141" class="wp-caption alignnone" style="width: 594px"><a href="http://www.silverlighttutorials.com/wp-content/uploads/2009/09/2009-09-16_232737.png"><img class="size-full wp-image-141" title="2009-09-16_232737" src="http://www.silverlighttutorials.com/wp-content/uploads/2009/09/2009-09-16_232737.png" alt="e.Result fill with RSS data" width="584" height="116" /></a><p class="wp-caption-text">e.Result full with RSS data</p></div>
<p>Now this code processes the RSS feed. An <strong>XmlReader</strong> is setup and is passed the data from the WebClient (e.Result is the RSS feed <img src='http://www.silverlightforums.com/tutorials//wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ). The reader reads all the data in the <strong>StringReader</strong> and then the <strong>SyndicationFeed</strong> (feed) is setup which in turn loads the data from the <strong>XmlReader</strong> (reader).</p>
<div id="attachment_140" class="wp-caption alignnone" style="width: 504px"><a href="http://www.silverlighttutorials.com/wp-content/uploads/2009/09/2009-09-16_232528.png"><img class="size-full wp-image-140" title="2009-09-16_232528" src="http://www.silverlighttutorials.com/wp-content/uploads/2009/09/2009-09-16_232528.png" alt="SyndicationItem populated with RSS node" width="494" height="212" /></a><p class="wp-caption-text">SyndicationItem populated with RSS node</p></div>
<p>Once that is done you can then loop through your RSS nodes and I have done this with a foreach loop. For each <strong>SyndicationItem</strong> inside the <strong>feed.Items</strong> collection it will then create a <strong>HyperLinkButton</strong> with the feed items title and link Uri set to the <strong>HyperLinkButton</strong>. Finally the <strong>HyperLinkButton</strong> control is added to my StackPanel which is called LinkList.</p>
<p>Build the project and run the application and you should see this</p>
<div id="attachment_142" class="wp-caption alignnone" style="width: 510px"><a href="http://www.silverlighttutorials.com/wp-content/uploads/2009/09/2009-09-16_232907.png"><img class="size-full wp-image-142" title="2009-09-16_232907" src="http://www.silverlighttutorials.com/wp-content/uploads/2009/09/2009-09-16_232907.png" alt="Silverlight 3 Reading RSS" width="500" height="328" /></a><p class="wp-caption-text">Silverlight 3 Reading RSS</p></div>
<p>Here you can see the <strong>RSS feed</strong> displayed as <strong>HyperLinkButtons</strong> in a <strong>ScrollViewer</strong>. To update the feed simply refresh the page in the browser.</p>
<p><a href="http://www.silverlighttutorials.com/wp-content/uploads/2009/09/SilverlightForums-ReadRSS.zip">Download the example</a> and take a look. If you have any issues or questions feel free to discuss them at <a href="http://www.silverlightforums.com/forumdisplay.php?f=8">Silverlight Forums</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silverlightforums.com/tutorials/?feed=rss2&amp;p=71</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silverlight: How to obfuscate a font and use it in a Silverlight Application</title>
		<link>http://www.silverlightforums.com/tutorials/?p=75</link>
		<comments>http://www.silverlightforums.com/tutorials/?p=75#comments</comments>
		<pubDate>Sun, 13 Sep 2009 21:28:13 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Featured Post 4]]></category>
		<category><![CDATA[Silverlight Tutorials]]></category>

		<guid isPermaLink="false">http://www.silverlighttutorials.com/?p=75</guid>
		<description><![CDATA[You have your design almost in the bag, you have a font that you want to use but how can you use that font in Silverlight. Without distributing a font (which would be illegal unless you had a license to do this) requires you to obfuscate the font. Obfuscating the font means taking the font [...]]]></description>
			<content:encoded><![CDATA[<p>You have your design almost in the bag, you have a font that you want to use but how can you use that font in Silverlight. Without distributing a font (which would be illegal unless you had a license to do this) requires you to obfuscate the font. Obfuscating the font means taking the font and converting it into an un-usable format outside your application.</p>
<p>So to convert you font follow this simple steps:</p>
<ol>
<li>Open up Word 2007</li>
<li>Type every character, digit and symbol that you might need.</li>
<li>Then select all the copy in the word document and change the font to the desired font.</li>
<li>Save the document as an XPS file.</li>
<li>Now close word and find the XPS file you have just created.</li>
<li>Rename the file from .xps to .zip</li>
<li>Now open that zip file and look inside the &#8216;Resources&#8217; directory and you should see a file with the extension <strong>.odttf</strong></li>
<li>Copy the <strong>.odttf</strong> file into your Silverlight Application and set it&#8217;s build action to &#8216;<strong>Resource</strong>&#8216; (see our tutorial on <a href="http://www.silverlighttutorials.com/?p=77">Silverlight Build Actions</a>)</li>
<li>Now on a TextBlock in your page set the FontFamily location to your <strong>.odttf</strong> file</li>
</ol>
<p>This is how you set the FontFamily on your TextBlock</p>
<pre class="brush: csharp;">
&lt;TextBlock x:Name=&amp;quot;Msg&amp;quot; FontFamily=&amp;quot;./Fonts/20FD640A-6B8C-569B-6B08-6F60BA7CC534.odttf#Segoe UI&amp;quot; FontSize=&amp;quot;17.333&amp;quot; FontWeight=&amp;quot;Bold&amp;quot; Foreground=&amp;quot;White&amp;quot; Text=&amp;quot;This is your font!&amp;quot; TextWrapping=&amp;quot;Wrap&amp;quot; /&gt;
</pre>
<p>The font name (the bold bit!) &#8216;<strong>Segoe UI</strong>&#8216; you see in the FontFamily path after the # needs to be exactly the same as what appears in your Word document dropdown list. This selects the font with the <strong>.odttf</strong> as you could have multiple fonts within the same <strong>.odttf</strong> file.</p>
<p>If you have any questions or need any help simply create a post at <a href="http://www.silverlightforums.com/" target="_blank">Silverlight Forums</a> in the <a title="Silverlight Fonts" href="http://www.silverlightforums.com/forumdisplay.php?f=5" target="_blank">Fonts section</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silverlightforums.com/tutorials/?feed=rss2&amp;p=75</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silverlight: Build Actions</title>
		<link>http://www.silverlightforums.com/tutorials/?p=77</link>
		<comments>http://www.silverlightforums.com/tutorials/?p=77#comments</comments>
		<pubDate>Sun, 13 Sep 2009 20:36:19 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Featured Post]]></category>
		<category><![CDATA[Silverlight Tutorials]]></category>

		<guid isPermaLink="false">http://www.silverlighttutorials.com/?p=77</guid>
		<description><![CDATA[Resources, embedded resources, content and all the other options! It&#8217;s just confusing! So I hope to outline the build actions so you can choose the best one to suit your needs  
Silverlight build actions defined:

None &#8211; Does exactly what it says on the tin (well textbox). The resource file will not be a part [...]]]></description>
			<content:encoded><![CDATA[<p>Resources, embedded resources, content and all the other options! It&#8217;s just confusing! So I hope to outline the build actions so you can choose the best one to suit your needs <img src='http://www.silverlightforums.com/tutorials//wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div id="attachment_128" class="wp-caption alignnone" style="width: 400px"><a href="http://www.silverlighttutorials.com/wp-content/uploads/2009/09/BuildActions1.png"><img class="size-full wp-image-128" title="BuildActions" src="http://www.silverlighttutorials.com/wp-content/uploads/2009/09/BuildActions1.png" alt="Silverlight Build Actions" width="390" height="336" /></a><p class="wp-caption-text">Silverlight Build Actions</p></div>
<p>Silverlight build actions defined:</p>
<ul>
<li><strong>None</strong> &#8211; Does exactly what it says on the tin (well textbox). The resource file will not be a part of the .xap.</li>
<li><strong>Compile</strong> &#8211; This build action is reserved for .cs and .vb files and should not be used for other items.</li>
<li><strong>Content</strong> &#8211; Item will be included in the application package (.xap) without it being embedded it in the project assembly.</li>
<li><strong>Embedded Resource</strong> &#8211; This build action is aimed at non-Silverlight action. Should be changed to a build action of Resource</li>
<li><strong>ApplicationDefinition</strong> &#8211; This build action is reserved for the app.xaml file which defines the start point for your Silverlight application.</li>
<li><strong>Page</strong> &#8211; This build action is given to certain types of Xaml based files like user controls and pages. Mainly used with Silverlight navigation applications.</li>
<li><strong>CodeAnalysisDictionary</strong> &#8211; Unknown.</li>
<li><strong>Resource</strong> &#8211; The file is embedded into the application assembly. The resource is accessible using a relative Uri, relative to the Xaml file from where they are being referenced.</li>
<li><strong>SplashScreen</strong> &#8211; Is for <strong>WPF applications only</strong> and is <a href="http://tozon.info/blog/post/2008/08/11/Splash-Screen-in-WPF.aspx">explained perfectly here</a>.</li>
<li><strong>EntityDeploy</strong> &#8211; is used by the <a href="http://msdn.microsoft.com/en-us/library/aa697427%28VS.80%29.aspx">ADO.NET Entity Framework</a>.</li>
</ul>
<p>Resource files and their related BuildAction alternatives are <a href="http://msdn.microsoft.com/en-us/library/cc296240(VS.95).aspx">explained here</a>.</p>
<p>If you have any comments or thoughts why not start a thread at <a href="http://www.silverlightforums.com/forumdisplay.php?f=11">Silverlight Forums</a>?</p>
<p>Source: <a href="http://blog.flexforcefive.com/?p=98" target="_blank">Bob&#8217;s Blog</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.silverlightforums.com/tutorials/?feed=rss2&amp;p=77</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silverlight: Detect Network Changes</title>
		<link>http://www.silverlightforums.com/tutorials/?p=68</link>
		<comments>http://www.silverlightforums.com/tutorials/?p=68#comments</comments>
		<pubDate>Sun, 13 Sep 2009 17:16:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Featured Post 5]]></category>
		<category><![CDATA[Silverlight Tutorials]]></category>

		<guid isPermaLink="false">http://www.silverlighttutorials.com/?p=68</guid>
		<description><![CDATA[When building RIAs you often rely on data being downloaded when up front via the preloader which is find for getting the look and feel and some static content but when you need to display specific data which the user has input into often you need to pass data to and from web services or [...]]]></description>
			<content:encoded><![CDATA[<p>When building RIAs you often rely on data being downloaded when up front via the preloader which is find for getting the look and feel and some static content but when you need to display specific data which the user has input into often you need to pass data to and from web services or databases. This obviously requires an active internet connection but what happens if the users connection drops? Well in Silverlight 3 the NetworkInformation namespace was introduced which allows you to hook up an event to your application and capture when the connection is alive or dropped.</p>
<p>In this tutorial I am going to show you how to hook up this event and also inform the user of the issue on screen.</p>
<p>I hook up the event on the App.xaml.cs but before we hook up the event we need to create a control which we display on screen. Once you have your project created add a new file &#8216;Silverlight User Control&#8217;</p>
<div id="attachment_101" class="wp-caption alignnone" style="width: 510px"><a href="http://www.silverlighttutorials.com/wp-content/uploads/2009/09/2009-09-13_1233521.jpg"><img class="size-full wp-image-101" title="2009-09-13_123352" src="http://www.silverlighttutorials.com/wp-content/uploads/2009/09/2009-09-13_1233521.jpg" alt="Create a Silverlight User Control" width="500" height="300" /></a><p class="wp-caption-text">Create a Silverlight User Control</p></div>
<p>Once the user control is created you need to add a textblock to the new control so you can inform the user what is happening. Here is the Xaml from my control</p>
<pre class="brush: xml;">
&lt;UserControl x:Class=&amp;quot;SilverlightForums_NetworkInformation.InternetConnectionStatus&amp;quot;
    xmlns=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;
    xmlns:x=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;
    Width=&amp;quot;400&amp;quot; Height=&amp;quot;300&amp;quot;&gt;
    &lt;StackPanel x:Name=&amp;quot;LayoutRoot&amp;quot; Background=&amp;quot;White&amp;quot;&gt;
        &lt;TextBlock x:Name=&amp;quot;Status&amp;quot; Text=&amp;quot;Internet Connection Lost&amp;quot; /&gt;
    &lt;/StackPanel&gt;
&lt;/UserControl&gt;
</pre>
<p>Now that the Xaml is taken care of you can move on to the code. Obviously you should design the Xaml to fit in with your project but for this example it shall do <img src='http://www.silverlightforums.com/tutorials//wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  Now in the <strong>app.xaml.cs</strong> create a private member of your new control.</p>
<pre class="brush: csharp;">
#region Private Members
private InternetConnectionStatus _ics;
private MainPage mainPage;
#endregion
</pre>
<p>Also define a private member of MainPage as you can see I have done this above and it is called <strong>mainPage</strong>.</p>
<p>Now find the &#8216;Application_Startup&#8217; method and comment out the line</p>
<pre class="brush: csharp;">
//this.RootVisual = new MainPage();

mainPage = new MainPage();
this.RootVisual = mainPage;
_ics = new InternetConnectionStatus();
</pre>
<p>The next thing you need to do is hook up the NetworkAddressChanged event in the &#8216;Application_Startup&#8217; like this</p>
<pre class="brush: csharp;">
System.Net.NetworkInformation.NetworkChange.NetworkAddressChanged += new System.Net.NetworkInformation.NetworkAddressChangedEventHandler(NetworkChange_NetworkAddressChanged);
</pre>
<p>Once the event has been hooked up and created you now need to wire up the action for when the connection drops. So inside the event I have hooked up a simple if statement which checks to see if the connection has dropped and if GetIsNetworkAvailable() is false adds the instance of _ics (The user control you created earlier) to the mainpage. The oppersite happens if the GetIsNetworkAvailable() is true &#8211; it removes it.</p>
<pre class="brush: csharp;">
private void NetworkChange_NetworkAddressChanged(object sender, EventArgs e)
        {
            if (System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable() == false)
            {
                if (mainPage.Root.Children.Contains(_ics) == false)
                {
                    mainPage.Root.Children.Add(_ics);
                }
            }
            else if (System.Net.NetworkInformation.NetworkInterface.GetIsNetworkAvailable() == true)
            {
                if (mainPage.Root.Children.Contains(_ics) == true)
                {
                    mainPage.Root.Children.Remove(_ics);
                }
            }
        }
</pre>
<p>Now the final stage is exposing the Root item on the MainPage.xaml.cs which is done by adding this public property</p>
<pre class="brush: csharp;">
public Panel Root
{
get { return LayoutRoot; }
}
</pre>
<p>You should be able to build the Silverlight application and run the project (with your connection active). If you disable your connection (pulling out the Cat5 cable or switching off your wireless connection you should see a message be displayed on your screen like this</p>
<div id="attachment_102" class="wp-caption alignnone" style="width: 510px"><a href="http://www.silverlighttutorials.com/wp-content/uploads/2009/09/2009-09-13_1334521.jpg"><img class="size-full wp-image-102" title="2009-09-13_133452" src="http://www.silverlighttutorials.com/wp-content/uploads/2009/09/2009-09-13_1334521.jpg" alt="Silverlight Internet Connection Alert" width="500" height="409" /></a><p class="wp-caption-text">Silverlight Internet Connection Alert</p></div>
<p>Now that you know how to display a message on screen you might want to integrate this with a ChildWindow (see my previous post &#8211; <a href="http://www.silverlighttutorials.com/?p=39">Silverlight: Custom ChildWindow popup</a>) as this will take the focus away to a popup in which the user must interactive with.</p>
<p>To do that add a Silverlight Child Window to your solution (I have called mine <strong>InternetConnectionStatusPopUp.xaml</strong>) and set up a private member for your popup</p>
<pre class="brush: csharp;">
#region Private Members
//private InternetConnectionStatus _ics;
private InternetConnectionStatusPopUp _ics;
private MainPage mainPage;
#endregion
</pre>
<p>Now in the Application_StartUp create the instance of the ChildWindow</p>
<pre class="brush: csharp;">
//_ics = new InternetConnectionStatus();
_ics = new InternetConnectionStatusPopUp();
</pre>
<p>Now if you rebuild the solution and run it you shall see the following once you drop your internet connection</p>
<div id="attachment_97" class="wp-caption alignnone" style="width: 510px"><a href="http://www.silverlighttutorials.com/wp-content/uploads/2009/09/2009-09-13_1737291.jpg"><img class="size-full wp-image-97" title="2009-09-13_173729" src="http://www.silverlighttutorials.com/wp-content/uploads/2009/09/2009-09-13_1737291.jpg" alt="Silverlight: Detect Network Changes with ChildWindow" width="500" height="409" /></a><p class="wp-caption-text">Silverlight: Detect Network Changes with ChildWindow</p></div>
<p><a href="http://www.silverlighttutorials.com/wp-content/uploads/2009/09/SilverlightForums-NetworkInformation.zip">Download the example</a> from this post and take a look. If you have any issues or questions feel free to <a href="http://www.silverlightforums.com/forumdisplay.php?f=8">discuss them at Silverlight Forums</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.silverlightforums.com/tutorials/?feed=rss2&amp;p=68</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silverlight: Custom ChildWindow popup</title>
		<link>http://www.silverlightforums.com/tutorials/?p=39</link>
		<comments>http://www.silverlightforums.com/tutorials/?p=39#comments</comments>
		<pubDate>Sun, 06 Sep 2009 18:14:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Featured Post 3]]></category>
		<category><![CDATA[Silverlight Tutorials]]></category>

		<guid isPermaLink="false">http://www.silverlighttutorials.com/?p=39</guid>
		<description><![CDATA[Often when building Silverlight RIA you need to prompt the user to confirm an action; Say you are deleting an item you want to make sure they approve the deletion. Just like you do in Windows/Mac OS. In Silverlight 3 the ChildWindow control was added which basically popups a dialog window where you can focus [...]]]></description>
			<content:encoded><![CDATA[<p>Often when building Silverlight RIA you need to prompt the user to confirm an action; Say you are deleting an item you want to make sure they approve the deletion. Just like you do in Windows/Mac OS. In Silverlight 3 the ChildWindow control was added which basically popups a dialog window where you can focus the users attention until you get a confirmation or cancelation on the matter at hand.</p>
<p>In my example I have placed a button inside a StackPanel which once click Shows my ChildWindow. What I do is create the ChildWindow on MainPage Loaded event as a private member and then I can just show or hide it. The reason I do not just keep creating new instances of the ChildWindow is because the garbage collection in Silverlight isn&#8217;t the greatest and I would prefer to keep my apps to a minimum.</p>
<div id="attachment_57" class="wp-caption alignnone" style="width: 310px"><img class="size-medium wp-image-57" title="2009-09-06_190135" src="http://www.silverlighttutorials.com/wp-content/uploads/2009/09/2009-09-06_190135-300x241.jpg" alt="Silverlight ChildWindow Example" width="300" height="241" /><p class="wp-caption-text">Silverlight ChildWindow Example</p></div>
<div id="attachment_58" class="wp-caption alignnone" style="width: 310px"><img class="size-medium wp-image-58" title="2009-09-06_190154" src="http://www.silverlighttutorials.com/wp-content/uploads/2009/09/2009-09-06_190154-300x241.jpg" alt="Silverlight ChildWindow in action" width="300" height="241" /><p class="wp-caption-text">Silverlight ChildWindow in action</p></div>
<p>This is how I setup my ChildWindow as a private member on MainPage.xaml.cs:</p>
<pre class="brush: csharp;">
private PopupWindow _popupWindow;
</pre>
<p>This is how I setup my ChildWindow instance (line 6) on the MainPage Loaded Event:</p>
<pre class="brush: csharp;">
        private void MainPage_Loaded(object sender, RoutedEventArgs e)
        {
            SilverlightForums.Click += new RoutedEventHandler(SilverlightForums_Click);
            SilverlightTutorials.Click += new RoutedEventHandler(SilverlightTutorials_Click);
            // Create instance of PopupWindow
            _popupWindow = new PopupWindow();
            // Hookup Click Event
            ShowPopup.Click += new RoutedEventHandler(ShowPopup_Click);
        }
</pre>
<p>When I click my button on MainPage it calls this Click() method:</p>
<pre class="brush: csharp;">
        private void ShowPopup_Click(object sender, RoutedEventArgs e)
        {
            // Populate PopupWindow
            _popupWindow.ErrorTitle = &amp;amp;quot;If you have any questions visit SilverlightForums.com and ask <img src='http://www.silverlightforums.com/tutorials//wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> &amp;amp;quot;;
            // Display PopupWindow
            _popupWindow.DisplayPopup();
        }
</pre>
<p>On my ChildWindow (called PopupWindow) I have created a property that I can pass through a string message:</p>
<pre class="brush: csharp;">
        #region Properties
        /// &amp;lt;summary&amp;gt;
        /// Gets or sets the title
        /// &amp;lt;/summary&amp;gt;
        public string ErrorTitle
        {
            get { return _errorTitle; }
            set { _errorTitle = value; }
        }
        #endregion
</pre>
<p>To Show and Hide the ChildWindow I have two public methods. One to Show it and one to hide it.</p>
<pre class="brush: csharp;">
        #region Public methods
        public void DisplayPopup()
        {
            this.Show();
        }

        public void HidePopup()
        {
            this.Close();
        }
        #endregion
</pre>
<p>Here is the Xaml From the ChildWindow to show you what it looks like:</p>
<pre class="brush: xml;">
&amp;lt;controls:ChildWindow x:Class=&amp;quot;SilverlightForums_ChildWindow.PopupWindow&amp;quot;
           xmlns=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&amp;quot;
           xmlns:x=&amp;quot;http://schemas.microsoft.com/winfx/2006/xaml&amp;quot;
           xmlns:controls=&amp;quot;clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls&amp;quot;
           Width=&amp;quot;250&amp;quot; Height=&amp;quot;200&amp;quot;
           Title=&amp;quot;PopupWindow&amp;quot;&amp;gt;
    &amp;lt;StackPanel x:Name=&amp;quot;LayoutRoot&amp;quot; Orientation=&amp;quot;Vertical&amp;quot;&amp;gt;
        &amp;lt;TextBlock x:Name=&amp;quot;Title&amp;quot; HorizontalAlignment=&amp;quot;Stretch&amp;quot; VerticalAlignment=&amp;quot;Center&amp;quot; TextWrapping=&amp;quot;Wrap&amp;quot; /&amp;gt;
        &amp;lt;StackPanel Orientation=&amp;quot;Horizontal&amp;quot; Margin=&amp;quot;30,50,0,0&amp;quot;&amp;gt;
            &amp;lt;Button x:Name=&amp;quot;OK&amp;quot; Content=&amp;quot;OK&amp;quot; Width=&amp;quot;75&amp;quot; Height=&amp;quot;23&amp;quot; HorizontalAlignment=&amp;quot;Right&amp;quot; /&amp;gt;
            &amp;lt;Button x:Name=&amp;quot;Cancel&amp;quot; Content=&amp;quot;Cancel&amp;quot; Width=&amp;quot;75&amp;quot; Height=&amp;quot;23&amp;quot; HorizontalAlignment=&amp;quot;Left&amp;quot; /&amp;gt;
        &amp;lt;/StackPanel&amp;gt;
    &amp;lt;/StackPanel&amp;gt;
&amp;lt;/controls:ChildWindow&amp;gt;
</pre>
<p>If you <a style="text-decoration: underline; font-weight: bold; color: #0f3461; padding: 0px; margin: 0px;" title="Silverlight Example Source Code" href="http://www.silverlighttutorials.com/wp-content/uploads/2009/09/SilverlightForums-ChildWindow.zip" target="_self">download the example</a> you will see that the source code is quite easy to follow (probably easier to follow than this posts actually <img src='http://www.silverlightforums.com/tutorials//wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> ). If you have any issues or questions feel free to <a style="text-decoration: none; font-weight: bold; color: #2e8fc6; padding: 0px; margin: 0px;" title="Silverlight ChildWindow at Silverlight Forums" href="http://www.silverlightforums.com/showthread.php?p=170" target="_blank">discuss them here</a></p>
<p>Thank you to <strong><a title="Silverlightfreak at Silverlight Forums" href="http://www.silverlightforums.com/member.php?u=105" target="_blank">Silverlightfreak</a></strong> at <a title="Silverlight Forums" href="http://www.silverlightforums.com/" target="_blank">Silverlight Forums</a> who requested this <a title="Silverlight Tutorial" href="http://www.silverlightforums.com/showthread.php?p=170" target="_blank">Silverlight tutorial</a>. We hope you find it useful <img src='http://www.silverlightforums.com/tutorials//wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.silverlightforums.com/tutorials/?feed=rss2&amp;p=39</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silverlight: Change Background Colour programatically using C#</title>
		<link>http://www.silverlightforums.com/tutorials/?p=1</link>
		<comments>http://www.silverlightforums.com/tutorials/?p=1#comments</comments>
		<pubDate>Thu, 27 Aug 2009 22:56:20 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Featured Post 6]]></category>
		<category><![CDATA[Silverlight Tutorials]]></category>
		<category><![CDATA[Silverlight 3]]></category>
		<category><![CDATA[Silverlight Example]]></category>

		<guid isPermaLink="false">http://www.silverlighttutorials.com/?p=1</guid>
		<description><![CDATA[Often you want to change the colour when you perform an action to indicate to the user that something has happened. In Silverlight this can be done in may ways including using states, styles and directly changing the controls foreground or background colours.
In this example I am going to have a button inside a StackPanel. [...]]]></description>
			<content:encoded><![CDATA[
<p>Often you want to change the colour when you perform an action to indicate to the user that something has happened. In Silverlight this can be done in may ways including using states, styles and directly changing the controls foreground or background colours.</p>
<p>In this example I am going to have a button inside a StackPanel. When the button is clicked I want the StackPanel&#8217;s background to change colour.</p>
<pre class="brush: csharp;">
private void BtnBgcolor_Click(object sender, RoutedEventArgs e)
{
LayoutRoot.Background = new SolidColorBrush(Colors.HotPink);
}
</pre>
<p>My StackPanel is called &#8216;<strong>LayoutRoot</strong>&#8216; and I am addressing its background property by passing it a SolidColorBrush. The SolidColorBrush() allows me to pass in a color from the Windows.Media.Colors class.</p>
<p><a title="Silverlight Example Source Code" href="http://www.silverlighttutorials.com/wp-content/uploads/2009/08/ChangeBackgroundColour1.zip" target="_self">Download the example</a> from this post and take a look. If you have any issues or questions feel free to <a href="http://www.silverlightforums.com/forumdisplay.php?f=4" target="_blank">discuss them here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.silverlightforums.com/tutorials/?feed=rss2&amp;p=1</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
