<?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 &#124; WPF &#124; Microsoft.Net &#187; DispatcherTimer</title>
	<atom:link href="http://joel.neubeck.net/tag/dispatchertimer/feed/" rel="self" type="application/rss+xml" />
	<link>http://joel.neubeck.net</link>
	<description>Simplifing structure without changing results</description>
	<lastBuildDate>Wed, 26 May 2010 18:43:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Silverlight Flipping Tiles Animation</title>
		<link>http://joel.neubeck.net/2008/05/silverlight-flipping-tiles-animation/</link>
		<comments>http://joel.neubeck.net/2008/05/silverlight-flipping-tiles-animation/#comments</comments>
		<pubDate>Fri, 16 May 2008 06:36:30 +0000</pubDate>
		<dc:creator>joel</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[3D Flip]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[Blend]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[DispatcherTimer]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[Tiles]]></category>

		<guid isPermaLink="false">http://joel.neubeck.net/2008/05/silverlight-flipping-tiles-animation/</guid>
		<description><![CDATA[Back a few weeks ago I posted an example of how to create a 3D flip animation similar to the effect seen on an iPhone. Today I will build upon that procedural animation and simulate the flipping tile affect seen in the iTunes album art screen saver, available on a Mac. In my example I [...]]]></description>
			<content:encoded><![CDATA[<p>Back a few weeks ago I posted an example of how to create a <a href="http://joel.neubeck.net/2008/04/silverlight-3d-flip-animation/">3D flip animation</a> similar to the effect seen on an iPhone. Today I will build upon that procedural animation and simulate the flipping tile affect seen in the iTunes album art screen saver, available on a Mac.
<p><iframe src="/wp-content/uploads/2008/05/LeopardSreenSaver/default.html" width="400" height="400"></iframe></p>
<p>In my example I have a total of 16 random tiles displayed from a collection of 42 different images. Any image not currently displayed is available to be randomly selected to replace an existing tile.&nbsp; Here is how I achieve the effect.&nbsp; </p>
<p>The project is comprised of a &#8220;Tile&#8221; UserControl , a class called &#8220;Media&#8221; and two generic lists (one to store references to the 16 tiles and one to store all 42 URI to the images).&nbsp; The first step is to fill my page.xaml grid with 16 tiles.&nbsp;&nbsp; Here is a snip of the code used to fill the grid.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
</pre></td><td class="code"><pre class="c-sharp" style="font-family:monospace;">private void BuildCollection()
{
    int row = -1;
    int col = 0;
    for (int i = 0; i &amp;lt; 42; i++)
    {
        Uri imageUri = new Uri(string.Format(&quot;Images/{0}.png&quot;, 
		(i+1).ToString()), UriKind.Relative);
        if (i &amp;lt;= 16)
        {
            Tile tile = new Tile();
            Media media =  new Media(imageUri, true);
            tile.Media = media;
&nbsp;
            if (col % 4 == 0)
            {
                row++;
                col = 0;
            }
            tile.SetValue(Grid.ColumnProperty, col.ToString());
            tile.SetValue(Grid.RowProperty, row.ToString());
            this.LayoutRoot.Children.Add(tile);
&nbsp;
            col++;
            _tiles.Add(tile);
            _images.Add(media);
&nbsp;
        }
        else
            _images.Add(new Media(imageUri, false));
    }
}</pre></td></tr></table></div>

<p>For those of you just getting familiar with the &#8220;Grid&#8221; control you might not be aware that it supports implicitly specifying columns and rows. In this example I leverage this to ensure my tiles form a nice 4&#215;4 grid.&nbsp;&nbsp; </p>
<p>As you can see from the code, I have chosen to store only the URI to the image and not store the image itself. I had some difficulty storing a &#8220;BitmapImage&#8221; object in my collection and retrieving it consistently when I was ready to flip a tile. The URI seems less efficient, was reliable. </p>
<p>Now that I have built up my grid and two collections, I can use a DispacherTimer to randomly select a tile and randomly select an image to be used as the backside of the flip. He is how that code looks. </p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="c-sharp" style="font-family:monospace;">void _timer_Tick(object sender, EventArgs e)
{
    System.Random RandNum = new System.Random();
    int randomTile = RandNum.Next(16);
&nbsp;
    bool match = false;
    while(!match)
    {
        int randomImage = RandNum.Next(42);
        if(!_images[randomImage].Displayed)
        {
            _images[randomImage].Displayed = true;
            _tiles[randomTile].Media.Displayed = false;
            _tiles[randomTile].Flip(_images[randomImage]);
            match=true;
            break;
        }
    }
}</pre></td></tr></table></div>

<p>As you can see I am using a boolean property in the &#8220;Media&#8221; object to determine if an image is already displayed. The second level of randomization is there to help ensures that I am giving each image equal chance of getting displayed. </p>
<p>If one were to examine the &#8220;Tile&#8221; UserControl, it looks almost exactly like the code I created for the 3D flip animation example. In&nbsp; this situation instead of firing the flip based on a button click, I use the followings public method called from my main page.xaml DispatcherTimer tick. </p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
</pre></td><td class="code"><pre class="c-sharp" style="font-family:monospace;">public void Flip(Media media)
{
    this.Media = media;
&nbsp;
    if (_Front)
    {
        this.ImageBack.Source = new BitmapImage(_Media.ImageUri);
        _sb.Pause();
        _sb.AutoReverse = false;
        _sb.Begin();
        _Front = false;
    }
    else
    {
        this.ImageFront.Source = new BitmapImage(_Media.ImageUri);
        _sb.Pause();
        _sb.AutoReverse = true;
        _sb.Seek(_tsLastFrame);
        _sb.Resume();
&nbsp;
        _Front = true;
    }
}</pre></td></tr></table></div>

<p>Code: <a onclick="javascript: pageTracker._trackPageview('/code/LeopardSreenSaver.zip');" href="/wp-content/uploads/2008/05/LeopardSreenSaver/LeopardSreenSaver.zip">LeopardSreenSaver.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://joel.neubeck.net/2008/05/silverlight-flipping-tiles-animation/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Silverlight Circular Collision Animation</title>
		<link>http://joel.neubeck.net/2008/05/silverlight-circular-collision-animation/</link>
		<comments>http://joel.neubeck.net/2008/05/silverlight-circular-collision-animation/#comments</comments>
		<pubDate>Wed, 14 May 2008 19:34:55 +0000</pubDate>
		<dc:creator>joel</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[Circular Rotation]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Collision]]></category>
		<category><![CDATA[Deflection]]></category>
		<category><![CDATA[DispatcherTimer]]></category>
		<category><![CDATA[RotateTransform]]></category>
		<category><![CDATA[TranslateTransform]]></category>

		<guid isPermaLink="false">http://joel.neubeck.net/2008/05/silverlight-circular-collision-animation/</guid>
		<description><![CDATA[Building on the sample I created on Circular Motion, in this example I add a concept of collision.&#160; In physics, deflection is the event that occurs where an object collides and bounces off of another surface.&#160; In my example, two spheres collide at a given X/Y causing each ball to reverse direction and maintains its [...]]]></description>
			<content:encoded><![CDATA[<p>Building on the sample I created on <a href="/2008/05/silverlight-circular-motion-animation/">Circular Motion</a>, in this example I add a concept of collision.&nbsp; In physics, deflection is the event that occurs where an object collides and bounces off of another surface.&nbsp; In my example, two spheres collide at a given X/Y causing each ball to reverse direction and maintains its current speed and angle.</p>
<p><iframe src="/wp-content/uploads/2008/05/CircularCollision/default.html" width="300" height="300"></iframe></p>
<p>Just as in my previous example I use a single DispatcherTimer and a generic collection of UserConrols. To keep track of the direction that each ball is traveling I added a boolean property to my &#8220;Ball&#8221; user control to determine if it was rotating clockwise.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
</pre></td><td class="code"><pre class="c-sharp" style="font-family:monospace;">void _timer_Tick(object sender, EventArgs e)
{
    foreach (Ball ball in _balls)
    {
        double x = 0.0;
        double y = 0.0;
        double angle = ball.Rotate.Angle;
&nbsp;
        CalculatePosition(ball.Clockwise, ref x, ref y, ref angle, 1);
        //update the position of the ball
        ball.Rotate.Angle = angle;
        ball.Translate.X = x;
        ball.Translate.Y = y;
&nbsp;
        //check to see if a collision has occured
        if (ball.CollisionType == Ball.CollisionTypes.Deflect)
        {
            foreach (Ball ball2 in _balls)
            {
                if (!ball.Equals(ball2))
                {
                    double b2X = 0.0;
                    double b2Y = 0.0;
                    double b2A = ball2.Rotate.Angle;
                    //if we wait until the two balls are at the same X/Y then the balls
                    //will have overlapped.  Instead, predict by looking 5 degrees ahead 
                    //then switching direction.
                    CalculatePosition(ball2.Clockwise, ref b2X, ref b2Y, ref b2A, 5);
                    if (Math.Ceiling(x).Equals(Math.Ceiling(b2X))
                        &amp;amp;&amp;amp; Math.Ceiling(y).Equals(Math.Ceiling(b2Y)))
                    {
                        ball.Clockwise = !ball.Clockwise;
                        ball2.Clockwise = !ball2.Clockwise;
                        //ball.sound.Position = TimeSpan.FromMilliseconds(0);
                        //ball.sound.Play();
                        break;
                    }
                }
            }
        }
    }
}</pre></td></tr></table></div>

<p>As you can see in the code above, I am doing a quick check to see if my rotating ball is defined to deflect upon collision. In this example, this is the only type of collision supported. In the future, I might add things like exploding on impact or magnetism upon the collision. </p>
<p>The first step in the circular rotation is to move each ball to its new X/Y position. Once moved, I check to see if any other balls overlap its current X/Y location. To make the collision more realistic (no overlap), I predict where each additional ball will exist 5 degrees forward of its current angle. This allows me to simulate the ball just touching each other before reversing directions. </p>
<p>Code: <a onclick="javascript: pageTracker._trackPageview('/code/CircularCollision.zip');" href="/wp-content/uploads/2008/05/CircularCollision/CircularCollision.zip">CircularCollision.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://joel.neubeck.net/2008/05/silverlight-circular-collision-animation/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Silverlight Circular Motion Animation</title>
		<link>http://joel.neubeck.net/2008/05/silverlight-circular-motion-animation/</link>
		<comments>http://joel.neubeck.net/2008/05/silverlight-circular-motion-animation/#comments</comments>
		<pubDate>Tue, 13 May 2008 06:36:56 +0000</pubDate>
		<dc:creator>joel</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Microsoft.Net 2.0]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[animation]]></category>
		<category><![CDATA[Circular Rotation]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[DispatcherTimer]]></category>
		<category><![CDATA[Math.Cos]]></category>
		<category><![CDATA[RotateTransform]]></category>
		<category><![CDATA[TranslateTransform]]></category>

		<guid isPermaLink="false">http://joel.neubeck.net/2008/05/silverlight-circular-motion-animation/</guid>
		<description><![CDATA[In this sample I demonstrate how to take a series of UserControls (Simple ellipses) and rotate each in a counter-clockwise circular motion. The first step in the process is to define a user control and expose both the TranslateTransform and RotateTransform from the TransformGroup object.&#160; This allows us to rotate and move each user control [...]]]></description>
			<content:encoded><![CDATA[<p>In this sample I demonstrate how to take a series of UserControls (Simple ellipses) and rotate each in a counter-clockwise circular motion.
<p><iframe src="/wp-content/uploads/2008/05/CircularMotion/default.html" width="300" height="300"></iframe></p>
<p>The first step in the process is to define a user control and expose both the TranslateTransform and RotateTransform from the TransformGroup object.&nbsp; This allows us to rotate and move each user control on a specified tick (DispatcherTimer tick).&nbsp; The timer is controlled by the main page.xaml.</p>
<p>In this example, I start with a single &#8220;ball&#8221;, begin rotating it, and every second add an additional ball to the animation.&nbsp; Instead of having each user control have its own animation, I have chosen to use a single DispatcherTimer that iterates over a generic collection of UserControls, to generate the circular motion</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code"><pre class="c-sharp" style="font-family:monospace;">void Page_Loaded(object sender, RoutedEventArgs e)
{
    _centerX = this.Width/2;
    _centerY = this.Height / 2;
    _timerAnimation.Interval = TimeSpan.FromMilliseconds(20);
    _timerAnimation.Tick += new EventHandler(_timer_Tick);
&nbsp;
    _timerInserter.Interval = TimeSpan.FromSeconds(1);
    _timerInserter.Tick += new EventHandler(_timer2_Tick);
&nbsp;
    PlaceBall(&quot;Bo&quot;);
&nbsp;
    _timerAnimation.Start();
    _timerInserter.Start();
}</pre></td></tr></table></div>

<p>In this handler I determine the center of my circle, place the first control, and define two DispatcherTimers, one for the animation, and one for inserting additional controls into the main Grid. Since the speed of rotation is consistent for each &#8220;ball&#8221;, I am able to use a single timer which iterates over a generic collection of UserControls. Each time the Animation timer fires, I will call the following method.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="c-sharp" style="font-family:monospace;">void _timer_Tick(object sender, EventArgs e)
{
    foreach(KeyValuePair&lt;string ,BALL&gt; ball in _balls)
    {
        ball.Value.Rotate.Angle -= 5;
        ball.Value.Rotate.Angle %= 360;
        // Transform angle degrees to radian value
        double radians = ((ball.Value.Rotate.Angle / 180) * Math.PI);
        ball.Value.Translate.X = _centerX + Math.Cos(radians) * _radius;
        ball.Value.Translate.Y = _centerY + Math.Sin(radians) * _radius;
    }
}</pre></td></tr></table></div>

<p>The math in this method is pretty basic, on each tick I rotate the ball between 1 and 360 degrees. The angle I am looking for is the remainder of the angle of my rotation from 360 degrees.  To calculate this, I apply the modulus assignment operator to my new angle. To determine the appropriate X and Y position I transform my angle into Radians and apply a bit of trigonometry to calculate X/Y based on the sin and cosine of the radian. Thanks again to Paul Ortchanian flash site, <a href="http://tinyurl.com/6rhvrs" target="_blank">reflektions</a> for a Flash sample I could translate into Silverlight.</p>
<p>Code: <a onclick="javascript: pageTracker._trackPageview('/code/CircularMotion.zip');" href="/wp-content/uploads/2008/05/CircularMotion/CircularMotion.zip">CircularMotion.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://joel.neubeck.net/2008/05/silverlight-circular-motion-animation/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Silverlight how to: RSS feed stored as JSON in Isolated Storage</title>
		<link>http://joel.neubeck.net/2008/03/silverlight-how-to-rss-feed-stored-as-json-in-isolated-storage/</link>
		<comments>http://joel.neubeck.net/2008/03/silverlight-how-to-rss-feed-stored-as-json-in-isolated-storage/#comments</comments>
		<pubDate>Fri, 28 Mar 2008 22:07:51 +0000</pubDate>
		<dc:creator>joel</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[DataContractJsonSerializer]]></category>
		<category><![CDATA[DispatcherTimer]]></category>
		<category><![CDATA[IsolatedStorage]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[RSS]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://joel.neubeck.net/2008/03/silverlight-how-to-rss-feed-stored-as-json-in-isolated-storage/</guid>
		<description><![CDATA[This week I was reading two of my favorite Microsoft Evangelist blogs; Kirk Allen Evans&#8217; and Tim Heuer and was inspired to build upon two of their posts. Kirk wrote a great entry on Creating a JSON Service with WebGet and WCF 3.5 and Tim on Calling web services with Silverlight 2. I thought it [...]]]></description>
			<content:encoded><![CDATA[<p>This week I was reading two of my favorite Microsoft Evangelist blogs; <a href="http://blogs.msdn.com/kaevans">Kirk Allen Evans&#8217;</a> and <a href="http://timheuer.com">Tim Heuer</a> and was inspired to build upon two of their posts.  Kirk wrote a great entry on <a href="http://tinyurl.com/3cbld3">Creating a JSON Service with WebGet and WCF 3.5</a> and Tim on<br />
<a href="http://tinyurl.com/3bv5ch">Calling web services with Silverlight 2</a>.  I thought it would be interesting to take the concepts covered in both of these posts and put them together into my own how to.  In my sample I read an RSS feed into a JSON string, stores it in Isolated storage, and displays it in a ListBox.  Once displayed, I will check every 30 seconds to see if the RSS feed has changed.  Out-of-the-box my solution is not practical, but illustrates a flexible technique for caching a serialized collection of data in the event the service is unavailable. </p>
<p>In the first part of my sample I check to see if I have a cache of RSS in Isolated Storage.  If so, I use the &#8220;DataContractJsonSerializer&#8221; class to de-serialize the JSON array.  Once de-serialized, I can bind it to my ListBox control in &#8220;Page.xaml&#8221;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
</pre></td><td class="code"><pre class="c-sharp" style="font-family:monospace;">void Page_Loaded(object sender, RoutedEventArgs e)
{
    RssService.RssItem[] items;
    if (_isf.FileExists(&quot;blog.json&quot;))
    {
        //Read from IsolatedStorage the last set of blog entires
        using (IsolatedStorageFileStream isfs = 
         new IsolatedStorageFileStream(&quot;blog.json&quot;, System.IO.FileMode.Open, _isf))
        {
            //Deserialize the JSON array that was stored in Isolated storage.
            DataContractJsonSerializer djson = 
             new DataContractJsonSerializer(typeof(RssService.RssItem[]));
&nbsp;
            items = djson.ReadObject(isfs) as RssService.RssItem[];
&nbsp;
            isfs.Position = 0;
            using (StreamReader sr = new StreamReader(isfs))
            {
                this.txtBlock.Text = sr.ReadToEnd();
            }
            isfs.Close();
        }
        listBox.ItemsSource = items;
    }
&nbsp;
    . . . . . . 
}</pre></td></tr></table></div>

<p>After we update our presentation of RSS, I will insert a animating UserControl to be use when we go to retrieve additional RSS items.  This retrieval from our WCF 3.5 service will be executed every 10 seconds when our &#8220;DispatcherTimer&#8221; fires.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="c-sharp" style="font-family:monospace;">    //insert a UserControl that animates a spinner when we are retrieving 
    //an update of RSS data
    _indicator.HorizontalAlignment = HorizontalAlignment.Center;
    _indicator.VerticalAlignment = VerticalAlignment.Center;
    this.LayoutRoot.Children.Add(_indicator);
    _indicator.Visibility = Visibility.Collapsed;
&nbsp;
    //we will use a timer here to simulate a 5 second delay in grabbing 
    //the next rss update
    _dt.Interval = new TimeSpan(0, 0, 10);
    _dt.Tick += new EventHandler(_dt_Tick);
    _dt.Start();</pre></td></tr></table></div>

<p>Upon successful retrieval from our WCF service, we will update our isolated storage by serializing our array of RssItems[] into JSON, and writing that text to a file.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
</pre></td><td class="code"><pre class="c-sharp" style="font-family:monospace;">void wcf_GetFeedsCompleted(object sender, 
    IsolatedStorage.RssService.GetFeedsCompletedEventArgs e)
{
    try
    {
        RssService.RssItem[] items = e.Result as RssService.RssItem[];
        //if we were able to grab a new set of Rss items then update Isolated storage
        if (items.Length &gt; 0)
        {
            if (_isf.FileExists(&quot;blog.json&quot;))
            {
                _isf.DeleteFile(&quot;blog.json&quot;);
            }
            using (IsolatedStorageFileStream isfs = 
             new IsolatedStorageFileStream(&quot;blog.json&quot;, System.IO.FileMode.Create, _isf))
            {
                //Take the array of RssItem[] objects and convert it to a JSON array.
                DataContractJsonSerializer djson = new DataContractJsonSerializer(items.GetType());
                MemoryStream ms = new MemoryStream();
                djson.WriteObject(ms, items);
&nbsp;
                this.txtBlock.Text = System.Text.Encoding.UTF8.GetString
                   (ms.GetBuffer(), 0, Convert.ToInt16(ms.Length));
&nbsp;
                isfs.Write(ms.GetBuffer(), 0, Convert.ToInt16(ms.Length));
                isfs.Close();
            }
            listBox.ItemsSource = items;
        }
        this.listBox.Opacity = 1;
        _indicator.Animation.Stop();
        _indicator.Visibility = Visibility.Collapsed;
    }
    catch (Exception ex)
    {
        this.txtBlock.Text = ex.Message;
    }
}</pre></td></tr></table></div>

<p>Thanks again to Tim and Kirk for the majority of my example.</p>
<p>Code: <a href="/wp-content/uploads/2008/03/IsolatedStorage.zip" onClick="javascript: pageTracker._trackPageview('/code/IsolatedStorage.zip');">IsolatedStorage.zip</a></p>
]]></content:encoded>
			<wfw:commentRss>http://joel.neubeck.net/2008/03/silverlight-how-to-rss-feed-stored-as-json-in-isolated-storage/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
