<?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>xaml ninja &#187; Surface</title>
	<atom:link href="http://blogs.xamlninja.com/category/surface/feed" rel="self" type="application/rss+xml" />
	<link>http://blogs.xamlninja.com</link>
	<description>xaml ninja moves</description>
	<lastBuildDate>Tue, 10 Jan 2012 19:46:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Its a POC don&#8217;t worry about the data&#8230;</title>
		<link>http://blogs.xamlninja.com/blend/its-a-poc-dont-worry-about-the-data</link>
		<comments>http://blogs.xamlninja.com/blend/its-a-poc-dont-worry-about-the-data#comments</comments>
		<pubDate>Thu, 11 Mar 2010 13:37:43 +0000</pubDate>
		<dc:creator>rich</dc:creator>
				<category><![CDATA[Blend]]></category>
		<category><![CDATA[MVVM]]></category>
		<category><![CDATA[Surface]]></category>
		<category><![CDATA[Xaml]]></category>

		<guid isPermaLink="false">http://blogs.xamlninja.com/blend/its-a-poc-dont-worry-about-the-data</guid>
		<description><![CDATA[In the last post my aim was to start a conversation around the advantages of building a visual data model. But this is a POC ? Why would you do this? Well its an interesting question and I am sure that there are folks out there who like to build prototypes and POC’s in this [...]]]></description>
			<content:encoded><![CDATA[<p>In the last post my aim was to start a conversation around the advantages of building a visual data model.</p>
<p>But this is a POC ? Why would you do this? </p>
<p>Well its an interesting question and I am sure that there are folks out there who like to build prototypes and POC’s in this way, but based on my experience this usually ends up taking longer as you find yourself adding a workaround to the existing workarounds resulting in friction between what you want to do and the limitations of the framework. So the approach that I prefer to use is to take some time out at the start of the process and deconstruct the visual designs and build out a data model to represent what information needs to be presented. We can then go off and create the simple factory classes to build these data structures and take full advantage of the features supported by the framework. In essence we are using the same techniques that we would use for a production quality application but slimming down a journey through the application using more appropriate patterns.</p>
<p>This simple process is not time consuming, helps clear up any potential misunderstanding of how the application will react based on certain interactions, and it means that when deconstructing the visual designs its easy to figure out what type of control you can use in order to build the visual and if the control you are thinking about using will support the interactions required. The additional bonus here is that if you want to go a step further then you easily wire in a simple MVVM pattern, again this is something that I do however its not an essential step.</p>
<p>What I also like about this approach is that POC’s are usually built in a short timeframe and are thus open to change on a regular basis and we need to have an approach which reduces churn. By having a good data model you can limit the pain when things change as you can easily change the data object to suit and then a simple change to the Xaml. The opposite of this can result in lots of conditional logic which becomes prone to bugs and also limiting the application to potentially just a clickable mockup.</p>
<p>The other benefit which results in this approach is the level of reusability that I can pull from the POC and move into the production application. By having taken the time to produce a data structure that is usable this means that I can potentially reuse all the existing data templates, data bindings, styles, templates and certain custom controls. Again from my experience this level of reusability is normally higher than when we push forwards with a more static and tightly coupled approach.</p>
<p>To put this into a better context, a number of Surface applications that I have been involved in recently have required a ScatterView with ScatterView Items as these control provide those all important gestures for NUI interactions out of the box. Cool, but we are faced with the options either; create a known number of items and potentially recreate the same style but with different hardwired data; or create a single data template and style and take advantage of the data bind features. This can easily be achieved by data binding to the DP’s provided by the ScatterView Item that controls its placement, its easy to maintain and manage when those known changes happen. It also provides us with the flexibility to extend certain aspects rapidly without getting freaked out by the amount of conditional logic being added to the app.</p>
<p>My approach here is a simple one, create a base class for all your data controlled visuals which allow you to provide point data information so that when the objects are created you can initialise them where they need to be placed on screen. You can also add into here some more properties such as Orientation and data bind your data object property to the Orientation DP. Properties such as CanScale etc I would manipulate in a Style for the ScatterView Item, however there is no reason why you could not add them into the base. My reasons for the using a Style is so that when I am working with the designer I can easily make changes to the Style when we are both using Blend, it also allows me to share the work with designers visually, this for me is essential, personally I am more of a visual guy I prefer to see something rather than read textual content a visual helps paint the picture in a more accurate way with less room for individual perceptions of a textual instruction or description.</p>
<p>This simple approach provides; the ability to place visual elements exactly where the designer wants them;animations can be built in order to animate these visual elements on and off screen, interrogating the strongly typed data types means that we can apply the required styles on demand; reduces the complexity of app by taking advantage of data binding.</p>
<p>Just to break this down a little further, with the Tag Heuer implementation, I created a bunch of data objects for the locations around the world, London, Los Angeles, Cape Town, Sydney etc; all of which subclass the same base called Location. Location, Travel and Watches, the three different states of the app all subclass a class providing the positioning logic which intern subclasses an abstract base implementing INPC. I then have a data templates for each of the locations that we need to visualise, London, Los Angeles, Cape Town, Sydney etc. The data templates deal nicely with presenting our data, however there is a problem with layout as some of the aforementioned locations need to be positioned from left to right and some need to be positioned from right to left. To achieve this visual effect I used a different style<br />
 one for left to right and a second for right to left and wired these into the data template. I could have written c# to flip the visual tree however in this instance it was more effective to rebuild the styles in Blend it also has the advantage that I can show the designer in Blend the visual created and make any additional tweaks required.</p>
<p><a href="http://blogs.xamlninja.com/wp-content/uploads/2010/03/Illustrated_Travel.png" rel="shadowbox[sbpost-211];player=img;" target="_blank"><img style="border-bottom: 0px; border-left: 0px; margin: 5px; display: inline; float: none; border-top: 0px; border-right: 0px" title="Illustrated_Travel" border="0" alt="Illustrated_Travel" src="http://blogs.xamlninja.com/wp-content/uploads/2010/03/Illustrated_Travel_thumb.png" width="644" height="483" /></a> </p>
<p>I used the same technique for the F1 GP races and the watches area all of which have strongly typed data objects to encapsulate the visual information providing me with the advantages mentioned above to create and adapt quickly with the changes to the visual designs, it also allows me to take advantage of OO when it comes to adding additional properties to the base classes which will have a ripple effect down the object hierarchy.</p>
</p>
<p>In your next POC or prototype in WPF I hope that you will feel confident enough to try out this technique and reap the benefits that are at your disposal. Unfortunately the current version of Silverlight does not support implicit data templates, which in my humble opinion is a fundamental missing part of the Silverlight framework. Hopefully we will see this in a future release.</p>
<p> In the next post I am going to dig into how I built the watches section of the application and also dive into how interactions with the watch chrome and its content were created.</p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.xamlninja.com/blend/its-a-poc-dont-worry-about-the-data/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>JC Decaux and Tag Heuer Surface Application deployed to Heathrow T5</title>
		<link>http://blogs.xamlninja.com/blend/jc-decaux-and-tag-heuer-surface-application-deployed-to-heathrow-t5</link>
		<comments>http://blogs.xamlninja.com/blend/jc-decaux-and-tag-heuer-surface-application-deployed-to-heathrow-t5#comments</comments>
		<pubDate>Thu, 25 Feb 2010 15:13:37 +0000</pubDate>
		<dc:creator>rich</dc:creator>
				<category><![CDATA[Blend]]></category>
		<category><![CDATA[MVVM]]></category>
		<category><![CDATA[Surface]]></category>
		<category><![CDATA[Xaml]]></category>

		<guid isPermaLink="false">http://blogs.xamlninja.com/?p=172</guid>
		<description><![CDATA[This is really the start of a number of posts that I have been meaning to put together for a while now. These are centred around how to rapidly build prototypes. It’s a technique that I use on a regular basis both for WPF and for Silverlight. In order for me to get across how [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://blogs.xamlninja.com/wp-content/uploads/2010/02/T5_21.jpg" rel="shadowbox[sbpost-172];player=img;" target="_blank"><img style="display: inline; border: 0px;" title="T5_2" src="http://blogs.xamlninja.com/wp-content/uploads/2010/02/T5_2_thumb1.jpg" border="0" alt="T5_2" width="280" height="184" /></a> <a href="http://blogs.xamlninja.com/wp-content/uploads/2010/02/surface_unit_photos_manemailable1.jpg" rel="shadowbox[sbpost-172];player=img;" target="_blank"><img style="display: inline; border: 0px;" title="surface_unit_photos_manemailable" src="http://blogs.xamlninja.com/wp-content/uploads/2010/02/surface_unit_photos_manemailable_thumb1.jpg" border="0" alt="surface_unit_photos_manemailable" width="273" height="184" /></a></p>
<p>This is really the start of a number of posts that I have been meaning to put together for a while now. These are centred around how to rapidly build prototypes. It’s a technique that I use on a regular basis both for WPF and for Silverlight. In order for me to get across how effective this is it seems only right to provide context of how you can also take advantage of this technique.</p>
<p>More about that later, for this particular implementation I partnered with Splendid in order to produce an interactive experience for travellers at London Heathrow T5 lounges. The brief was to help raise brand awareness of the new Tag Heuer watches available and take advantage of the collaborate aspects provided by Surface.</p>
<p>The Tag Heuer Surface application has three main areas of functionality, all driven by the concept of time.<br />
<br/></p>
<p><a href="http://blogs.xamlninja.com/wp-content/uploads/2010/02/04_travel_detail11.jpg" rel="shadowbox[sbpost-172];player=img;" target="_blank"><img style="margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 10px; display: inline; border: 0px initial initial;" src="http://blogs.xamlninja.com/wp-content/uploads/2010/02/04_travel_detail1_thumb1.jpg" border="0" alt="04_travel_detail1" width="244" height="184" align="right" /></a></p>
<p><strong>Travel Guide:</strong> The application displays the current time at your departure destination, displayed on a Tag Heuer watch display with moving hands. Using a stylized world map passengers can choose popular destinations and explore local time, travel duration and view local landmarks.</p>
<p><br/><br/><br/><br/><br/><br/><br />
<a href="http://blogs.xamlninja.com/wp-content/uploads/2010/02/06_sports_detail1.jpg" rel="shadowbox[sbpost-172];player=img;" target="_blank"><img style="margin-top: 5px; margin-right: 10px; margin-bottom: 5px; margin-left: 5px; display: inline; border: 0px initial initial;" src="http://blogs.xamlninja.com/wp-content/uploads/2010/02/06_sports_detail_thumb1.jpg" border="0" alt="06_sports_detail" width="244" height="184" align="left" /></a></p>
<p><strong><strong>Sports Finder:</strong></strong> Tag Heuer have a number of sports stars as ambassadors, we chose Lewis Hamilton as the trial location was the UK. Passengers can explore the world find the next Grand Prix including a  countdown and images of last years race.</p>
<p><br/><br/><br/><br/><br/><br/><br />
<a href="http://blogs.xamlninja.com/wp-content/uploads/2010/02/08_collection_detail1_zoom1.jpg" rel="shadowbox[sbpost-172];player=img;" target="_blank"><img style="margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 10px; display: inline; border: 0px initial initial;" src="http://blogs.xamlninja.com/wp-content/uploads/2010/02/08_collection_detail1_zoom_thumb1.jpg" border="0" alt="09_collection_detail1_resize" width="244" height="184" align="right" /></a><strong><strong>Watch Explorer: </strong></strong>A Tag Heuer Application wouldn’t be quite right without the ability to explore their classic  watch collection, passengers can use gesture to explore high-res images of the men’s and women’s collections with the ability to sign-up for an email on your favourite watch. The email contains details of the watch and your nearest location to purchase.<br />
<br/><br/><br/><br/><br/><br/><br />
For a UX developer there are some really rather cool interactions used in each of the areas. I am going to try and give a higher level overview of these areas  below and then jump into the detail in separate posts. The first of these are interactions present in each of the different functional pillars of the experience illustrated above and were designed so that visual elements could be placed into specific areas, animation of these items on and off screen and designed in such away that data bound objects provided the visual positioning information. The solution I used here was a combination of strongly typed data templates with model objects that contained the required coordinates of where to be positioned on screen and styles to create the required interactions.</p>
<p>When deconstructing the visual design I knew that the ScatterView Control would do the job nicely and having the coordinates in the model meant that we can take full advantage of data binding as each ScatterView Item has a centre and orientation DP which can be used to achieve this layout. Using a different ScatterViewItem Style provided the ability to choose different interactions and visuals based on which area of functionality is in use. Note there are 2 styles for the map points; a style for map points which are right aligned and a style for those which are left aligned. Using the strongly typed data templates and the use of data binding provides a clean and easy to achieve solution that provided the required interactions. The application was aware of its state and by changing the data based on state the usage of the strongly typed data templates come into their own as these state changes are triggered resulting in the new visuals to be displayed all done using data and data bindings in the Xaml.</p>
<p>For the travel section animated clocks were used and the TimeZoneInfo class provided the ability  to calculate the time in different time zones. Here I used a dispatch timer that was ticking away and then updating the value of the data object. Each of the different time zones were associated data objects of the current location using data binding and INPC meant that we can change the time in the data object and this will trigger the animations used to rotate the hands on the watch.</p>
<p>The watch section has cool interaction where there is a 2 level zoom mechanism, I broke this one down to<a href="http://blogs.xamlninja.com/wp-content/uploads/2010/02/09_collection_detail1_resize1.jpg" rel="shadowbox[sbpost-172];player=img;" target="_blank"><img style="margin-top: 5px; margin-right: 5px; margin-bottom: 5px; margin-left: 10px; display: inline; border: 0px initial initial;" src="http://blogs.xamlninja.com/wp-content/uploads/2010/02/09_collection_detail1_resize_thumb1.jpg" border="0" alt="09_collection_detail1_resize" width="244" height="184" align="right" /></a> be a ScatterViewItem which wraps a ScatterView. This allowed for an interaction which meant the user could  use a pinch gesture in increase the size of the outer ring and then a second pinch gesture can be used to manipulate the watch being displayed. What I like about this interaction design is that it allows the user to easy move and collaborate with other users interested in seeing the detailing of the watch. More importantly this also meant that I could take full advantage of data binding and strongly typed data templates.</p>
<p>As you may have noticed there is an underlying theme happening here, data and Xaml. For me WPF is really all about your data, get the data structure right that needs to be presented on screen and we can take full advantage of the framework and reduce the amount of C# code we write to a minimum.</p>
<p>links</p>
<p>The Moodie Report <a href="http://www.moodiereport.com/document.php?c_id=1113&amp;doc_id=23335">http://www.moodiereport.com/document.php?c_id=1113&amp;doc_id=23335</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blogs.xamlninja.com/blend/jc-decaux-and-tag-heuer-surface-application-deployed-to-heathrow-t5/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

