<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>My Silverlight Blog : silverlight 2 beta 2</title><link>http://blogs.msdn.com/timrule/archive/tags/silverlight+2+beta+2/default.aspx</link><description>Tags: silverlight 2 beta 2</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>WebClient and LINQ Demo</title><link>http://blogs.msdn.com/timrule/archive/2008/06/29/webclient-and-linq-demo.aspx</link><pubDate>Mon, 30 Jun 2008 00:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8668585</guid><dc:creator>Tim Rule</dc:creator><slash:comments>1</slash:comments><comments>http://blogs.msdn.com/timrule/comments/8668585.aspx</comments><wfw:commentRss>http://blogs.msdn.com/timrule/commentrss.aspx?PostID=8668585</wfw:commentRss><description>&lt;P&gt;This sample illustrates a simple usage of the WebClient and a LINQ query. The WebClient makes requests to an RSS feed from Adobe's &lt;A href="http://labs.adobe.com/wiki/index.php/Kuler#kuler_APIs" mce_href="http://labs.adobe.com/wiki/index.php/Kuler#kuler_APIs"&gt;kuler API&lt;/A&gt; which contains color themes defined by kuler users. The themes are then used to colorize an illustration. Silverlight has a SyndicationFeed Class which is designed to work with feeds. This demo however, utilizes the WebClient to show how a xml request can be queried by LINQ.&lt;/P&gt;
&lt;P&gt;Select various color themes in the demo below to colorize the picture. &lt;/P&gt;
&lt;P&gt;&lt;IFRAME style="WIDTH: 500px; HEIGHT: 425px" src="http://silverlight.services.live.com/invoke/63894/WebClient%20LINQ%20Demo/iframe.html" frameBorder=0 scrolling=no mce_src="http://silverlight.services.live.com/invoke/63894/WebClient%20LINQ%20Demo/iframe.html"&gt;&lt;/IFRAME&gt;&lt;/P&gt;
&lt;P&gt;The WebClient makes a URI request to the RSS service. The result is handled by a DownloadStringCompleted handler.&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" border=0 alt=image src="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/WebClientandLINQDemo_CBDF/image_11.png" width=636 height=230 mce_src="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/WebClientandLINQDemo_CBDF/image_11.png"&gt; &lt;/P&gt;
&lt;P&gt;The LINQ builds and array of objects of an inferred type. There is also a swatches array object that is built from a LINQ sub query.&lt;A href="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/WebClientandLINQDemo_CBDF/image_2.png" mce_href="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/WebClientandLINQDemo_CBDF/image_2.png"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" border=0 alt=image src="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/WebClientandLINQDemo_CBDF/image_thumb.png" width=615 height=204 mce_src="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/WebClientandLINQDemo_CBDF/image_thumb.png"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I've added an AnimateColor method to the Animate class used in previous blog posts. The method builds a ColorAnimationUsingKeyFrames animation with with a start and finish SplineColorKeyFrame to support weighted animations.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" border=0 alt=image src="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/WebClientandLINQDemo_CBDF/image_5.png" width=555 height=40 mce_src="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/WebClientandLINQDemo_CBDF/image_5.png"&gt;&lt;/P&gt;
&lt;P&gt;To make this sample image I used Microsoft Expression Designer. First I drew a simple solid color illustration. I then made a compound path with the similar colored objects. Making the compound path puts the grouped shapes into one path. This means the entire image is defined as just 5 Path elements when exported to XAML. &lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" border=0 alt=ImageSteps src="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/WebClientandLINQDemo_CBDF/ImageSteps_3.png" width=492 height=155 mce_src="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/WebClientandLINQDemo_CBDF/ImageSteps_3.png"&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8668585" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/timrule/attachment/8668585.ashx" length="47576" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/timrule/archive/tags/effects/default.aspx">effects</category><category domain="http://blogs.msdn.com/timrule/archive/tags/silverlight/default.aspx">silverlight</category><category domain="http://blogs.msdn.com/timrule/archive/tags/silverlight+2+beta+2/default.aspx">silverlight 2 beta 2</category><category domain="http://blogs.msdn.com/timrule/archive/tags/WebClient/default.aspx">WebClient</category></item><item><title>Windowing Demo for Silverlight 2 Beta</title><link>http://blogs.msdn.com/timrule/archive/2008/05/22/windowing-demo-for-silverlight-2-beta.aspx</link><pubDate>Thu, 22 May 2008 21:50:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8533187</guid><dc:creator>Tim Rule</dc:creator><slash:comments>9</slash:comments><comments>http://blogs.msdn.com/timrule/comments/8533187.aspx</comments><wfw:commentRss>http://blogs.msdn.com/timrule/commentrss.aspx?PostID=8533187</wfw:commentRss><description>&lt;P&gt;Click on the &lt;STRONG&gt;"Toggle Full Screen"&lt;/STRONG&gt; to test this example. "Tile Windows" will layout thumbnails of the windows and clicking on a thumbnail will restore the windows.&lt;/P&gt;&lt;IFRAME style="WIDTH: 500px; HEIGHT: 200px" src="http://silverlight.services.live.com/invoke/63894/Windowing%20Demo/iframe.html" frameBorder=0 scrolling=no mce_src="http://silverlight.services.live.com/invoke/63894/Windowing%20Demo/iframe.html"&gt;&lt;/IFRAME&gt;
&lt;P&gt;For this demo a FloatingWindow class has been created which inherits from &lt;STRONG&gt;UserControl&lt;/STRONG&gt;. The class has a XAML page and codebehind file rather than the class file and a control template of FrameworkElement inherited controls. This method might be a useful for a multi document interface or XAML pages that are pulled in at runtime.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8533187" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/timrule/attachment/8533187.ashx" length="13884" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/timrule/archive/tags/effects/default.aspx">effects</category><category domain="http://blogs.msdn.com/timrule/archive/tags/silverlight/default.aspx">silverlight</category><category domain="http://blogs.msdn.com/timrule/archive/tags/animation/default.aspx">animation</category><category domain="http://blogs.msdn.com/timrule/archive/tags/silverlight+2+beta+2/default.aspx">silverlight 2 beta 2</category></item><item><title>Scale 9 Image for Silverlight</title><link>http://blogs.msdn.com/timrule/archive/2008/05/12/scale-9-image-for-silverlight.aspx</link><pubDate>Tue, 13 May 2008 03:15:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8497747</guid><dc:creator>Tim Rule</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/timrule/comments/8497747.aspx</comments><wfw:commentRss>http://blogs.msdn.com/timrule/commentrss.aspx?PostID=8497747</wfw:commentRss><description>&lt;P&gt;&amp;nbsp; A scale 9 image divides an image into 9 regions which each scale differently when an image is scaled. Click on the "Toggle Full Screen" to try the example. Drag the white square with a red border to resize the shape.&lt;/P&gt;&lt;IFRAME style="WIDTH: 500px; HEIGHT: 300px" src="http://silverlight.services.live.com/invoke/63894/Scale%209%20Demo/iframe.html" frameBorder=0 scrolling=no mce_src="http://silverlight.services.live.com/invoke/63894/Scale%209%20Demo/iframe.html"&gt;&lt;/IFRAME&gt;
&lt;P&gt;Take the following bitmap for example:&lt;/P&gt;
&lt;P&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" border=0 alt=Scale9Box src="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/Scale9ImageforSilverlight_F23E/Scale9Box_3.png" width=200 height=100 mce_src="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/Scale9ImageforSilverlight_F23E/Scale9Box_3.png"&gt;&lt;/P&gt;
&lt;P&gt;By defining a center Rectangle there is enough information for a smarter scaling of the image. In the case of scale 9 the corners will not scale when the image is resized. The edges will scale parallel to their orientation. The center will scale in both direction.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" border=0 alt=Scale9BoxLines src="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/Scale9ImageforSilverlight_F23E/Scale9BoxLines_3.png" width=200 height=100 mce_src="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/Scale9ImageforSilverlight_F23E/Scale9BoxLines_3.png"&gt;&lt;/P&gt;
&lt;P&gt;This type of image construct can be useful for creating rich bitmap graphics for the backgrounds of sizable containers. &lt;/P&gt;
&lt;P&gt;Here is a sample usage of the control. The ImageSize is the "Width,Height" of the source image and the CenterRect defines the grow region of the control.&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" border=0 alt=image src="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/Scale9ImageforSilverlight_F23E/image_6.png" width=447 height=38 mce_src="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/Scale9ImageforSilverlight_F23E/image_6.png"&gt;&lt;/P&gt;
&lt;P&gt;The control is composed of a Grid with a Canvas in each cell of the Grid. Each Canvas contains an Image which has a Clip property as well as a TranslateTransform and a ScaleTransform. All these values are adjusted programmatically when a resize occurs to the control.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" border=0 alt=image src="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/Scale9ImageforSilverlight_F23E/image_3.png" width=514 height=219 mce_src="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/Scale9ImageforSilverlight_F23E/image_3.png"&gt;&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8497747" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/timrule/attachment/8497747.ashx" length="80771" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/timrule/archive/tags/effects/default.aspx">effects</category><category domain="http://blogs.msdn.com/timrule/archive/tags/silverlight/default.aspx">silverlight</category><category domain="http://blogs.msdn.com/timrule/archive/tags/scale+9/default.aspx">scale 9</category><category domain="http://blogs.msdn.com/timrule/archive/tags/bitmap/default.aspx">bitmap</category><category domain="http://blogs.msdn.com/timrule/archive/tags/silverlight+2+beta+2/default.aspx">silverlight 2 beta 2</category></item><item><title>Spline Based Animation Helper</title><link>http://blogs.msdn.com/timrule/archive/2008/05/02/spline-based-animation-helper.aspx</link><pubDate>Sat, 03 May 2008 05:04:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8452998</guid><dc:creator>Tim Rule</dc:creator><slash:comments>6</slash:comments><comments>http://blogs.msdn.com/timrule/comments/8452998.aspx</comments><wfw:commentRss>http://blogs.msdn.com/timrule/commentrss.aspx?PostID=8452998</wfw:commentRss><description>&lt;P&gt;This code sample demonstrates an animation helper class to wrap up the code needed to animate a FrameworkElement's properties. This will work if the property is a double as well all of the object's transform properties. User defined dependency properties do not appear to be animatable in this beta 1 release via the Animation class. &lt;/P&gt;
&lt;P&gt;&lt;IFRAME style="WIDTH: 500px; HEIGHT: 250px" src="http://silverlight.services.live.com/invoke/63894/Animation%20Demo/iframe.html" frameBorder=0 scrolling=no mce_src="http://silverlight.services.live.com/invoke/63894/Animation%20Demo/iframe.html"&gt;&lt;/IFRAME&gt;&lt;/P&gt;
&lt;P&gt;Below is the sample usage of the animation helper methods for a double animation and a transform animation. The implementation of the AnimateTransform method is more complex than AnimateDouble because in order to&amp;nbsp; animate a transform value a default transform needs to present which requires more pre-animation work. &lt;/P&gt;
&lt;P&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" border=0 alt=animate src="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/SplineBasedAnimationHelper_8A3A/animate_1.png" width=578 height=53 mce_src="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/SplineBasedAnimationHelper_8A3A/animate_1.png"&gt; &lt;/P&gt;
&lt;P&gt;One overload of the methods has a parameter for an animation complete EventHandler. This is useful for simple sequencing of animations.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" border=0 alt=image src="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/SplineBasedAnimationHelper_8A3A/image_5.png" width=568 height=55 mce_src="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/SplineBasedAnimationHelper_8A3A/image_5.png"&gt; &lt;/P&gt;
&lt;P&gt;I'm calling this spline based because the easing is adjusted by changing the animation spline control points. An alternative would be to use key frame animation which passes the start value, end value, and current time into an easing function at every keyframe. CodePlex has a good example of such approach for Silverlight.&lt;/P&gt;
&lt;P&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" border=0 alt=spline[5] src="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/SplineBasedAnimationHelper_8A3A/spline%5B5%5D_1.png" width=597 height=284 mce_src="http://blogs.msdn.com/blogfiles/timrule/WindowsLiveWriter/SplineBasedAnimationHelper_8A3A/spline%5B5%5D_1.png"&gt;&lt;/P&gt;
&lt;P&gt;These methods get things moving around the screen but would need a lot more functionality to be useful in an application.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8452998" width="1" height="1"&gt;</description><enclosure url="http://blogs.msdn.com/timrule/attachment/8452998.ashx" length="11181" type="application/x-zip-compressed" /><category domain="http://blogs.msdn.com/timrule/archive/tags/effects/default.aspx">effects</category><category domain="http://blogs.msdn.com/timrule/archive/tags/silverlight/default.aspx">silverlight</category><category domain="http://blogs.msdn.com/timrule/archive/tags/animation/default.aspx">animation</category><category domain="http://blogs.msdn.com/timrule/archive/tags/silverlight+2+beta+2/default.aspx">silverlight 2 beta 2</category></item></channel></rss>