<?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>Bayprince&#039;s Blog</title>
	<atom:link href="http://blog.bayprince.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bayprince.com</link>
	<description>A Silverlight Fanboy Blog</description>
	<lastBuildDate>Mon, 12 Jul 2010 20:39:51 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Cynergy Systems</title>
		<link>http://blog.bayprince.com/2010/07/cynergy-systems/</link>
		<comments>http://blog.bayprince.com/2010/07/cynergy-systems/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 18:21:29 +0000</pubDate>
		<dc:creator>bayprince</dc:creator>
				<category><![CDATA[cynergy systems]]></category>

		<guid isPermaLink="false">http://blog.bayprince.com/?p=59</guid>
		<description><![CDATA[I started my new job at Cynergy Systems as a Software Consultant. I will be working on a variety of projects using Silverlight, WPF, Surface, and Flex.  The company has made some real cool stuff, including their recent Ebay Simple Lister Silverlight application, which was presented at MIX 10.  For more information on the company, check out [...]]]></description>
			<content:encoded><![CDATA[<p>I started my new job at Cynergy Systems as a Software Consultant. I will be working on a variety of projects using Silverlight, WPF, Surface, and Flex.  The company has made some real cool stuff, including their recent Ebay Simple Lister Silverlight application, which was presented at MIX 10.  For more information on the company, check out their website at <a href="http://www.cynergysystems.com">http://www.cynergysystems.com</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bayprince.com/2010/07/cynergy-systems/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MCTS &#8211; .NET 4 Windows Application Development</title>
		<link>http://blog.bayprince.com/2010/06/mcts-net-4-windows-application-development/</link>
		<comments>http://blog.bayprince.com/2010/06/mcts-net-4-windows-application-development/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 06:18:59 +0000</pubDate>
		<dc:creator>bayprince</dc:creator>
				<category><![CDATA[Certification]]></category>
		<category><![CDATA[mcts]]></category>
		<category><![CDATA[microsoft certified technology specialist]]></category>

		<guid isPermaLink="false">http://blog.bayprince.com/?p=57</guid>
		<description><![CDATA[I passed the MCTS 70-511 (Windows Applications Development with Microsoft .NET Framework 4) exam.  I took the beta exam couple months ago and just got the results.  The official exam will be available on July 2nd.]]></description>
			<content:encoded><![CDATA[<p>I passed the MCTS 70-511 (Windows Applications Development with Microsoft .NET Framework 4) exam.  I took the beta exam couple months ago and just got the results.  The official exam will be available on July 2nd.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bayprince.com/2010/06/mcts-net-4-windows-application-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Multi-touch in Silverlight 3: Part 1</title>
		<link>http://blog.bayprince.com/2010/01/multi-touch-in-silverlight-3-2/</link>
		<comments>http://blog.bayprince.com/2010/01/multi-touch-in-silverlight-3-2/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 19:36:25 +0000</pubDate>
		<dc:creator>bayprince</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[gestures]]></category>
		<category><![CDATA[multi-touch]]></category>
		<category><![CDATA[silverlight 3]]></category>

		<guid isPermaLink="false">http://blog.bayprince.com/2010/01/multi-touch-in-silverlight-3-2/</guid>
		<description><![CDATA[&#160; 1. Introduction 1.1 Introduction One of the cool features in Silverlight 3 is the Multi-touch capabilities.&#160;&#160; This feature allows Silverlight developers to create fun and interactive applications that can be used with standard inputs, such as mouse and keyboard, as well as with touch-enabled devices.&#160; If you have seen Minority Report, you are already [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>
<h2>1. Introduction</h2>
<h3>1.1 Introduction</h3>
<p>One of the cool features in Silverlight 3 is the Multi-touch capabilities.&#160;&#160; This feature allows Silverlight developers to create fun and interactive applications that can be used with standard inputs, such as mouse and keyboard, as well as with touch-enabled devices.&#160; </p>
<p>If you have seen <u>Minority Report</u>, you are already aware of the gesture-based technology.&#160; The user can interact with the device to drag objects around, flick to navigate, and pinch to adjust the size of an object.&#160; These concepts have become a standard feature on a variety of devices, including Microsoft Surface, Windows 7, and mobile phones.</p>
<p>Silverlight 3 provides the&#160; fundamentals of receiving touch events from the hardware to the application.&#160; By default, the touch events are fired from Windows 7 to the browser (IE / Firefox).&#160; If the application is not processing the touch events, these events are registered as standard mouse events.</p>
<p>Here are two sample applications that utilize Multi-touch concepts.&#160; You will need a touch-enabled device and Windows 7 to get the full experience.</p>
<p><a href="http://www.silverlighttoys.com/Samples/SL2/SlideView/" target="_blank"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="SlideView" border="0" alt="SlideView" src="http://blog.bayprince.com/wp-content/uploads/2010/01/SlideView.jpg" width="244" height="184" /></a> </p>
<p align="center"><a href="http://www.silverlighttoys.com/" target="_blank">3D SlideView</a> | <a href="http://www.silverlighttoys.com/Samples/SL2/SlideView/" target="_blank">SlideView</a></p>
<p>In this two-part blog series, I’ll show you the process that I went through in developing a Silverlight class library with Multi-touch gestures and events.&#160; This process was used in SharePoint Silverview to add Silverlight / Windows 7 touch functionality in a SharePoint environment.&#160; You can find the complete source code at <a title="http://code.msdn.microsoft.com/ssv" href="http://code.msdn.microsoft.com/ssv">http://code.msdn.microsoft.com/ssv</a>.</p>
<h3>1.2 Online Research</h3>
<p>Jesse Bishop, Program Manager on the Microsoft Silverlight team, wrote an amazing article about <a href="http://www.jebishop.com/2009/11/05/multi-touch-gesture-recognition-in-silverlight-3/">Multi-touch Gesture recognition in Silverlight 3</a>.&#160; The article illustrates on how to register touch events and process standard gestures on individual elements.&#160; The primary concept is to have a single entity that reads the incoming events and determine which element that is being accessed.&#160; After reading Jesse’s article, I got inspired to extend his concept with a variety of gestures and events that can be used in a standard Silverlight application.</p>
<h3>1.3 Hardware</h3>
<p>Before you can develop or run Silverlight application with Multi-touch, you need the right equipment.&#160; I have been developing on the Dell SX2210T and the HP TouchSmart IQ586.&#160; The HP TouchSmart TX2 is also a good choice.&#160; One interesting thing that I learned was the HP TouchSmart IQ586 only had support for a single touch point.&#160; There is an updated driver to ensure that the monitor utilizes two touch points.&#160; You can check for this by viewing the Pen and Touch information under System Information.&#160; It is ideal to have 2 Touch Points, if you plan to support two-finger gestures such as Scale and Rotate. With the recent release of Windows 7, there may be drivers for existing hardware that will need to be updated.&#160; </p>
<h3>1.4 Touch 101</h3>
<p>The Touch framework has two primary concept: the TouchPoint object and the FrameReported event.</p>
<p>The TouchPoint object stores data related to a single touch point.&#160; This data is passed from the hardware as the user interacts with the touch device.&#160; The number of touch points vary on the supported hardware.&#160;&#160; The first touch point that is fired to the application is called the primary touch point.&#160; The object has two important properties: Position and Action.&#160; The Action property stores the current action state, such as Up, Down, and Move.&#160; The Up and Down actions are similar to the mouse’s MouseLeftButtonUp and MouseLeftButonDown events.&#160; The Move action is the transition action that is constantly called until the user releases the Touch Point, which also invokes the Up action.</p>
<p>The FrameReported event is an application-wide event that sends data from the hardware to the application.&#160; One thing to note is that this event is global to the application rather than an individual element.&#160; The application doesn’t directly know the element that the event is processing.&#160; It is possible to retrieve this information using the VisualTreeHelper.GetPointsUnderCoordinates method.&#160; The TouchFrameEventArgs argument has methods of getting information about touch points.&#160; You can get the current touch points by calling the GetPrimaryTouchPoint and GetTouchPoint methods. </p>
<h4>2. Basic Implementation</h4>
</p>
<p><a href="http://www.silverlighttoys.com/Articles/SilverlightMultiTouch/Demo/" target="_blank">Demo</a> | <a href="http://www.silverlighttoys.com/Articles/SilverlightMultiTouch/TouchApp.zip" target="_blank">Source Code</a></p>
<h3>2.1 Creating the MultiTouch Class Library</h3>
<p>Now, let’s start by creating a class library.&#160; The library will be useful for&#160; rapidly developing touch applications.&#160; We will only need two objects for the library: TouchElement control and TouchProcessor (explained in Jesse’s article).</p>
<p>In Visual Studio 2008 (or Visual Studio 2010 Beta 2), create a new Silverlight Application.&#160; Right-click on the Solution in the Solution Explorer and select Add New Project.&#160; In the Project Dialog box, select Silverlight Class Library and name it TouchLibrary.&#160; Remove the default Class1.cs file.&#160; </p>
<h3>2.2 TouchElement</h3>
<p>We will define the TouchElement control as a content control to allow you to place any element, such as an image, movie clip, or UIElement, into the control.&#160;&#160; This is not a requirement for deploying Touch applications, but rather a personal choice for development.&#160; One useful scenario is having a couple of TouchElement controls with images to allow users to drag and scale images around the user interface.</p>
<p>Right-click on the TouchLibrary and select Add New Item.&#160; In the Add New Item Dialog box, select User Control and name it TouchElement.&#160; Replace the TouchElement.xaml content with the following:</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">&lt;</span><span style="color: #800000">ContentControl</span> <span style="color: #ff0000">x:Class</span><span style="color: #0000ff">=&quot;TouchLibrary.TouchElement&quot;</span>    <span style="color: #ff0000">xmlns</span><span style="color: #0000ff">=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span>    <span style="color: #ff0000">xmlns:x</span><span style="color: #0000ff">=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</span>    <span style="color: #ff0000">RenderTransformOrigin</span><span style="color: #0000ff">=&quot;0.5,0.5&quot;</span>               <span style="color: #0000ff">&gt;</span>    <span style="color: #0000ff">&lt;</span><span style="color: #800000">ContentControl.RenderTransform</span><span style="color: #0000ff">&gt;</span>        <span style="color: #0000ff">&lt;</span><span style="color: #800000">TransformGroup</span><span style="color: #0000ff">&gt;</span>            <span style="color: #0000ff">&lt;</span><span style="color: #800000">ScaleTransform</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">=&quot;scale&quot;</span> <span style="color: #0000ff">/&gt;</span>            <span style="color: #0000ff">&lt;</span><span style="color: #800000">TranslateTransform</span> <span style="color: #ff0000">x:Name</span><span style="color: #0000ff">=&quot;translate&quot;</span> <span style="color: #0000ff">/&gt;</span>        <span style="color: #0000ff">&lt;/</span><span style="color: #800000">TransformGroup</span><span style="color: #0000ff">&gt;</span>    <span style="color: #0000ff">&lt;/</span><span style="color: #800000">ContentControl.RenderTransform</span><span style="color: #0000ff">&gt;</span>    <span style="color: #0000ff">&lt;</span><span style="color: #800000">ContentControl.Template</span><span style="color: #0000ff">&gt;</span>        <span style="color: #0000ff">&lt;</span><span style="color: #800000">ControlTemplate</span><span style="color: #0000ff">&gt;</span>            <span style="color: #0000ff">&lt;</span><span style="color: #800000">ContentPresenter</span> <span style="color: #ff0000">Margin</span><span style="color: #0000ff">=&quot;0&quot;</span> <span style="color: #ff0000">Content</span><span style="color: #0000ff">=&quot;{TemplateBinding Content}&quot;</span> <span style="color: #ff0000">ContentTemplate</span><span style="color: #0000ff">=&quot;{TemplateBinding ContentTemplate}&quot;</span><span style="color: #0000ff">&gt;</span>            <span style="color: #0000ff">&lt;/</span><span style="color: #800000">ContentPresenter</span><span style="color: #0000ff">&gt;</span>        <span style="color: #0000ff">&lt;/</span><span style="color: #800000">ControlTemplate</span><span style="color: #0000ff">&gt;</span>    <span style="color: #0000ff">&lt;/</span><span style="color: #800000">ContentControl.Template</span><span style="color: #0000ff">&gt;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">ContentControl</span><span style="color: #0000ff">&gt;</span></pre>
<p></div>
<p>Note that this is a Content Control rather than a UserControl.&#160; We have added TranslateTransform and ScaleTransform transforms to render the control’s transformation based on the touch events.</p>
<p>Now it’s time for some code action.&#160; In Jesse Bishop’s article, he implements the concept using ITouchElement as an interface that describes the supported gestures and ManipulateElement as a UserControl that implements the ITouchElement interface.&#160; I decided to merge the code from his elements into the TouchElement content control.&#160;&#160; I highly recommend checking out his article if you want to learn the details of the concept.</p>
<p>We will implement the Translate and Scale gestures.&#160; The Translate gesture occurs when the user drags the element from one position to another.&#160; The Scale gesture occurs when the user pinch and scales using two touch points.&#160; There may be scenarios when the developer wants to create their own custom translate and scale events.&#160; For this reason, we will add support for default transforms as well as add custom events that will send information back to the application.</p>
<p>The TransformEventArgs class stores basic data for both Translate and Scale events.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> TransformEventArgs : EventArgs{    <span style="color: #0000ff">public</span> TouchElement.TransformType Type { get; set; }    <span style="color: #0000ff">public</span> Point Translate { get; set; }    <span style="color: #0000ff">public</span> <span style="color: #0000ff">double</span> Scale { get; set; }

    <span style="color: #0000ff">public</span> TransformEventArgs(TouchElement.TransformType type, Point translate)    {        Type = type;        Translate = translate;        Scale = 1;    }

    <span style="color: #0000ff">public</span> TransformEventArgs(TouchElement.TransformType type, <span style="color: #0000ff">double</span> scale)    {        Type = type;        Scale = scale;        Translate = <span style="color: #0000ff">new</span> Point(0, 0);    }}</pre>
<p></div>
<p>The TransformHandler delegate is used for both events, with the TransformEventArgs object as the second parameter. </p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">public</span> <span style="color: #0000ff">delegate</span> <span style="color: #0000ff">void</span> TransformHandler(<span style="color: #0000ff">object</span> sender, TransformEventArgs e);<span style="color: #0000ff">public</span> <span style="color: #0000ff">event</span> TransformHandler ScaleChanged;<span style="color: #0000ff">public</span> <span style="color: #0000ff">event</span> TransformHandler TranslateChanged;</pre>
<p></div>
<p>We will add three properties to the TouchElement class.&#160; The TouchEnabled property will be used in the TouchProcessor class to check which TouchElement objects need to be processed.&#160; The TouchDrag and TouchScale boolean properties enable the default touch behaviors for drag (translate) and scale events.&#160; By default, the properties are set to false to allow the user to create their own events.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">public</span> <span style="color: #0000ff">bool</span> TouchEnabled{    get { <span style="color: #0000ff">return</span> (<span style="color: #0000ff">bool</span>)GetValue(TouchEnabledProperty); }    set { SetValue(TouchEnabledProperty, <span style="color: #0000ff">value</span>); }}

<span style="color: #0000ff">public</span> <span style="color: #0000ff">bool</span> TouchDrag{    get { <span style="color: #0000ff">return</span> (<span style="color: #0000ff">bool</span>)GetValue(TouchDragProperty); }    set    {        SetValue(TouchDragProperty, <span style="color: #0000ff">value</span>);

        <span style="color: #0000ff">if</span> (<span style="color: #0000ff">value</span>)            <span style="color: #0000ff">this</span>.TranslateChanged += <span style="color: #0000ff">new</span> TransformHandler(TouchElement_TranslateChanged);        <span style="color: #0000ff">else</span>            <span style="color: #0000ff">this</span>.TranslateChanged -= <span style="color: #0000ff">new</span> TransformHandler(TouchElement_TranslateChanged);    }}

<span style="color: #0000ff">public</span> <span style="color: #0000ff">bool</span> TouchScale{    get { <span style="color: #0000ff">return</span> (<span style="color: #0000ff">bool</span>)GetValue(TouchScaleProperty); }    set    {        SetValue(TouchScaleProperty, <span style="color: #0000ff">value</span>);

        <span style="color: #0000ff">if</span> (<span style="color: #0000ff">value</span>)            <span style="color: #0000ff">this</span>.ScaleChanged += <span style="color: #0000ff">new</span> TransformHandler(TouchElement_ScaleChanged);        <span style="color: #0000ff">else</span>            <span style="color: #0000ff">this</span>.ScaleChanged -= <span style="color: #0000ff">new</span> TransformHandler(TouchElement_ScaleChanged);    }}

<span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">readonly</span> DependencyProperty TouchEnabledProperty =    DependencyProperty.Register(<span style="color: #006080">&quot;TouchEnabled&quot;</span>, <span style="color: #0000ff">typeof</span>(<span style="color: #0000ff">bool</span>), <span style="color: #0000ff">typeof</span>(TouchElement), <span style="color: #0000ff">new</span> PropertyMetadata(<span style="color: #0000ff">true</span>));

<span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">readonly</span> DependencyProperty TouchDragProperty =    DependencyProperty.Register(<span style="color: #006080">&quot;TouchDrag&quot;</span>, <span style="color: #0000ff">typeof</span>(<span style="color: #0000ff">bool</span>), <span style="color: #0000ff">typeof</span>(TouchElement), <span style="color: #0000ff">new</span> PropertyMetadata(<span style="color: #0000ff">false</span>));

<span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">readonly</span> DependencyProperty TouchScaleProperty =    DependencyProperty.Register(<span style="color: #006080">&quot;TouchScale&quot;</span>, <span style="color: #0000ff">typeof</span>(<span style="color: #0000ff">bool</span>), <span style="color: #0000ff">typeof</span>(TouchElement), <span style="color: #0000ff">new</span> PropertyMetadata(<span style="color: #0000ff">false</span>));</pre>
<p></div>
<p>The TouchDrag and TouchScale properties connect the default event handlers, which validates the input value and directly updates TouchElement’s transform values.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">void</span> TouchElement_ScaleChanged(<span style="color: #0000ff">object</span> sender, TransformEventArgs e){    <span style="color: #0000ff">double</span> scale = e.Scale;

    <span style="color: #0000ff">double</span> s = <span style="color: #0000ff">this</span>.scale.ScaleX + scale;    <span style="color: #0000ff">double</span> MIN_SCALE = 0.25;    <span style="color: #0000ff">double</span> MAX_SCALE = 5.0;

    <span style="color: #0000ff">if</span> (s &gt; MIN_SCALE &amp;&amp; s &lt; MAX_SCALE)    {        <span style="color: #0000ff">this</span>.scale.ScaleX += scale;        <span style="color: #0000ff">this</span>.scale.ScaleY += scale;    }    <span style="color: #0000ff">else</span> <span style="color: #0000ff">if</span> (s &lt; MIN_SCALE)    {        <span style="color: #0000ff">this</span>.scale.ScaleX = MIN_SCALE;        <span style="color: #0000ff">this</span>.scale.ScaleY = MIN_SCALE;    }    <span style="color: #0000ff">else</span> <span style="color: #0000ff">if</span> (s &gt; MAX_SCALE)    {        <span style="color: #0000ff">this</span>.scale.ScaleX = MAX_SCALE;        <span style="color: #0000ff">this</span>.scale.ScaleY = MAX_SCALE;    }}

<span style="color: #0000ff">void</span> TouchElement_TranslateChanged(<span style="color: #0000ff">object</span> sender, TransformEventArgs e){    <span style="color: #0000ff">this</span>.translate.X += e.Translate.X;    <span style="color: #0000ff">this</span>.translate.Y += e.Translate.Y;}</pre>
<p></div>
<p>The TranslateElement and ScaleElement methods calculate the appropriate transforms from the positions based on the touch events.&#160; After the value is calculated, the event is fired with the TransformEventArgs as a parameter.&#160; This will process the default transformation as well as any custom work that is connected to the event.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> TranslateElement(Point oldPosition, Point newPosition){    <span style="color: #0000ff">double</span> xDelta = newPosition.X - oldPosition.X;    <span style="color: #0000ff">double</span> yDelta = newPosition.Y - oldPosition.Y;

    <span style="color: #0000ff">if</span> (yDelta != 0 || xDelta != 0)        RaiseTranslate(<span style="color: #0000ff">new</span> TransformEventArgs(TransformType.TRANSLATE, <span style="color: #0000ff">new</span> Point(xDelta, yDelta)));}

<span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> ScaleElement(Point primaryPosition, Point oldPosition, Point newPosition){    <span style="color: #0000ff">double</span> prevLength = GetDistance(primaryPosition, oldPosition);    <span style="color: #0000ff">double</span> newLength = GetDistance(primaryPosition, newPosition);

    <span style="color: #0000ff">if</span> (prevLength == <span style="color: #0000ff">double</span>.NaN || newLength == <span style="color: #0000ff">double</span>.NaN)        <span style="color: #0000ff">return</span>;

    <span style="color: #0000ff">double</span> scale = (newLength - prevLength) / newLength;

    <span style="color: #0000ff">if</span> (scale != 0)        RaiseScale(<span style="color: #0000ff">new</span> TransformEventArgs(TransformType.SCALE, scale));}</pre>
<p></div>
<p>The TouchProcessor class calls the TouchPointReported method to process the touch event based on the TouchPoint’s Action property.&#160; On the Down action, we collect information on the TouchPoint.&#160; If it is the initial touch point, then the position is later used for distance calculation.&#160; In the next blog post, I will go into additional functionality that can be added in the TouchDown method, such as a start time for timing touch event for other gestures.&#160; On the Touch Up action, we free up the current point.&#160; The TouchUp method can also be used to process any gestures, which will be detailed in the next blog post.&#160; The Touch Move is where the fun’s at.&#160; After the Down action occurs, the Move action constantly runs until the Up action is called.&#160; If there is only a single touch point, the TranslateElement method is called.&#160; The ScaleElement method is called if there are multiple points.&#160; In Jesse’s article, he also has Rotate functionality, which is processed with multiple points.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> TouchPointReported(TouchPoint touchPoint){    <span style="color: #0000ff">switch</span> (touchPoint.Action)    {        <span style="color: #0000ff">case</span> TouchAction.Down:            TouchDown(touchPoint.TouchDevice.Id, touchPoint);            <span style="color: #0000ff">break</span>;        <span style="color: #0000ff">case</span> TouchAction.Move:            TouchMove(touchPoint.TouchDevice.Id, touchPoint);            <span style="color: #0000ff">break</span>;        <span style="color: #0000ff">case</span> TouchAction.Up:            TouchUp(touchPoint.TouchDevice.Id, touchPoint);            <span style="color: #0000ff">break</span>;    };}

<span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> TouchDown(<span style="color: #0000ff">int</span> id, TouchPoint touchPoint){    _points.Add(id, touchPoint.Position);

    <span style="color: #0000ff">if</span> (_points.Count == 1)    {        _startPoint = touchPoint.Position;        _primaryId = id;    }}

<span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> TouchMove(<span style="color: #0000ff">int</span> id, TouchPoint touchPoint){    Point oldPoint = _points[id];    Point newPoint = touchPoint.Position;

    <span style="color: #0000ff">if</span> ((_points.Count == 1 || id == _primaryId))        TranslateElement(oldPoint, newPoint);    <span style="color: #0000ff">else</span>        ScaleElement(_points[_primaryId], oldPoint, newPoint);

    _points[id] = newPoint;}

<span style="color: #0000ff">private</span> <span style="color: #0000ff">void</span> TouchUp(<span style="color: #0000ff">int</span> id, TouchPoint touchPoint){    Point oldPoint = _points[id];    Point newPoint = touchPoint.Position;    _points.Remove(id);}</pre>
<p></div>
<h3>2.3 TouchProcessor</h3>
<p>The TouchProcessor class manages the global touch functionality by connecting the Touch’s FrameReported event.&#160; Jesse goes into detail about the TouchProcessor class in his <a href="http://www.jebishop.com/2009/11/05/multi-touch-gesture-recognition-in-silverlight-3/" target="_blank">article</a>.&#160; Add the following class to the Class Library.&#160; The primary difference in this version is the RootElement property, which is used to connect to the current application’s visual root.&#160; This property is required for the VisualTreeHelper.FindElementsInHostCoordinates method.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> TouchProcessor{    <span style="color: #cc6633">#region</span> Data Members    <span style="color: #0000ff">private</span> <span style="color: #0000ff">static</span> Dictionary&lt;<span style="color: #0000ff">int</span>,TouchElement&gt; touchControllers = <span style="color: #0000ff">new</span> Dictionary&lt;<span style="color: #0000ff">int</span>, TouchElement&gt;();    <span style="color: #0000ff">private</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">bool</span> _istouchEnabled = <span style="color: #0000ff">false</span>;    <span style="color: #cc6633">#endregion</span>

    <span style="color: #cc6633">#region</span> Properties    <span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> UIElement RootElement    {        get;        set;    }

    <span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">bool</span> IsTouchEnabled    {        get { <span style="color: #0000ff">return</span> _istouchEnabled; }

        set        {            <span style="color: #0000ff">if</span> (<span style="color: #0000ff">value</span> &amp;&amp; !_istouchEnabled)                Touch.FrameReported += <span style="color: #0000ff">new</span> TouchFrameEventHandler(Touch_FrameReported);            <span style="color: #0000ff">else</span> <span style="color: #0000ff">if</span> (!<span style="color: #0000ff">value</span> &amp;&amp; _istouchEnabled)            {                Touch.FrameReported -= <span style="color: #0000ff">new</span> TouchFrameEventHandler(Touch_FrameReported);                touchControllers.Clear();            }

            _istouchEnabled = <span style="color: #0000ff">value</span>;        }    }    <span style="color: #cc6633">#endregion</span>

    <span style="color: #cc6633">#region</span> Constructor    <span style="color: #0000ff">public</span> TouchProcessor()    { }    <span style="color: #cc6633">#endregion</span>

    <span style="color: #cc6633">#region</span> Events    <span style="color: #0000ff">private</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">void</span> Touch_FrameReported(<span style="color: #0000ff">object</span> sender, TouchFrameEventArgs e)    {        TouchPointCollection touchPoints = e.GetTouchPoints(<span style="color: #0000ff">null</span>);

        <span style="color: #0000ff">foreach</span> (TouchPoint touchPoint <span style="color: #0000ff">in</span> touchPoints)        {            <span style="color: #0000ff">int</span> touchDeviceId = touchPoint.TouchDevice.Id;

            <span style="color: #0000ff">switch</span> (touchPoint.Action)            {                <span style="color: #0000ff">case</span> TouchAction.Down:                    TouchElement hitElement = GetTouchElement(touchPoint.Position);

                    <span style="color: #0000ff">if</span> (hitElement != <span style="color: #0000ff">null</span>)                    {                        <span style="color: #0000ff">if</span> (!touchControllers.ContainsKey(touchDeviceId))                            touchControllers.Add(touchDeviceId, hitElement);

                        <span style="color: #008000">// Prevent touch events from being promoted to mouse events (only if it is over a TouchElement)</span>                        TouchPoint primaryTouchPoint = e.GetPrimaryTouchPoint(<span style="color: #0000ff">null</span>);                        <span style="color: #0000ff">if</span> (primaryTouchPoint != <span style="color: #0000ff">null</span> &amp;&amp; primaryTouchPoint.Action == TouchAction.Down)                            e.SuspendMousePromotionUntilTouchUp();

                        ProcessTouch(touchPoint);                    }

                    <span style="color: #0000ff">break</span>;                <span style="color: #0000ff">case</span> TouchAction.Move:                    ProcessTouch(touchPoint);                    <span style="color: #0000ff">break</span>;                <span style="color: #0000ff">case</span> TouchAction.Up:                    ProcessTouch(touchPoint);

                    touchControllers.Remove(touchDeviceId);                    <span style="color: #0000ff">break</span>;            };        }    }    <span style="color: #cc6633">#endregion</span>

    <span style="color: #cc6633">#region</span> Touch Process Events    <span style="color: #0000ff">private</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">void</span> ProcessTouch(TouchPoint touchPoint)    {        TouchElement controller;        touchControllers.TryGetValue(touchPoint.TouchDevice.Id, <span style="color: #0000ff">out</span> controller);

        <span style="color: #0000ff">if</span> (controller != <span style="color: #0000ff">null</span>)            controller.TouchPointReported(touchPoint);    }

    <span style="color: #0000ff">private</span> <span style="color: #0000ff">static</span> TouchElement GetTouchElement(Point position)    {        <span style="color: #0000ff">foreach</span> (UIElement element <span style="color: #0000ff">in</span> VisualTreeHelper.FindElementsInHostCoordinates(position, RootElement))        {            <span style="color: #0000ff">if</span> (element <span style="color: #0000ff">is</span> TouchElement)                <span style="color: #0000ff">return</span> (TouchElement)element;

            <span style="color: #008000">// immediately-hit element wasn't an TouchElement, so walk up the parent tree</span>            <span style="color: #0000ff">for</span> (UIElement parent = VisualTreeHelper.GetParent(element) <span style="color: #0000ff">as</span> UIElement; parent != <span style="color: #0000ff">null</span>; parent = VisualTreeHelper.GetParent(parent) <span style="color: #0000ff">as</span> UIElement)            {                <span style="color: #0000ff">if</span> (parent <span style="color: #0000ff">is</span> TouchElement)                    <span style="color: #0000ff">return</span> (TouchElement)parent;            }        }

        <span style="color: #008000">// no TouchElement found</span>        <span style="color: #0000ff">return</span> <span style="color: #0000ff">null</span>;    }    <span style="color: #cc6633">#endregion</span>}</pre>
<p></div>
<h2>3. Test the TouchLibrary</h2>
<p>In the Silverlight Project, add TouchLibrary to the project’s References.&#160; This will allow you to add the custom touch functionality to your project.&#160; </p>
<p>In MainPage.xaml, add the following namespace to connect to the new library.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">xmlns:touch=&quot;clr-namespace:TouchLibrary;assembly=TouchLibrary&quot;             </pre>
<p></div>
<p>Add the following to MainPage.xaml to create three TouchElements (two with color rectangles and one with an image).&#160; The image source has the project name pre-pended to ensure that it loads the image from the correct project.&#160; The TouchDrag and TouchScale properties are enabled to allow you to manipulate the items.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">&lt;</span><span style="color: #800000">Grid</span> <span style="color: #ff0000">Background</span><span style="color: #0000ff">=&quot;Black&quot;</span><span style="color: #0000ff">&gt;</span>    <span style="color: #0000ff">&lt;</span><span style="color: #800000">touch:TouchElement</span> <span style="color: #ff0000">TouchDrag</span><span style="color: #0000ff">=&quot;True&quot;</span> <span style="color: #ff0000">TouchScale</span><span style="color: #0000ff">=&quot;True&quot;</span> <span style="color: #ff0000">HorizontalAlignment</span><span style="color: #0000ff">=&quot;Left&quot;</span><span style="color: #0000ff">&gt;</span>        <span style="color: #0000ff">&lt;</span><span style="color: #800000">Rectangle</span> <span style="color: #ff0000">Fill</span><span style="color: #0000ff">=&quot;Red&quot;</span> <span style="color: #ff0000">Width</span><span style="color: #0000ff">=&quot;200&quot;</span> <span style="color: #ff0000">Height</span><span style="color: #0000ff">=&quot;200&quot;</span> <span style="color: #0000ff">/&gt;</span>    <span style="color: #0000ff">&lt;/</span><span style="color: #800000">touch:TouchElement</span><span style="color: #0000ff">&gt;</span>

    <span style="color: #0000ff">&lt;</span><span style="color: #800000">touch:TouchElement</span> <span style="color: #ff0000">TouchDrag</span><span style="color: #0000ff">=&quot;True&quot;</span> <span style="color: #ff0000">TouchScale</span><span style="color: #0000ff">=&quot;True&quot;</span> <span style="color: #ff0000">HorizontalAlignment</span><span style="color: #0000ff">=&quot;Right&quot;</span><span style="color: #0000ff">&gt;</span>        <span style="color: #0000ff">&lt;</span><span style="color: #800000">Rectangle</span> <span style="color: #ff0000">Fill</span><span style="color: #0000ff">=&quot;Blue&quot;</span> <span style="color: #ff0000">Width</span><span style="color: #0000ff">=&quot;200&quot;</span> <span style="color: #ff0000">Height</span><span style="color: #0000ff">=&quot;200&quot;</span> <span style="color: #0000ff">/&gt;</span>    <span style="color: #0000ff">&lt;/</span><span style="color: #800000">touch:TouchElement</span><span style="color: #0000ff">&gt;</span>

    <span style="color: #0000ff">&lt;</span><span style="color: #800000">touch:TouchElement</span> <span style="color: #ff0000">TouchDrag</span><span style="color: #0000ff">=&quot;True&quot;</span> <span style="color: #ff0000">TouchScale</span><span style="color: #0000ff">=&quot;True&quot;</span> <span style="color: #ff0000">HorizontalAlignment</span><span style="color: #0000ff">=&quot;Center&quot;</span> <span style="color: #ff0000">VerticalAlignment</span><span style="color: #0000ff">=&quot;Bottom&quot;</span><span style="color: #0000ff">&gt;</span>        <span style="color: #0000ff">&lt;</span><span style="color: #800000">Image</span> <span style="color: #ff0000">Source</span><span style="color: #0000ff">=&quot;/TouchApp;component/Rocks.jpg&quot;</span>  <span style="color: #ff0000">Width</span><span style="color: #0000ff">=&quot;200&quot;</span> <span style="color: #ff0000">Height</span><span style="color: #0000ff">=&quot;200&quot;</span> <span style="color: #0000ff">/&gt;</span>    <span style="color: #0000ff">&lt;/</span><span style="color: #800000">touch:TouchElement</span><span style="color: #0000ff">&gt;</span><span style="color: #0000ff">&lt;/</span><span style="color: #800000">Grid</span><span style="color: #0000ff">&gt;</span></pre>
<p></div>
<p>In MainPage.xaml.cs, add the following code to initialize the TouchProcessor object.</p>
<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
<pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">TouchProcessor.RootElement = <span style="color: #0000ff">this</span>;TouchProcessor.IsTouchEnabled = <span style="color: #0000ff">true</span>;</pre>
<p></div>
<p>One thing to note is that the Touch functionality doesn’t work in Windowless mode.&#160; By default, Windowless mode is set to false and it is a feature that should be used with caution.&#160; For more information on the limitations of Windowless mode, check out this <a href="http://blogs.msdn.com/silverlight_sdk/archive/2008/11/12/limitations-of-windowless-mode-for-silverlight.aspx" target="_blank">article</a>.</p>
<p>Compile and run the application.&#160; As mentioned before, you will need the required hardware to recognized the Touch events.&#160; You can drag the three items across the screen as well as scale them to different sizes.&#160; The item is also brought to the front of the screen after release the touch point.</p>
<p>The demo of this version can be found <a href="http://www.silverlighttoys.com/Articles/SilverlightMultiTouch/Demo/" target="_blank">here</a>.&#160; </p>
<p><a href="http://blog.bayprince.com/wp-content/uploads/2010/01/Screenshot.jpg"><img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Screenshot" border="0" alt="Screenshot" src="http://blog.bayprince.com/wp-content/uploads/2010/01/Screenshot_thumb.jpg" width="244" height="175" /></a> </p>
<h2>4. Wrapping Up</h2>
<p>Thanks for checking out this article.&#160; Stay tuned for my next blog post, where I introduce more customization for the TouchLibrary, including Gesture support, parented selection, and touch events in a ChildWindow.</p>
<p><a title="http://www.silverlighttoys.com/Articles.aspx?Article=SilverlightMultiTouch" href="http://www.silverlighttoys.com/Articles.aspx?Article=SilverlightMultiTouch">http://www.silverlighttoys.com/Articles.aspx?Article=SilverlightMultiTouch</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bayprince.com/2010/01/multi-touch-in-silverlight-3-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silverlight 4 Youtube Demo</title>
		<link>http://blog.bayprince.com/2009/11/silverlight-4-youtube-demo/</link>
		<comments>http://blog.bayprince.com/2009/11/silverlight-4-youtube-demo/#comments</comments>
		<pubDate>Mon, 23 Nov 2009 20:01:05 +0000</pubDate>
		<dc:creator>bayprince</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[samples]]></category>
		<category><![CDATA[silverlight 4]]></category>
		<category><![CDATA[youtube]]></category>

		<guid isPermaLink="false">http://blog.bayprince.com/?p=45</guid>
		<description><![CDATA[One cool feature that Silverlight 4 supports is the ability to display HTML content, a feature that was not supported in previous versions of Silverlight.  You can enable this feature by utilizing the new WebBrowser control and have it point to the appropriate HTML content.  The WebBrowser control currently only works in Silverlight OOB (Out of [...]]]></description>
			<content:encoded><![CDATA[<p>One cool feature that Silverlight 4 supports is the ability to display HTML content, a feature that was not supported in previous versions of Silverlight.  You can enable this feature by utilizing the new WebBrowser control and have it point to the appropriate HTML content.  The WebBrowser control currently only works in Silverlight OOB (Out of Browser mode).</p>
<p>I made a fun demo that allows users to search and view Youtube contents in Silverlight.  This is a cool concept because it also shows that the <strong>WebBrowser</strong> can indirectly support bringing Flash into Silverlight. The Youtube Demo takes input from the user to either search for the videos or get the videos from a standard feed (most popular, recently viewed..etc).  The user can then select from the list videos in Default View (listbox) or Slide View (custom navigation).  The Youtube video embed string to sent to the <strong>WebBrowser</strong> control&#8217;s <strong>NavigateToString</strong> method to render out the video.</p>
<p>Demo: <a href="http://www.silverlighttoys.com/Samples/SL4/SLYoutube/">http://www.silverlighttoys.com/Samples/SL4/SLYoutube/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bayprince.com/2009/11/silverlight-4-youtube-demo/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silverlight 4 Beta Released</title>
		<link>http://blog.bayprince.com/2009/11/silverlight-4-beta-released/</link>
		<comments>http://blog.bayprince.com/2009/11/silverlight-4-beta-released/#comments</comments>
		<pubDate>Fri, 20 Nov 2009 22:00:01 +0000</pubDate>
		<dc:creator>bayprince</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[samples]]></category>
		<category><![CDATA[silverlight 4]]></category>

		<guid isPermaLink="false">http://blog.bayprince.com/?p=36</guid>
		<description><![CDATA[Silverlight 4 Beta was announced at the PDC 09 event in Los Angeles. The new version is filled with many exciting new features, including Webcam / Microphone Support, Printing API, RichTextArea control, and much more.  For more information on getting started with Silverlight 4, check out the following links: Get Started with Silverlight 4 Tim Heuer&#8217;s Article about Silverlight 4 Features [...]]]></description>
			<content:encoded><![CDATA[<p>Silverlight 4 Beta was announced at the <a href="http://www.microsoftpdc.com" target="_blank">PDC 09</a> event in Los Angeles. The new version is filled with many exciting new features, including Webcam / Microphone Support, Printing API, RichTextArea control, and much more. </p>
<p>For more information on getting started with Silverlight 4, check out the following links:</p>
<p><a href="http://www.silverlight.net/getstarted/silverlight-4-beta/" target="_blank">Get Started with Silverlight 4</a></p>
<p><a href="http://timheuer.com/blog/archive/2009/11/18/whats-new-in-silverlight-4-complete-guide-new-features.aspx" target="_blank">Tim Heuer&#8217;s Article about Silverlight 4 Features</a></p>
<p><a href="http://channel9.msdn.com/learn/courses/Silverlight4/" target="_blank">Silverlight 4 Training Course</a></p>
<p>I decided to upgrade couple of my demos to support the new features. The current version of Silverlight 4 Beta is intended for developer use only. This means that you will need the Developer runtime to view Silverlight 4 Beta applications. There is no “Go Live” support and not intended for public viewing. The end user runtime will be available next year.</p>
<p><strong>Silverlight 4 Shader Sandox</strong></p>
<p>Demo:  <a href="http://www.silverlighttoys.com/Samples/SL4/ShaderSandbox/">http://www.silverlighttoys.com/Samples/SL4/ShaderSandbox/</a></p>
<p>This demo allows users to drag images from their local machines to the application, which renders them out in a wrapped gallery fashion.  The left pane shows the various shader options to play with.  The current version supports changing all of the images to the selected pixel shader.  The images can be selected to view a scaled size render in a child window.  The window also gives options to save and print the rendered image.</p>
<p> </p>
<p><strong>Silverlight 4 Carousel</strong></p>
<p>Demo: <a href="http://www.silverlighttoys.com/Samples/SL4/Carousel/">http://www.silverlighttoys.com/Samples/SL4/Carousel/</a></p>
<p>This demo is implemented using Silverlight 4&#8242;s Drag and Drop and Perspective Transforms functionalities.  The user can drag images from their local machines to the application to generate a custom sized carousel.  The current version only supports navigation through the Previous and Next buttons and arrow keys on the keyboard.  The spacing between the items can be adjusted to tailor the size of the carousel.  The images can be selected to view their full size and enable the options to print and save the selected image.</p>
<p><strong> </strong></p>
<p><strong>Silverlight 4 Shader Webcam</strong></p>
<p>Demo: <a href="http://www.silverlighttoys.com/Samples/SL4/CamShaderSandbox/">http://www.silverlighttoys.com/Samples/SL4/CamShaderSandbox/</a></p>
<p>This is a fun demo that allows the application to utilizes Silverlight 4&#8242;s Webcam support.  The user can select a custom pixel shader in the left pane and view the video rendering with the selected shader.  An upcoming version of the application will allow the user to save and print screenshots with the selected shader.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bayprince.com/2009/11/silverlight-4-beta-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SL3 Multi-touch 3D SlideView</title>
		<link>http://blog.bayprince.com/2009/11/sl3-multi-touch-3d-slideview/</link>
		<comments>http://blog.bayprince.com/2009/11/sl3-multi-touch-3d-slideview/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 22:25:12 +0000</pubDate>
		<dc:creator>bayprince</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[multi-touch]]></category>
		<category><![CDATA[samples]]></category>
		<category><![CDATA[silverlight 3]]></category>

		<guid isPermaLink="false">http://blog.bayprince.com/?p=32</guid>
		<description><![CDATA[I decided to have some fun with the Multi-touch feature by throwing it in the 3D SlideView sample, which is currently hosted on the main page of http://www.silverlighttoys.com.  The original version of 3D SlideView presents a perspective slideview, which places the items on the xz plane.  The user can navigate through the application by clicking on the [...]]]></description>
			<content:encoded><![CDATA[<p>I decided to have some fun with the Multi-touch feature by throwing it in the 3D SlideView sample, which is currently hosted on the main page of <a href="http://www.silverlighttoys.com">http://www.silverlighttoys.com</a>.  The original version of 3D SlideView presents a perspective slideview, which places the items on the xz plane.  The user can navigate through the application by clicking on the child item or using the keyboard.  The new version adds the ability to flick between items using horizontal flicks.</p>
<p>Demo: <a href="http://www.silverlighttoys.com">http://www.silverlighttoys.com</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bayprince.com/2009/11/sl3-multi-touch-3d-slideview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SL3 Multi-touch SlideView</title>
		<link>http://blog.bayprince.com/2009/11/sl3-multi-touch-slideview/</link>
		<comments>http://blog.bayprince.com/2009/11/sl3-multi-touch-slideview/#comments</comments>
		<pubDate>Tue, 17 Nov 2009 19:03:20 +0000</pubDate>
		<dc:creator>bayprince</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[multi-touch]]></category>
		<category><![CDATA[samples]]></category>
		<category><![CDATA[silverlight 3]]></category>

		<guid isPermaLink="false">http://blog.bayprince.com/?p=29</guid>
		<description><![CDATA[Earlier this year, we developed a SlideView layout for displaying content in a fun and easy-to-use navigation style.  The items are stored in a horizontal direction to represent a single layer of content.  Each item renders a screenshot and points to a file or remote url address.  The user can navigate through the application using [...]]]></description>
			<content:encoded><![CDATA[<p>Earlier this year, we developed a SlideView layout for displaying content in a fun and easy-to-use navigation style.  The items are stored in a horizontal direction to represent a single layer of content.  Each item renders a screenshot and points to a file or remote url address.  The user can navigate through the application using the Keyboard and mouse.</p>
<p>Silverlight 3 introduces Multi-touch capabilities and mouse wheel gestures.  In its current state, Silverlight only supports Touch points.  We implemented click and flick gestures to control navigation between items.  The mouse wheel support allows for another means of navigation by determining the mouse wheel&#8217;s direction.</p>
<p>I updated the SlideView Demo to support the new features.  You will need Windows 7 and a Multi-touch device to test those features.</p>
<p>Demo: <a href="http://www.silverlighttoys.com/Samples/SL2/SlideView/">http://www.silverlighttoys.com/Samples/SL2/SlideView/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bayprince.com/2009/11/sl3-multi-touch-slideview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MCTS &#8211; ASP.NET Development</title>
		<link>http://blog.bayprince.com/2009/10/mcts-asp-net-development/</link>
		<comments>http://blog.bayprince.com/2009/10/mcts-asp-net-development/#comments</comments>
		<pubDate>Mon, 12 Oct 2009 10:15:57 +0000</pubDate>
		<dc:creator>bayprince</dc:creator>
				<category><![CDATA[Certification]]></category>
		<category><![CDATA[mcts]]></category>
		<category><![CDATA[microsoft certified technology specialist]]></category>

		<guid isPermaLink="false">http://blog.bayprince.com/?p=22</guid>
		<description><![CDATA[I passed the 70-562 Exam (Microsoft .NET Framework 3.5, ASP.NET Development).  This is the fourth and final exam for this year.]]></description>
			<content:encoded><![CDATA[<p>I passed the 70-562 Exam (Microsoft .NET Framework 3.5, ASP.NET Development).  This is the fourth and final exam for this year.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bayprince.com/2009/10/mcts-asp-net-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MCTS &#8211; Windows Forms Development</title>
		<link>http://blog.bayprince.com/2009/09/mcts-windows-forms-development/</link>
		<comments>http://blog.bayprince.com/2009/09/mcts-windows-forms-development/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 08:00:18 +0000</pubDate>
		<dc:creator>bayprince</dc:creator>
				<category><![CDATA[Certification]]></category>
		<category><![CDATA[mcts]]></category>
		<category><![CDATA[microsoft certified technology specialist]]></category>

		<guid isPermaLink="false">http://blog.bayprince.com/?p=20</guid>
		<description><![CDATA[I passed the 70-505 Exam (Microsoft .NET Framework 3.5, Windows Forms Application Development).]]></description>
			<content:encoded><![CDATA[<p>I passed the 70-505 Exam (Microsoft .NET Framework 3.5, Windows Forms Application Development).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bayprince.com/2009/09/mcts-windows-forms-development/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Silverlight Bing</title>
		<link>http://blog.bayprince.com/2009/07/silverlight-twitter-and-bing/</link>
		<comments>http://blog.bayprince.com/2009/07/silverlight-twitter-and-bing/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 19:25:34 +0000</pubDate>
		<dc:creator>bayprince</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[bing]]></category>
		<category><![CDATA[samples]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://blog.bayprince.com/?p=25</guid>
		<description><![CDATA[I&#8217;ve been playing with the Bing SDK with Silverlight 3. Demo: http://www.silverlighttoys.com/Samples/SL3/Bing/ The Bing search application utilizes basic and image search using the Bing SDK.  This is a quick mockup that I whipped up in a couple hours.]]></description>
			<content:encoded><![CDATA[<p style="text-align: left;">I&#8217;ve been playing with the Bing SDK with Silverlight 3.</p>
<p style="text-align: left;">Demo: <a href="http://www.silverlighttoys.com/Samples/SL3/Bing/">http://www.silverlighttoys.com/Samples/SL3/Bing/</a></p>
<p style="text-align: left;">The Bing search application utilizes basic and image search using the Bing SDK.  This is a quick mockup that I whipped up in a couple hours.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bayprince.com/2009/07/silverlight-twitter-and-bing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
