<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Burela's house-o-blog &#187; Silverlight</title>
	<atom:link href="http://davidburela.wordpress.com/category/microsoft-tech/silverlight-microsoft-tech/feed/" rel="self" type="application/rss+xml" />
	<link>http://davidburela.wordpress.com</link>
	<description>SOAK, Silverlight &#38; Azure. All the cool things in life</description>
	<lastBuildDate>Sat, 21 Nov 2009 00:42:42 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='davidburela.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/d1757cb23a691a12d28a92d14eb61214?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Burela's house-o-blog &#187; Silverlight</title>
		<link>http://davidburela.wordpress.com</link>
	</image>
			<item>
		<title>My notes from PDC09 Day 2 Keynote</title>
		<link>http://davidburela.wordpress.com/2009/11/19/my-notes-from-pdc09-day-2-keynote/</link>
		<comments>http://davidburela.wordpress.com/2009/11/19/my-notes-from-pdc09-day-2-keynote/#comments</comments>
		<pubDate>Thu, 19 Nov 2009 04:22:09 +0000</pubDate>
		<dc:creator>David Burela</dc:creator>
				<category><![CDATA[PDC]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[PDC keynote]]></category>
		<category><![CDATA[PDC09]]></category>

		<guid isPermaLink="false">http://davidburela.wordpress.com/2009/11/19/my-notes-from-pdc09-day-2-keynote/</guid>
		<description><![CDATA[Highlights

Scott Gu Rickrolls the entire PDC audience
Silverlight 4 beta is out now!
Silverlight can now access local resources on your computer like cameras, filesystem, drag/drop support
Silverlight has updated WCF support 
IE9 is announced
Work on IE9 has been going on for 3-4 weeks. Performance and Acid3 results are improving
There will be videos on http://channel9.msdn.com/

 
Steve sinofsky comes [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=davidburela.wordpress.com&blog=428267&post=227&subd=davidburela&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>Highlights</strong></p>
<ul>
<li>Scott Gu Rickrolls the entire PDC audience</li>
<li>Silverlight 4 beta is out now!</li>
<li>Silverlight can now access local resources on your computer like cameras, filesystem, drag/drop support</li>
<li>Silverlight has updated WCF support </li>
<li>IE9 is announced</li>
<li>Work on IE9 has been going on for 3-4 weeks. Performance and Acid3 results are improving</li>
<li>There will be videos on <a href="http://channel9.msdn.com/">http://channel9.msdn.com/</a></li>
</ul>
<p> <span id="more-227"></span>
<p><strong>Steve sinofsky comes on stage     <br /></strong>Says win7 has been out for a few weeks now, it has been really humbling.    <br />Will discuss what they learnt from Win7    <br />Some people were saying &quot;just fix these few things&quot;, but they knew it wasn&#8217;t just about solving problem    <br />Their windows 7 blog was useful, there were over 6,000 comments and 10,000 emails with suggestions.    <br />A MASSIVE part of Win7 development was how to handle just the sheer volume suggestions.    <br />The telemetry they built into win7 helped heaps. The hardware reliability, which bits were slow or fast, was the installation of new drivers successful?    <br />The telemetry is like a &quot;black box recorder&quot; of your computer    <br />80% of customers voluntarily opt in to the telemetry feedback.    <br />When applications crash, they send the memory dump via watson back to Microsoft to help sort out issuse.    <br />They showed the &quot;We Share your Pain&quot; video <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' />  the video where they shock the programmer that wrote the piece of code that is annoying you</p>
<ul>
<li>They had ~1,730,000 feedback reports sent back.</li>
<li>~91,500 uniqe external devices plugged in</li>
<li>14,000 unique PRINTERS plugged in</li>
<li>46,000,000 times that areo shake and snap were used</li>
<li>55% of people were using 1024&#215;768 as the screen resolution</li>
</ul>
<p>Talks about UAC, shows a video about it (that we can&#8217;t see via streaming due to Intellectual Property issues)   <br />Goes back to him, he says &quot;and when we are trying out other new features like aero snap, we do the usability testing like this&quot; and it cuts to another video that we aren&#8217;t allowed to view.    <br />Developing for Windows 7, what are the opportunities?    <br />HD audio/video, new sensors, jump lists</p>
<p><strong>Mike comes up on stage to talk about &quot;new things in the ecosystem&quot; (34 mins)     <br /></strong>Shows an eeepc, says it came out 2 years ago. Customers were really interested in the concept.    <br />Netbooks are now the fastest growing category of computers now    <br />Showing a gaming PC that is liquid cooled. Showing off DirectX11    <br />Showing a demo of 10,000 particles doing things, but it is all hardware accelerated. No CPU processing time, it is all being done on the GPU.    <br /><a href="http://www.nvidia.com/object/directcompute.html">http://www.nvidia.com/object/directcompute.html</a>    <br />Showing a &quot;Server replacement laptop&quot;. Corei7 raid5 drives, running hyperv with 3 virtual machines.    <br />The ribbon UI feature is built into Win7 so you can use in your apps. Works well with touch    <br />Showing how firefox supports taskbar preview, google chrome supports jump lists (he comments how he changed the default start page to to bing)</p>
<p><strong>Back to just sinofsky (45 mins)     <br /></strong>When they were building win7, they wanted to know what is it like to build a new piece of hardware? Trying to understand the flow    <br />They decided to build their own laptop from scratch to test it out. Made a tablet pc with all the cool specs, to see how it all hangs together.    <br />Took them about 3months to put it all together.    <br />They announce it as the &quot;windows 7 PDC laptop&quot;, they are giving one to each of the attendees</p>
<p><strong>Internet explorer (48 mins)     <br /></strong>I want to talk about four things, show you where we are heading.    <br />They learnt about &quot;responsible engineering, trustworthy experience, real world interop, innovate technologies.    <br />One of the most talked about and liked features is around privacy and trustworthiness    <br />Said that they made a lot of advances around incorporating web standards&#8230;    <br />Want to continue to make sure that IE is the best featured web browser on windows.    <br />They are working on IE9.    <br />Standards. Admit that they need to do more around Acid3 test. Want to &quot;be responsible&quot; when looking at new things like HTML5    <br />Talking about the &quot;ACID score&quot;, in IE8 they were at 20/100, in IE9 today they are at 32/100    <br />(in comparison, FF is at 70+ and opera is at 100)    <br />Show graphs that there is a lot of work that goes into getting a page on your screen, different sites spend different amout of time in the subsystems (scripts, rendering, etc.)    <br />Show a graph of performance. IE6 was far away. IE8 was still much slower than FF, chrome, etc.    <br />IE9 now is at about the same speed as all the other browsers now.    <br />And these are early builds of IE9 , they have only just started work on IE9 engine for 3-5 weeks    <br />The text rending engine will take advantage of all the clear text technologies, makes it clearer than just straight GDI in IE today    <br />Showing a demo of bing maps. Using GDI rendering they were getting ~13fps. They made the rendering engine now hardware accelerated (as in the screen rendering) and it sped up heaps.    <br />No roadmap for IE9 yet    <br />There will be videos on Channl9 today on IE9</p>
<p><strong>Scott Guthrie comes on stage to talk about Silverlight (1:03)     <br /></strong>In silverlight 3 then enabled hardware accelerated video rendering    <br />They shipped blend 3 with sketchflow    <br />Shows a video about rapid prototyping with sketchflow    <br />A bunch of sites have used steaming (mostly sporting websites) in HD    <br />Lots of big name companies are using it to create scientific apps, line of business apps.    <br />Last year they were at 33% penetration, today there are on 45% of internet connected desktops.</p>
<p><u>Announcing Silverlight 4</u></p>
<ul>
<li>Focusing on 3 things</li>
<li>Media</li>
<li>Business apps</li>
<li>Beyond the browser</li>
</ul>
<ul>
<li>Can access webcam &amp; microphone now</li>
<li>Supporting DRM now&#8230; For some reason that feature didn&#8217;t get any applause</li>
</ul>
<p>Demoing the new webcam stuff.   <br />Can apply pixel shaders over the webcam feed. All the usual distortion effects. They are super fast!    <br />Scott Gu took a random photo and then updated his twitter profile pic as it.    <br />You can get the raw feed of the webcam feed, so they show barcode reading. He scans a copy of the barcode of his ASP.Net MVC book, then it looked it up on Amazon.    <br />Demoing smooth streaming    <br />Demoing other video effects, you can do slow motion, and a few others    <br />Announcing Silverlight media (pack?) that you can use to do those effects    <br />Smooth steaming is available on browsers that don&#8217;t have plugins (like iPhone), they enable HTTP streaming and they pick it up    <br /><a href="http://www.iis.net/iphone">http://www.iis.net/iphone</a></p>
<p>New Silverlight4 features</p>
<ul>
<li>Programmatic printing support</li>
<li>Clipboard access</li>
<li>Right click</li>
<li>Mouse wheel</li>
<li>Implicit styling</li>
<li>Drag/drop files into silverlight</li>
<li>Bidi &amp; RightToLeft text</li>
<li>Can host HTML as a control inside your app</li>
<li>Commanding and MVVM!</li>
</ul>
<p>Shows an app that has English test, arabic, japanese.   <br />Can right click in the app to bring up a context menu.    <br />Copies the text    <br />Pastes in a datagrid control from excel into the silverlight textbox    <br />He drags a word doc from the desktop onto the silverlight app, the app put all the text from the document into the textbox.    <br />He clicks print and the print dialog comes up.    <br />Shows a Silverlight app that has a HTML control, so he has his app with bing.com in a control.     <br />Because it is still a normal control, you can do all the normal crazy things you can do with controls, he makes the control go all about the place, he makes the bing page split up into a jigsaw puzzle and the pieces scatter around the screen.    <br />All the usual plugins work     <br />So he brings up youtube.com and <strong>rickrolls everyone     <br /></strong>While the video is playing, he makes it into a puzzle again, the video is still playing in all the scattered pieces</p>
<ul>
<li>Share assemblies across SL &amp; .net 4.0!!!!</li>
<li>Data binding improvements</li>
<li>UDP multicast support</li>
<li>Peer to peer networking.</li>
<li>REST enhancements</li>
<li>WCF improvements (different streaming, up to 400% faster)</li>
<li>WCF RIA services</li>
</ul>
<ul>
<li>VS2010 support</li>
<li>WYSIWYG desigin</li>
<li>XAML intellisense improvements</li>
</ul>
<ul>
<li>Databinding enhancements</li>
</ul>
<ul>
<li>WCF RIA services integration</li>
</ul>
<p><strong>Scott Hanselman comes on stage to demo how do develop in it (1:30)     <br /></strong>His demo is here <a href="http://jeffhandley.com/archive/2009/11/18/contososales.aspx">http://jeffhandley.com/archive/2009/11/18/contososales.aspx</a>    <br />Buliding a RIA services silverlight app inside VS2010    <br />He is using an EDMX data model    <br />Data model has many Stores have many Contacts (so has a join table)    <br />Creates a new Contact Service    <br />All the WCF methods are returning Iqueryable    <br />New xaml page    <br />The data sources window shows his service    <br />He drags it onto his silverlight window and it auto creates a datagrid and binds it.    <br />The Datasources window works as usual, can see all the fields, can set the control type, drag out. Can make them a ListBox    <br />He is using implicit styling so the ListBoxes look good by default.    <br />He can right click controls and tell them to dock fill    <br />He clicks his control, in the properties window there is a new &quot;styles browser&quot;    <br />Dragging on data pagers    <br />The service is saying that one of the data properties is a URL, so scott changes the control to image, drags it onto the page.    <br />Camel case intellisense support (like resharper)    <br />Brings up the data model, shows annotations. Can now enforce rules on the data which are client side and server side validated automatically (like age must be &gt;18)</p>
<p><strong>Rep from Snapflow comes on stage (1:38)     <br /></strong>Wants people to be able to create applications without &quot;writing a line of code&quot;    <br />Well actually no, this is a &quot;business logic&quot; mapper.    <br />Workflow foundation on steroids?    <br />Yep it isn&#8217;t anywhere near as sophisticated as he claims it is, just a silverlight based workflow creator.</p>
<p><strong>Just scott on stage (1:42)</strong></p>
<p>New Silverlight 4 Out Of Browser features</p>
<ul>
<li>Windowing APIs</li>
</ul>
<ul>
<li>Notification popups</li>
</ul>
<ul>
<li>HTML support</li>
</ul>
<ul>
<li>Drop target</li>
</ul>
<p>You can say that this application MUST run in elevated mode, if the user grants it then you get</p>
<ul>
<li>Custom window chrome</li>
<li>Can access local file system</li>
<li>Cross site network</li>
<li>Keyboard in full screen mode</li>
</ul>
<ul>
<li>Hardware device access</li>
</ul>
<ul>
<li>COM automation support</li>
</ul>
<p>If you had office installed, you could now query outlook for your calendar from silverlight</p>
<p>Access the Win7 sensor information</p>
<ul>
<li>Silverlight 4 is twice as fast</li>
</ul>
<ul>
<li>30% faster startup</li>
</ul>
<ul>
<li>New profiling support! I&#8217;m looking forward to this one</li>
</ul>
<p><strong></strong></p>
<p><strong>Brial Goldfarb on stage (1:47)     <br /></strong>Showing a Silverlight 4 trusted application for accessing Facebook    <br />So he has a custom chrome    <br />Can programmatically move the window around the screen because of this, can make it go into &quot;mini mode&quot;    <br />He uses COM automation, brings in his outlook calendar into silverlight.    <br />Reads his friends feeds, can see the embedded videos in his feeds, can play the youtube vids in his app.    <br />Wants to upload new photos, so he drag and drops a bunch of photos on, he can see them in silverlight and starts tagging them    <br />Takes a photo, plugs the camera in. The app pops up a notification that camera was plugged in, and brings in the new photo.    <br />Will be shipped as a reference sample</p>
<p><strong>Just scott (1:56)     <br /></strong>You can vote on the next silverlight features using their website.    <br />When is silverlight4 coming out?    <br />Beta: SL4 beta is now available for download    <br />Final release: first half 2010</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/davidburela.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/davidburela.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/davidburela.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/davidburela.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/davidburela.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/davidburela.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/davidburela.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/davidburela.wordpress.com/227/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/davidburela.wordpress.com/227/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/davidburela.wordpress.com/227/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=davidburela.wordpress.com&blog=428267&post=227&subd=davidburela&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://davidburela.wordpress.com/2009/11/19/my-notes-from-pdc09-day-2-keynote/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/628722d2f281b09614aba4a038d64bd2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Burela</media:title>
		</media:content>
	</item>
		<item>
		<title>Databinding shapes with the Bing Maps control for Silverlight</title>
		<link>http://davidburela.wordpress.com/2009/11/02/databinding-shapes-with-the-bing-maps-control-for-silverlight/</link>
		<comments>http://davidburela.wordpress.com/2009/11/02/databinding-shapes-with-the-bing-maps-control-for-silverlight/#comments</comments>
		<pubDate>Mon, 02 Nov 2009 04:53:47 +0000</pubDate>
		<dc:creator>David Burela</dc:creator>
				<category><![CDATA[Faarms]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Bing Maps]]></category>
		<category><![CDATA[Bing Maps Control]]></category>
		<category><![CDATA[Databinding]]></category>
		<category><![CDATA[Silverlight Control]]></category>
		<category><![CDATA[Virtual Earth]]></category>
		<category><![CDATA[Virtual Earth Control]]></category>

		<guid isPermaLink="false">http://davidburela.wordpress.com/?p=172</guid>
		<description><![CDATA[The March 2009 release of the Virtual Earth control for Silverlight (now known as the bing map control) was a great release. Up until then, projects like Deep Earth were trying to provide us with a way to use deep zoom + the virtual earth tiling to allow us to build Silverlight apps. Now Microsoft [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=davidburela.wordpress.com&blog=428267&post=172&subd=davidburela&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>The March 2009 release of the Virtual Earth control for Silverlight (now known as the bing map control) was a great release. Up until then, projects like Deep Earth were trying to provide us with a way to use deep zoom + the virtual earth tiling to allow us to build Silverlight apps. Now Microsoft have given us an official control to play with.</p>
<p>One of the big downsides of the official control was the lack of databinding. You still had to add / remove your pushpins &amp; shapes manually just like you would with the AJAX version. There is code available on the Microsoft website that adds dependency properties to the Bing Maps control which expose ItemsCollection, ready for you to databind to. If you combine this with some custom datatemplates, you are able to databind directly to the map as you would expect.</p>
<h3>Step 1. Install the Bing Maps control</h3>
<p>The CTP of the control is available from Microsoft connect <a href="https://connect.microsoft.com/silverlightmapcontrolctp">https://connect.microsoft.com/silverlightmapcontrolctp</a></p>
<p> <span id="more-172"></span><br />
<h3>Step 2. Download the databinding enabler</h3>
<p>You just need to download this single .cs file and include it in your project <a href="http://code.msdn.microsoft.com/VESLBindingProps">http://code.msdn.microsoft.com/VESLBindingProps</a></p>
<h3>Step 3. Add the Bing maps control to your .xaml page</h3>
<p>Add the virtual earth namespace for the control, the ve namespace for the dependency properties, and then the grid. It should look something like this</p>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">UserControl</span> <span class="attr">x:Class</span><span class="kwrd">=&quot;SDDNTestRun.MainPage&quot;</span>
    <span class="attr">xmlns</span><span class="kwrd">=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span>
    <span class="attr">xmlns:x</span><span class="kwrd">=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</span>
    <span class="attr">xmlns:d</span><span class="kwrd">=&quot;http://schemas.microsoft.com/expression/blend/2008&quot;</span>
    <span class="attr">xmlns:mc</span><span class="kwrd">=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot;</span>
    <span class="attr">xmlns:VirtualEarth</span><span class="kwrd">=&quot;clr-namespace:Microsoft.VirtualEarth.MapControl;assembly=Microsoft.VirtualEarth.MapControl&quot;</span>
    <span class="attr">xmlns:ve</span><span class="kwrd">=&quot;clr-namespace:Synergist.VE&quot;</span>
    <span class="attr">mc:Ignorable</span><span class="kwrd">=&quot;d&quot;</span> <span class="attr">d:DesignWidth</span><span class="kwrd">=&quot;640&quot;</span> <span class="attr">d:DesignHeight</span><span class="kwrd">=&quot;480&quot;</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">Grid</span> <span class="attr">x:Name</span><span class="kwrd">=&quot;LayoutRoot&quot;</span> <span class="kwrd">&gt;</span>
        <span class="kwrd">&lt;</span><span class="html">VirtualEarth:Map</span> <span class="attr">x:Name</span><span class="kwrd">=&quot;MyMap&quot;</span>
                <span class="attr">CopyrightVisibility</span><span class="kwrd">=&quot;Collapsed&quot;</span> <span class="attr">LogoVisibility</span><span class="kwrd">=&quot;Collapsed&quot;</span> <span class="attr">Mode</span><span class="kwrd">=&quot;Aerial&quot;</span><span class="kwrd">&gt;</span>
        <span class="kwrd">&lt;/</span><span class="html">VirtualEarth:Map</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;/</span><span class="html">Grid</span><span class="kwrd">&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">UserControl</span><span class="kwrd">&gt;</span></pre>
<h3>Step 4. Add the data template for shapes and the map layer</h3>
<p>This data template to databind polyshapes is fairly easy. You just need to set the polyshape style (thickness, colour, etc.) and then databind the points to the locations collection</p>
<pre class="csharpcode">&lt;DataTemplate x:Key=<span class="str">&quot;MapShape&quot;</span>&gt;
    &lt;VirtualEarth:MapPolygon Fill=<span class="str">&quot;Orange&quot;</span> Stroke=<span class="str">&quot;Green&quot;</span> StrokeThickness=<span class="str">&quot;2&quot;</span> Opacity=<span class="str">&quot;0.4&quot;</span> Locations=<span class="str">&quot;{Binding}&quot;</span> /&gt;
&lt;/DataTemplate&gt;</pre>
<p>And here is how you add the layer to the map</p>
<pre class="csharpcode">&lt;VirtualEarth:Map x:Name=<span class="str">&quot;MyMap&quot;</span>
    CopyrightVisibility=<span class="str">&quot;Collapsed&quot;</span> LogoVisibility=<span class="str">&quot;Collapsed&quot;</span> Mode=<span class="str">&quot;Aerial&quot;</span>&gt;
    &lt;VirtualEarth:MapLayer x:Name=<span class="str">&quot;ShapeLayer&quot;</span>
        ve:Properties.ItemsSource=<span class="str">&quot;{Binding}&quot;</span>
        ve:Properties.ItemTemplate=<span class="str">&quot;{StaticResource MapShape}&quot;</span> /&gt;
&lt;/VirtualEarth:Map&gt;</pre>
<h3>Step 5. Add some data to the layer</h3>
<p>This is the fun bit, figure out what the coordinates for your shape are and create a collection for it. Myself, i’m going to use the site of the Microsoft office here in Melbourne. I’m just going to do this in the page constructor in the code behind</p>
<pre class="csharpcode">MyMap.Center = <span class="kwrd">new</span> Location(-37.8222600730785, 144.962552763317);
MyMap.ZoomLevel = 17;

var shapeList = <span class="kwrd">new</span> ObservableCollection&lt;LocationCollection&gt;
{
<span class="kwrd">new</span> LocationCollection
    {
        <span class="kwrd">new</span> Location(-37.8217176782418, 144.961662269924),
        <span class="kwrd">new</span> Location(-37.8214041044085, 144.962391830776),
        <span class="kwrd">new</span> Location(-37.8222346484096, 144.963314510677),
        <span class="kwrd">new</span> Location(-37.8228194135791, 144.962638594005),
        <span class="kwrd">new</span> Location(-37.8223617716666, 144.961887575481),
        <span class="kwrd">new</span> Location(-37.8220397256568, 144.962005592678),
    }
};
ShapeLayer.DataContext = shapeList;</pre>
<h3>Step 6. Hit run and see your databinding in action!</h3>
<p>Because we are databinding to an observable list, we can just add new items to it and watch the new shapes appear. It is also possible to add extra points to an existing shape, and see it update live on the map.</p>
<p>If you want to add an extra shape, add this to a click event to see the databinding happening interactively</p>
<pre class="csharpcode">shapeLists.Add(<span class="kwrd">new</span> LocationCollection()
{
    <span class="kwrd">new</span> Location(-37.8207645163828, 144.961630711604),
    <span class="kwrd">new</span> Location(-37.8200356576319, 144.96164144044),
    <span class="kwrd">new</span> Location(-37.8197136014726, 144.96321857934),
    <span class="kwrd">new</span> Location(-37.8206882408042, 144.962092051554)
});</pre>
<h3>Step 7. Pushpins</h3>
<p>Pushpins are a little more involved. Here i have created a “Point of Interest” class, that has the location and extra details. Here i’m just going to use the location property to databind to. The good thing is that you can use any control as your pushpin. In the included sample my PushPin control expands out when you hover, and collapses when you move off it.</p>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">DataTemplate</span> <span class="attr">x:Key</span><span class="kwrd">=&quot;MicrosoftPushPin&quot;</span><span class="kwrd">&gt;</span>
    <span class="kwrd">&lt;</span><span class="html">Controls:PushPin</span> <span class="attr">VirtualEarth:MapLayer</span>.<span class="attr">MapPosition</span><span class="kwrd">=&quot;{Binding Loc}&quot;</span>
        <span class="attr">VirtualEarth:MapLayer</span>.<span class="attr">MapPositionMethod</span><span class="kwrd">=&quot;Center&quot;</span>  <span class="kwrd">/&gt;</span>
<span class="kwrd">&lt;/</span><span class="html">DataTemplate</span><span class="kwrd">&gt;</span></pre>
<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">class</span> POI
{
    <span class="kwrd">public</span> <span class="kwrd">string</span> Loc { get; set; }
    <span class="kwrd">public</span> <span class="kwrd">string</span> Description { get; set; }
}

<span class="rem">//In the class constructor</span>
PushPinLayer.DataContext = <span class="kwrd">new</span> ObservableCollection&lt;POI&gt;
{
   <span class="kwrd">new</span> POI() { Loc = <span class="str">&quot;-37.8222600730785, 144.962552763317&quot;</span> }
};</pre>
<h3>Sample app</h3>
<p><a href="http://davidburela.files.wordpress.com/2009/11/image.png"><img style="display:inline;border-width:0;" title="image" border="0" alt="image" src="http://davidburela.files.wordpress.com/2009/11/image_thumb.png?w=223&#038;h=244" width="223" height="244" /></a></p>
<p>In case you just want to see it working, I’ve included the demo I built live at the Melbourne Silverlight Desiginer &amp; Developer Network. Good luck!</p>
<p><a href="http://cid-fc3a2c38819e3e29.skydrive.live.com/self.aspx/Blog/VirtualEarthBindingDemo.zip">http://cid-fc3a2c38819e3e29.skydrive.live.com/self.aspx/Blog/VirtualEarthBindingDemo.zip</a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/davidburela.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/davidburela.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/davidburela.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/davidburela.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/davidburela.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/davidburela.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/davidburela.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/davidburela.wordpress.com/172/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/davidburela.wordpress.com/172/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/davidburela.wordpress.com/172/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=davidburela.wordpress.com&blog=428267&post=172&subd=davidburela&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://davidburela.wordpress.com/2009/11/02/databinding-shapes-with-the-bing-maps-control-for-silverlight/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/628722d2f281b09614aba4a038d64bd2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Burela</media:title>
		</media:content>

		<media:content url="http://davidburela.files.wordpress.com/2009/11/image_thumb.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>Is Google Chrome OS not going after windows at all?</title>
		<link>http://davidburela.wordpress.com/2009/07/12/is-google-chrome-os-not-going-after-windows-at-all/</link>
		<comments>http://davidburela.wordpress.com/2009/07/12/is-google-chrome-os-not-going-after-windows-at-all/#comments</comments>
		<pubDate>Sun, 12 Jul 2009 01:35:07 +0000</pubDate>
		<dc:creator>David Burela</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Google]]></category>
		<category><![CDATA[Google Chrome]]></category>
		<category><![CDATA[Google Chrome OS]]></category>
		<category><![CDATA[Microsoft]]></category>

		<guid isPermaLink="false">http://davidburela.wordpress.com/2009/07/12/is-google-chrome-os-not-going-after-windows-at-all/</guid>
		<description><![CDATA[There has been a lot of discussions over the new Google Chrome OS announcement lately. I just read this article Google&#8217;s Chrome OS: Maybe Not a &#34;PC&#34; OS After All and this paragraph caught my attention
“The OS that would drive such a system would require a lot of work beyond just hosting a browser on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=davidburela.wordpress.com&blog=428267&post=171&subd=davidburela&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>There has been a lot of discussions over the new Google Chrome OS announcement lately. I just read this article <a href="http://blogs.pcmag.com/miller/2009/07/googles_chrome_os_maybe_not_a.php">Google&#8217;s Chrome OS: Maybe Not a &quot;PC&quot; OS After All</a> and this paragraph caught my attention</p>
<p><em>“The OS that would drive such a system would require a lot of work beyond just hosting a browser on Linux, which may be why Google says it is a year or more away. That&#8217;s because many of the add-ons that we need to enable web sites to properly function would need to be moved from desktop applications to become a part of the OS. I&#8217;m talking about things such as media players, codecs and add-ons that support PDF and other file formats, Adobe Flash, or even Microsoft Silverlight.&#160; Google Gears, or whatever caching technology, also needs a lot of work.&quot;</em></p>
<p>That last sentence is what caught my eye. Now it is no secret that Google have been promoting HTML5 VERY strongly. There have been a number of articles on the web since the Google conference last month about how much they are promoting HTML5, and what their motives could be. Most of the articles come to the conclusion that in the end, will we even need plugins like flash or Silverlight.</p>
<p>Google have made it very clear that <em>“for application developers, the web is the platform”</em>, implying that you won’t be able to develop for the linux kernel it is running on top of.</p>
<p>If you tie Google’s push for HTML5 with the Chrome OS announcement, then maybe we are onto something. Perhaps they aren’t trying to displace windows at all, but instead increase the number of devices that support HTML5 and not Silverlight / Flash / Java. They could be aiming this announcement at web developers here. When web devs are thinking what platform they should create their new web app on, they may default to using HTML5 over Silverlight because of the additional reach HTML5 is going to give them.</p>
<p>So there is my angle, they aren’t targeting Microsoft at the desktop, but are instead trying to dislodge them from the web and stopping adoption of Silverlight.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/davidburela.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/davidburela.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/davidburela.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/davidburela.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/davidburela.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/davidburela.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/davidburela.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/davidburela.wordpress.com/171/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/davidburela.wordpress.com/171/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/davidburela.wordpress.com/171/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=davidburela.wordpress.com&blog=428267&post=171&subd=davidburela&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://davidburela.wordpress.com/2009/07/12/is-google-chrome-os-not-going-after-windows-at-all/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/628722d2f281b09614aba4a038d64bd2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Burela</media:title>
		</media:content>
	</item>
		<item>
		<title>Silverlight on iPhone a possibility?</title>
		<link>http://davidburela.wordpress.com/2009/02/03/silverlight-on-iphone-a-possibility/</link>
		<comments>http://davidburela.wordpress.com/2009/02/03/silverlight-on-iphone-a-possibility/#comments</comments>
		<pubDate>Tue, 03 Feb 2009 02:22:00 +0000</pubDate>
		<dc:creator>David Burela</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[iPhone]]></category>

		<guid isPermaLink="false">http://davidburela.wordpress.com/2009/02/03/silverlight-on-iphone-a-possibility/</guid>
		<description><![CDATA[I came across an article Adobe cooperates with Apple on Flash for iPhone , which suggests that Apple is now working with Adobe to provide flash on the iPhone. Now previously i’d heard that this wasn’t going to happen because the apple SDK doesn’t allow the creation of other “platforms” for the iPhone. But with [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=davidburela.wordpress.com&blog=428267&post=141&subd=davidburela&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I came across an article <a href="http://www.rlslog.net/adobe-coops-with-apple-on-flash-for-iphone/">Adobe cooperates with Apple on Flash for iPhone </a>, which suggests that Apple is now working with Adobe to provide flash on the iPhone. Now previously i’d heard that this wasn’t going to happen because the apple SDK doesn’t allow the creation of other “platforms” for the iPhone. But with flash now being ported to it this now opens up the question “Could silverlight be seen on the iPhone in the future?”</p>
<p>Now there are 2 key differences between Flash &amp; Silverlight</p>
<ol>
<li>Apple got into trouble because “<em>Apple recently got into some hot water with the United Kingdom’s Advertising Standards Authority because of the iPhone’s inability to support the nearly ubiquitous Web technology. The company had been running advertisements that claimed the handset can access “all parts of the Internet,” but the agency said the ads were “misleading” because of the lack of Flash and Java support.</em>”<br />
As much as Microsoft tries to tell us that it is on 25% of computers, i don’t think that it could be seen as a critical thing needed to experience the web</li>
<li>Apple &amp; Microsoft cooperating… seriously</li>
</ol>
<p> </p>
<p>I’d love to see silverlight on the iPhone and who knows, with silverlight for mobiles being released for Nokias &amp; windows smart phones in the near future, it may just put enough pressure on Apple to collaborate with Microsoft to get Silverlight ported to the iPhone</p>
<p><strong>Update</strong>: There is an<a href="http://www.pcworld.com/article/158712/flash_on_iphone_hopes_dashed.html"> article here with more information</a>, although the title of it is misleading since the content contradicts its own title.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/davidburela.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/davidburela.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/davidburela.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/davidburela.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/davidburela.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/davidburela.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/davidburela.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/davidburela.wordpress.com/141/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/davidburela.wordpress.com/141/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/davidburela.wordpress.com/141/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=davidburela.wordpress.com&blog=428267&post=141&subd=davidburela&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://davidburela.wordpress.com/2009/02/03/silverlight-on-iphone-a-possibility/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/628722d2f281b09614aba4a038d64bd2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Burela</media:title>
		</media:content>
	</item>
		<item>
		<title>Silverlight hosted on Windows Azure</title>
		<link>http://davidburela.wordpress.com/2008/12/10/silverlight-hoste-on-windows-azure/</link>
		<comments>http://davidburela.wordpress.com/2008/12/10/silverlight-hoste-on-windows-azure/#comments</comments>
		<pubDate>Wed, 10 Dec 2008 07:41:36 +0000</pubDate>
		<dc:creator>David Burela</dc:creator>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[windows azure]]></category>

		<guid isPermaLink="false">http://davidburela.wordpress.com/?p=135</guid>
		<description><![CDATA[There have been a lot of hits to my blog for the search term &#8220;Silverlight Azure development&#8221;. So for anybody who is stuck at this first step of getting Silverlight hosted on Windows Azure.
I&#8217;ve included steps for creating a new Silverlight project, or adding an existing one.

Creating a new Silverlight project

Create a windows azure web [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=davidburela.wordpress.com&blog=428267&post=135&subd=davidburela&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>There have been a lot of hits to my blog for the search term &#8220;Silverlight Azure development&#8221;. So for anybody who is stuck at this first step of getting Silverlight hosted on Windows Azure.</p>
<p>I&#8217;ve included steps for creating a new Silverlight project, or adding an existing one.</p>
<p><span id="more-135"></span></p>
<h4>Creating a new Silverlight project</h4>
<ol>
<li>Create a windows azure web cloud project<br />
<a href="http://davidburela.files.wordpress.com/2008/12/image3.png"><img style="border-width:0;" src="http://davidburela.files.wordpress.com/2008/12/image-thumb3.png?w=244&#038;h=174" border="0" alt="image" width="244" height="174" /></a></li>
<li>Right click the solution in solution explorer and add a new project.<br />
<a href="http://davidburela.files.wordpress.com/2008/12/image4.png"><img style="border-width:0;" src="http://davidburela.files.wordpress.com/2008/12/image-thumb4.png?w=244&#038;h=134" border="0" alt="image" width="244" height="134" /></a></li>
<li>Add a new silverlight project<br />
<a href="http://davidburela.files.wordpress.com/2008/12/image5.png"><img style="border-width:0;" src="http://davidburela.files.wordpress.com/2008/12/image-thumb5.png?w=244&#038;h=157" border="0" alt="image" width="244" height="157" /></a></li>
<li>Then simply tell it to also add a refrence to our ASP.Net web role project.<br />
<a href="http://davidburela.files.wordpress.com/2008/12/image6.png"><img style="border-width:0;" src="http://davidburela.files.wordpress.com/2008/12/image-thumb6.png?w=244&#038;h=217" border="0" alt="image" width="244" height="217" /></a> </li>
</ol>
<h4>Adding an existing Silverlight project</h4>
<p>If you already have an existing Silverlight project that you have been working on and just want to get it hosted on Azure</p>
<ol>
<li>Add the project to the Azure solution</li>
<li>Right click the web role ASP.Net project and bring up the properties</li>
<li>Go to the silverlight application tab and click add<br />
<a href="http://davidburela.files.wordpress.com/2008/12/image7.png"><img style="border-width:0;" src="http://davidburela.files.wordpress.com/2008/12/image-thumb7.png?w=244&#038;h=133" border="0" alt="image" width="244" height="133" /></a></li>
<li>Select the Silverlight project<br />
<a href="http://davidburela.files.wordpress.com/2008/12/image8.png"><img style="border-width:0;" src="http://davidburela.files.wordpress.com/2008/12/image-thumb8.png?w=244&#038;h=201" border="0" alt="image" width="244" height="201" /></a></li>
<li>Done! It will even add a test page into the ASP.Net project for you.</li>
</ol>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/davidburela.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/davidburela.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/davidburela.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/davidburela.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/davidburela.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/davidburela.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/davidburela.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/davidburela.wordpress.com/135/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/davidburela.wordpress.com/135/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/davidburela.wordpress.com/135/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=davidburela.wordpress.com&blog=428267&post=135&subd=davidburela&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://davidburela.wordpress.com/2008/12/10/silverlight-hoste-on-windows-azure/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/628722d2f281b09614aba4a038d64bd2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Burela</media:title>
		</media:content>

		<media:content url="http://davidburela.files.wordpress.com/2008/12/image-thumb3.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://davidburela.files.wordpress.com/2008/12/image-thumb4.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://davidburela.files.wordpress.com/2008/12/image-thumb5.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://davidburela.files.wordpress.com/2008/12/image-thumb6.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://davidburela.files.wordpress.com/2008/12/image-thumb7.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>

		<media:content url="http://davidburela.files.wordpress.com/2008/12/image-thumb8.png" medium="image">
			<media:title type="html">image</media:title>
		</media:content>
	</item>
		<item>
		<title>My notes from PDC08 Day 2 keynote</title>
		<link>http://davidburela.wordpress.com/2008/10/29/my-notes-from-pdc-day-2-keynote/</link>
		<comments>http://davidburela.wordpress.com/2008/10/29/my-notes-from-pdc-day-2-keynote/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 23:32:07 +0000</pubDate>
		<dc:creator>David Burela</dc:creator>
				<category><![CDATA[Microsoft tech]]></category>
		<category><![CDATA[PDC]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Live]]></category>
		<category><![CDATA[live framework]]></category>
		<category><![CDATA[live mesh]]></category>
		<category><![CDATA[live services]]></category>
		<category><![CDATA[mesh]]></category>
		<category><![CDATA[Office 14]]></category>
		<category><![CDATA[PDC keynote]]></category>
		<category><![CDATA[visual studio 2010]]></category>
		<category><![CDATA[windows 7]]></category>
		<category><![CDATA[wpf]]></category>

		<guid isPermaLink="false">http://davidburela.wordpress.com/?p=68</guid>
		<description><![CDATA[As i mentioned, i&#8217;m going to post up all of my notes from the PDC sessions i watch.
Day 1 keynote was about the cloud
Day 2 is all about client technologies
Summary

Windows 7 &#8211; new UI features, improvements in performance (They demo win7 running on a tiny notepad with 1Gb of ram with ½ the ram still [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=davidburela.wordpress.com&blog=428267&post=68&subd=davidburela&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>As i mentioned, i&#8217;m going to post up all of my notes from the PDC sessions i watch.</p>
<p>Day 1 keynote was about the cloud<br />
Day 2 is all about client technologies</p>
<h4><strong>Summary</strong></h4>
<ul>
<li>Windows 7 &#8211; new UI features, improvements in performance (They demo win7 running on a tiny notepad with 1Gb of ram with ½ the ram still available!)</li>
<li>WPF Improvements &#8211; RibbonBar control, multitouch. New WPF toolkit released today with visual state manager!</li>
<li>Visual studio 2010 will be built on WPF</li>
<li>Visual studio &#8211; Web.config. Improvement to support set up debug/release/staging config files</li>
<li>Live Wave 3 – new “Live Framework” wraps around Live services</li>
<li>Live Mesh improvements &#8211; Adding support for win mobiles and Macintosh in the next update</li>
<li>Office 14 – Is now really integrated into the web with live editing of documents being synced. But now have a fully featured office web, works in IE/firefox and has ribbon bar, looks like same app</li>
</ul>
<p><span id="more-68"></span></p>
<p><strong>Keynote intro video</strong></p>
<p>Keeps showing a new logo of .Net + WPF</p>
<p>Flashing up HEAPS of pretty looking products that are currently using WPF. Roxio, Autocad, blocbuster, etc. nice looking vid clips. Funky music.</p>
<p><strong>Ray Ozzie comes on stage</strong></p>
<p>Talking about what “Personal computing” means. Email, presentation, docs, spreadsheets.</p>
<p>“Without a PC on your desk, what would you do all day?” LOL</p>
<p>As much as we all sit in front of a PC and connect to the net through a web browser. The PC and the web are very separated</p>
<p>How can the web increase the value of our PCs?</p>
<p>We’re all going to have PCs, phones and webs. So how to combine them all to add value.</p>
<p>PC apps are good for: usual rich client reasons. Makes sense to make that app close to the user. By using copy/paste and drag/drop, the users combine all of heir applications. Can manage privacy of files</p>
<p>Web apps are good for: lets us access the world, One common way to access people. The webs sustainable unique value ISN”T the web, it is the ability to enable us all to connect &amp; interact</p>
<p>Phone apps: same advantages as PC apps. Close to users. Always available for spontaneous access, knows your location, time, can quickly take photos/notes</p>
<p>Will advance PC apps in 2 ways: Always have the latest version of windows for us to dev against (Windows 7) &amp; the install base. Will continue to improve the programming model</p>
<p>Advance web: allowing you to create cross browser/platform sites with CSS/ajax. And silverlight. Making web apps installable, offlineable, syncable</p>
<p><strong>Steve Sinofsky comes on stage</strong></p>
<p>Going to show windows 7 and live wave 3 and the integration between the 2</p>
<p>Going to show:</p>
<ol>
<li>win7 client</li>
<li>Software &amp; services</li>
<li>Transition from windows vista</li>
<li>APIs</li>
<li>Fundamentals</li>
<li>Path to RTM!!!</li>
<li>Call to action</li>
</ol>
<p><strong>1. Win7</strong></p>
<p>New taskbar</p>
<p>Differnt looking taskbar. Apps are auto grouped into a tiny icon (vista app grouping). But can mouse over to see all the apps like the vista taskbar preview, but it expands out all the apps.</p>
<p>Kind of also gone a bit like OSx. How the apps can sit there not open. But you can click to launch. So combination of taskbar &amp; quicklaunch now.</p>
<p>Can FINALLY reogranise things in the taskbar!</p>
<p>Taking advantage of widescreen, can click and drag &amp; dock a window to be “1/2 full screen” so you can dock 2 apps at once.</p>
<p>“Libraries” the flexibility of folders, the power of search. Looks like a standard folder view. Library locations can be anywhere (USB, other drive, a share on another computer). The search box shows keywords, so you can still search but now has highlighting on the filenames.</p>
<p>Home networking</p>
<p>Connect to the wireless home network. You get a unique PIN. So you can access your other PCs, picture frames, etc. Can share resources on your PC simply (music, etc.)</p>
<p>Media player is now more lightweight (FINALLY) but you can use those same libraries.</p>
<p>Can rightclick on a song, and say “play on a device” to play the song on any device on your network!!! Same with videos, pictures. So you can send media to your picture frames</p>
<p>Device stage. All the device you can access, their capabilities are now all grouped here. (mobile phones, pringers, Zunes, etc.)</p>
<p>When you are at work it auto connects you to the work printer, when you get home it auto connects you back to your home printer</p>
<p>Helps to make your desktop clean, gadgets can now stick onto your desktop.</p>
<p>New customisation with your PCs colour scheme. Colouroful. Combination of background photo with a colour scheme. More customisation options with the glass effect</p>
<p>Has stopped the notification popups “you need new defender updates, etc.” now when you have those mini icons (near the clock), they auto go off into a mini tray to keep it all clean, but then you can say which ones you want to show. All of those notifications are now in an “action frame” so you can read all the messages at once</p>
<p>Showing touch multitouch</p>
<p>HP touchsmart in the market today. How they have “augmented” the experience with touch</p>
<p>Repowered ALL of the mouse commands with touch. So in office 2007, you can now scroll, zoom, etc. just like you can on surface</p>
<p>IE knows about the onscreen keyboard. Can browse around with gestures. Can flick the screen to go forward/back</p>
<p>In win7 folder view, can scroll through.</p>
<p>MSpaint has been upgraded with a new ribbon bar. Can draw in mspaint with multitouch</p>
<p>Official screenshots</p>
<p><a href="http://www.flickr.com/photos/31242879@N00/sets/72157608452379413/">http://www.flickr.com/photos/31242879@N00/sets/72157608452379413/</a></p>
<p><strong>2. Software &amp; Services</strong></p>
<p>Core of windows connects to services. Windows update, etc.</p>
<p>Windows live essentials. Optional/downloadable. Can connect to your own services, or use the live services (e.g. IMAP/POP or hotmail)</p>
<p>Nothing was really said except that more will be shared</p>
<p><strong>3. Transition from vista</strong></p>
<p>They got “LOTS of feedback from people about Vista RTM…………” from blogs and ‘some commercials….’ LOL</p>
<p>Vista SP1 brings it to a level that ppl can use</p>
<p>Readiness of the ecosystem. 95% of computers can now get drivers for vista.</p>
<p>Developers have been asking for “standards”. IE8 implements CSS, acid tests, etc. and released the testing framework they used to help other browsers.</p>
<p>Wordpad can use OpenXML and umm that other one.</p>
<p>UAC……. Yeah. How to help protect people from themselves. Said that they went too far with developers. But despite this, most apps now work well in standard user mode.</p>
<p>Home networking is much nicer. Sharing within a home. Realise that only hardcore people could really setup sharing. When you connect to your home, connect to the PCs, devices. When you are at work, realise you probably don’t want to share your music.</p>
<p>Have been sharing their experiences on the engineering 7 blog (I’ve been enjoying it)</p>
<p><strong>4. APIs</strong></p>
<p>Ribbon UI</p>
<p>Jump lists  (the right click thing on the taskbar)</p>
<p>Libraries (as in the new folder library search thing. To bring in files from multiple computers)</p>
<p>Multi touch, speech</p>
<p>DirectX</p>
<p>Future products with mail, etc. will help bring forward Jumplists and Libraries</p>
<p>They have a massive 42” LCD with multitouch in the conference hall to do collaboration, so that on win7 allows one experience. But there is still the surface</p>
<p>DirectX is been for games. In win7 have extended it to 2D and ‘fine looking text’. It is now the “Modern view of GDI”</p>
<p>Shows a video of Autodesk and how they use touch stuff.</p>
<p>Showing a 3D app (Mud box) which has a lizard in 3D. He is manipulating the model directly through touch. Can still zoom in, pan etc.</p>
<p>Well he says that it is a “more natural and intuitive interface” I don’t agree personally… looks awkward IMHO</p>
<p><strong>5. Fundamentals</strong></p>
<p><span style="text-decoration:underline;">Decreased</span></p>
<ul>
<li>Memory &#8211; Decreased the core footprint of a core vista install. Don’t need to turn graphics stuff off to get a bit more performance.</li>
<li>Disk I/O  &#8211; registry and indexer</li>
<li>Power -DVD playback(I/O subsystem rejigged to get longer use), panel, timers(redone to take up less power!)</li>
</ul>
<p><span style="text-decoration:underline;">Increased</span></p>
<ul>
<li>Speed -faster boot</li>
<li>Responsiveness –taskbar. Using less locks and semaphores</li>
<li>Scale &#8211; now supports up to 256 processors</li>
</ul>
<p>Shows how a tiny netbook (about the size of an eeepc). Has 1gb of ram. Win win7 boots up, half the ram is still free for use. And this is the current build, plan to drive that down</p>
<p>USB memory sticks. He loses them all the time. Can now use bitlocker on your USB sticks. When you insert a USB stick it will ask for a password. Can use group management to say how ppl can use USB sticks</p>
<p>VHDs. Can now natively mount VHDs. Can create &amp; create a VHD directly in the drive manager</p>
<p>Can boot directly from a windows 7 VHD natively! So when you are developing you can keep on mounting and booting from a VHD and have it rollback for you if you like.</p>
<p>High DPI monitor. Much easier to set/work with it.</p>
<p>Managing multiple monitors. Can now set landscape, orientation, etc.</p>
<p>Improved magnifier…. Can press the start button and ‘+’. Is like a native built in zoomit. Ok it is kind of cool</p>
<p>New ways to connect to external projectors. Hold window key. And hit P. and you can now quickly change to do “Clone”, “display diff on each screen”, etc.</p>
<p>Enhanced remote desktop. If you remote into a computer with dual monitors, it will now support multi monitor and display it on both PCs</p>
<p>LOL can now customise the shutdown buttons default option</p>
<p>Can turn messages off for firewall, UAC, etc.</p>
<p>New UAC control panel. Can now slide to set what level of UAC prompts you want to see.</p>
<p><strong>6. Path to RTM</strong></p>
<p>Prebeta released to PDC attendees.</p>
<p>Beta will be released early next year through MSDN</p>
<p>Beta will have a feedback tool. Whenever you get frustrated win win7, double click and it will take the context of where you are and you can comment on. “Focus isn’t working, etc”</p>
<p>Customer experience improvement program. They look at all the data, resource consumption, do things crash etc. (and they talk about it on the Engineering 7 blog if you haven’t read that yet)</p>
<p>If you just use win7 with the experience improvement collection turned on. That is helping them heaps</p>
<p>“3 years from the general availability of Vista”</p>
<p><strong>7. Call to action</strong></p>
<ul>
<li>Install and use win7 pre-beta</li>
<li>Develop for 64-bit  </li>
<li>Integrate with win desktop (jumplists/libraries)</li>
<li>Eval the new APIs</li>
<li>Code to standards with IE8</li>
<li>Download win live beta from download.live.com (windows live essentials)</li>
</ul>
<p><strong>Scott Guthrie comes on stage</strong></p>
<p>How can developers take advantage of this.</p>
<p>Can access ribbon, multitouch, search etc. in C++/MFC (pffft anyone still uses that)</p>
<p>Multi core helpers.</p>
<p>.Net .5 SP1 is built into Win7 (40% cold start time improvement on most .net apps)</p>
<p>Streamlining the processs of getting .net onto PCs that don’t have it (is this really relevant anymore? What winPC doesn’t have it)</p>
<p>He jumps into some code</p>
<p>Showing a WPF app which is a photo viewer (he will release the source code in a few weeks)</p>
<p>It is just a standard WPF app, so he now wants to add win7 features</p>
<p>Mainpage.xaml wants to add ribbon by using the new WPFRibbon. Does this by changes &lt;Window&gt; to &lt;WPF:PageRibbon&gt; or something like that</p>
<p>Then adds a &lt;WPF:RibbonGroup&gt; section.</p>
<p>Now has a basic ribbon, with back/forward buttons. Hmm that was easy</p>
<p>Can get the ribbon contextualisation. So get extra tabs to show up when doing something</p>
<p>The ribbonbar is affected by system customisation settings (colour scheme, etc.)</p>
<p>Can add jumplists. So now when he rightclicks the app in the taskbar, gets options to “start a slideshow, etc.”</p>
<p>Can get multitouch stuff into your WPF app. Gestures, etc.</p>
<p>Can do pixel effects on everything easily, so when you click can get an effect like you touch water happening.</p>
<p>Releasing a new WPF toolkit today</p>
<ul>
<li>Datagrid</li>
<li>Datepicker</li>
<li>Calendar</li>
<li>Ribbon</li>
<li>And VISUAL STATE MANAGER!!!</li>
</ul>
<p><strong>.Net 4.0</strong></p>
<p>WPF impreovements in multitouch, deepzoom</p>
<p>Can have clr 2.0 and 4.0 in the same address space</p>
<p>New component model. Managed extensibility framework?</p>
<p>Can dynamically add extensions. Like silverlight apps in clients. (huh I missed this)</p>
<p>Better databinding improvements</p>
<p><strong>VS2010</strong></p>
<p>Visual studio 2010 will be built on WPF</p>
<p>Multi monitor support</p>
<p>Better Test Driven Development experience</p>
<p>Can use the extensibility stuff to add extra functionality into VS2010</p>
<p>He is now going to demo how to build one of these extensibilities.</p>
<p>Can now add new features into the editior.</p>
<p>Going to show how to visualise comments better (showing a standard source file with XML comments everywhere)</p>
<p>The code will go and look over the sourcecode and look for comments. Can now visualise it differently</p>
<p>To register with VS, need to add a new export attribute (text is too small for me to read it)</p>
<p>Then you just drag the .dll into the VS2010 plugin folder</p>
<p>Then no need to restart VS2010, it is now showing the source code in a much nicer way!</p>
<p>OOOH nice, another extensibility thing. He clicks on the bug ID in the source code, and a popup connects to his bug tracker and brings up the details for that bug</p>
<p>Managed extensibility framework will be part of .Net so you can let people extend your own apps this easily.</p>
<p><strong>Some guy from tesco.com on stage</strong></p>
<p>Tesco is the worlds LARGEST grocery shop</p>
<p>Need to make shopping experience better.</p>
<p>They start with a gadget. Gadget shows how many days until your delivery arrives.</p>
<p>Click gadget to launch it. It is now a family calendar and message board</p>
<p>With the calendar they are going to do “meal planning”. Add some meals, then auto adds the ingredients required into the shopping basket</p>
<p>Can browse through recipes, videos of how to cook it. List of ingredients, can click and drag the ingredients you require into basket.</p>
<p>Products you can buy have the nutritional values on it</p>
<p>Hah, he grabs a product that he wants some more of, uses the webcan to screencap the barcode and auto searches and finds it.</p>
<p><strong>Scott back on stage</strong></p>
<p>Going to update web stuff with IE8</p>
<p>Shipped better ASP.Net stuff in SP1 (dynamic data, REST, etc.)</p>
<p>MVC going to be released in a few months</p>
<p>Adding jquery support in Visual studio 2008. With intellisense can download it today from jquery website <a href="http://weblogs.asp.net/mikaelsoderstrom/archive/2008/10/27/intellisense-f-246-r-jquery-sl-228-ppt.aspx">http://weblogs.asp.net/mikaelsoderstrom/archive/2008/10/27/intellisense-f-246-r-jquery-sl-228-ppt.aspx</a></p>
<p>ASP.Net 4.0 imprevements</p>
<p>MVC</p>
<p>AJAX</p>
<p>Distributed caching (shipping a new CTP this week)</p>
<p>Javascript, etc.</p>
<p>Web.config. can now setup debug/release/staging etc. and have rightclick support. And deployment improvements</p>
<p><strong>Silverlight 2</strong></p>
<p>Lots of ppl are using it… yay usual marketing stuff</p>
<p>Silverlight toolkit is being released today</p>
<p>Charting is being included. oooh</p>
<p>VS2010 will have a fully improved Silverlight designer. WYSIWYG editor</p>
<p>Just teased they are going to show how to use silverlight OUTSIDE the browser</p>
<p>Graphic and data support improvements coming</p>
<p><strong>David Treadwell comes on stage (about 1hour 40mins in)</strong></p>
<p>He is going to talk about live services. And that they wit in top of Azure</p>
<p>Live services allow identity management</p>
<p>Allows 3<sup>rd</sup> parties to use the login</p>
<p>Customisation of thee LiveID login screen</p>
<p>Active directory integration</p>
<p>LiveID as an OpenID provider</p>
<p>Hook into the ‘social graph’ of each person. You can now leverage this</p>
<p>Can integrate windows live messenger features into your own website</p>
<p>Geospatial features can be integrated</p>
<p>Uses interoperable standard protocols</p>
<p><em>11% of total internet minutes are spent on live services</em></p>
<p>Talking about connectivity between devices.</p>
<p>Want to make it easy to integrate client apps with what happens on the web.</p>
<p>Want to make it easy to connect with people</p>
<p>Anywhere/anytime access to data.</p>
<p>This is why we have live mesh</p>
<p>Live mesh is: Users, devices, applications, data sync</p>
<p>Can be used to help support S+S applications</p>
<p>He is now announcing the “Live Framework” wraps around Live services</p>
<p>Works on PC/Phone/Web</p>
<p><strong>Ori Amiga comes on stage</strong></p>
<p>Showing how to connect into Live framework into a windows app.</p>
<p>Going to add 3 new functionalities.</p>
<p>Going to let it easily access all of his data</p>
<p>Then allow it to synchronise the user settings across mesh</p>
<p>Then tap into the social graph</p>
<p>First he just enumerates his folders in his live mesh by using a foreach(var m in livefx.Mesh.Meshobjects.Folders)</p>
<p>Now all his foldrs are being shown.</p>
<p>Can do a foreah to get all devices Foreach( in  livefx.mesh.devices.entries)</p>
<p>Is now using LINQ to get stuff out of live services</p>
<p>Gee that was REALLY easy</p>
<p>Now he has the app running on 2 PCs. And using mesh synch, is sharing data with the user on the other PC</p>
<p>He updated a photo and saw it get updated automatically on the other PC.</p>
<p>He took a photo on his mobile phone, the phone synced it back to his mesh. Which then went and updated his friend’s pc and was auto displayed in the application live</p>
<p><strong>Ori leaves and Anthony Rose comes on stage</strong></p>
<p>How to enable Live framework in a web app.</p>
<p>Going to update the BBC iPlayer</p>
<p>Shows a silverlight app running locally</p>
<p>WTF He just glossed over it. Just double clicked on a desktop icon to launch it.</p>
<p>Can use the app to sync media from the BBC mesh into your folder that you want across which devices you want.</p>
<p>Since it hooks into your social graph. He is on the website, can see that all of his friends have been watching a certain show. Kind of like facebook what have ppl been doing. But just auto there because they are in your social graph (msn contact list)</p>
<p>Seamless connectivity. He was watching a show on the PC, he walked off and started using his phone, but since it was automatically synced to his device, he was able to continue playing from where he left off.</p>
<p>Live framework ctp released (should be on <a href="http://www.azure.com">www.azure.com</a> )</p>
<p>Adding support for win mobiles and macintosh in the next update</p>
<p><strong>Takeshi Numoto on stage to talk about office 14</strong></p>
<p><a href="http://www.winsupersite.com/office/office14_web_preview.asp">http://www.winsupersite.com/office/office14_web_preview.asp</a></p>
<p>people want to share and collaborate on documents</p>
<p>announcing office web applications. Works in IE/firefox. If silverlight is installed has a nice rich UI</p>
<p>people can now view edit and collaborate directly in the browser for: word, excel, powerpoint, onenote</p>
<p>Onenote 14 demo</p>
<p>Notebook sharing, he has it open in office 14. The other guy has it open in a web browser. Like a live wiki update. That was very cool</p>
<p>One note mobile now syncs to office live.</p>
<p>Word 14 demo</p>
<p>2 people are editing a document independently. You are getting presence info about where the other person is updating the document, can click to IM them.</p>
<p>Can click to accept their changes and sync it in as you are editing.</p>
<p>Can open and edit fully online</p>
<p>Excel 14 demo</p>
<p>Using the web stuff. Opens it in IE and firefox and looks the same</p>
<p>Have the ribbons, etc. looks the same as the desktop app</p>
<p>2 people are looking at excel and as they are editing, is updating the other guys straight away.</p>
<p>Clicks publish, to publish the graph straight into windows live spaces</p>
<p>The graph is on windows live spaces, but still linked to the excel doc. So he updates the excel doc, clicks save. And the graph is updated next time it is loaded. nice</p>
<p><strong>Ray Ozzie back on stage and closes the keynote</strong></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/davidburela.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/davidburela.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/davidburela.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/davidburela.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/davidburela.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/davidburela.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/davidburela.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/davidburela.wordpress.com/68/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/davidburela.wordpress.com/68/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/davidburela.wordpress.com/68/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=davidburela.wordpress.com&blog=428267&post=68&subd=davidburela&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://davidburela.wordpress.com/2008/10/29/my-notes-from-pdc-day-2-keynote/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/628722d2f281b09614aba4a038d64bd2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Burela</media:title>
		</media:content>
	</item>
		<item>
		<title>Silverlight MVVM + dependency injection</title>
		<link>http://davidburela.wordpress.com/2008/10/19/silverlight-mvvm-dependency-injection/</link>
		<comments>http://davidburela.wordpress.com/2008/10/19/silverlight-mvvm-dependency-injection/#comments</comments>
		<pubDate>Sun, 19 Oct 2008 05:28:20 +0000</pubDate>
		<dc:creator>David Burela</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[dependency injection]]></category>
		<category><![CDATA[DI]]></category>
		<category><![CDATA[Model/View/ViewModel]]></category>
		<category><![CDATA[MVVM]]></category>
		<category><![CDATA[Ninject]]></category>

		<guid isPermaLink="false">http://davidburela.wordpress.com/?p=51</guid>
		<description><![CDATA[Update 2009/03/04: Here are 2 links that may help you with your understanding of MVVM
first 2 videos about implementing MVVM, one in WPF and the other in Silverlight http://weblogs.asp.net/craigshoemaker/archive/2009/02/26/hands-on-model-view-viewmodel-mvvm-for-silverlight-and-wpf.aspx and an article that delves into creating a fully functional app http://www.codeproject.com/KB/smart/Sonic.aspx
 
I attended a talk Jonas did last week on MVVM and it got me excited enough to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=davidburela.wordpress.com&blog=428267&post=51&subd=davidburela&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>Update 2009/03/04</strong>: Here are 2 links that may help you with your understanding of MVVM</p>
<p>first 2 videos about implementing MVVM, one in WPF and the other in Silverlight <a href="http://weblogs.asp.net/craigshoemaker/archive/2009/02/26/hands-on-model-view-viewmodel-mvvm-for-silverlight-and-wpf.aspx">http://weblogs.asp.net/craigshoemaker/archive/2009/02/26/hands-on-model-view-viewmodel-mvvm-for-silverlight-and-wpf.aspx</a> and an article that delves into creating a fully functional app <a href="http://www.codeproject.com/KB/smart/Sonic.aspx">http://www.codeproject.com/KB/smart/Sonic.aspx</a></p>
<p> </p>
<p>I attended a talk Jonas did last week on MVVM and it got me excited enough to explore it myself. His blog has a wealth of information, and it has all been summarised in his <a href="http://jonas.follesoe.no/UpdatedSamplesAndSomeNuggetsFromTheArchive.aspx">latest post</a>. By reading his blog and many other bits and pieces around the web i was able to get this working myself. I&#8217;m going to put it all together into one blog post to give a complete look at how to incorporate all of it together. <strong>I aim to show how it all hooks in together</strong> and not just show a diagram saying that you should split things out.</p>
<p>Presumably you already have an idea of what Model/View/ViewModel is. The background and reasoning behind it is beyond the scope of this article, but here <a href="http://blogs.msdn.com/johngossman/archive/2005/10/09/478894.aspx">is an article I recommend</a>. And also all of Jonas&#8217;s articles. But basically MVVM + Dependency injection allows your applications to be loosely coupled with the GREAT advantage that all of your code can now be unit tested, since the UI is just databinding to your classes.</p>
<h3>Architecture</h3>
<p><a href="http://davidburela.files.wordpress.com/2008/10/mvvm.png"><img style="border-width:0;" src="http://davidburela.files.wordpress.com/2008/10/mvvm-thumb.png?w=260&#038;h=167" border="0" alt="MVVM" width="260" height="167" /></a></p>
<p>The application is going to look like the diagram. It will be split up into the usual Model/View/ViewModel components, but I aim to show all of the supporting code that is needed to get it all working.</p>
<p>The application will be a HR system which just show a list of all the employees. I am just going to implement this single method to try and keep this example as simple as possible</p>
<p><span id="more-51"></span></p>
<h4>View</h4>
<p>Page.Xaml. This is a normal silverlight XAML page with our UI components. However we are going to get it databind to our ViewModel and have it auto refresh itself when the data changes rather than doing this by ourselves manually</p>
<h4>Model</h4>
<p>This is our underlying data that we want to our application to somehow show. Here it will be our HR system. This worries about how to retrieve/add/modify the data.</p>
<h4>ViewModel</h4>
<p>This sits between the Model and the View. The point of this is to give a specific &#8216;View and state&#8217; of our Model  to the view. The View just wants to display data, it doesn&#8217;t want to care about how to retrieve things, so the ViewModel handles all of this for us.</p>
<h3>Dependency Injection</h3>
<p>Rather than hard coding all of the connections between the Model, View &amp; ViewModel. We can use &#8216;Dependency Injection&#8217; to insert the class for us. This allows us to be able to use other classes when unit testing, or at designtime vs. runtime.</p>
<p>We will use DI to connect the ViewModel to the View(Page). And to connect the Model to our ViewModel. I have created a few versions of the model which we can swap around.</p>
<h3>Implementation</h3>
<h5>Employee</h5>
<p>Just a simple class that contains age/name/etc.</p>
<div>
<pre style="line-height:12pt;background-color:#f4f4f4;width:100%;font-family:consolas, 'Courier New', courier, monospace;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> Employee
{
    <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">int</span> Id { get; set; }
    <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">string</span> Name { get; set; }
    <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">string</span> Occupation { get; set; }
    <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">int</span> Age { get; set; }
}</pre>
</div>
<h4>IHRSystem</h4>
<p>We are programming against an interface, this way we can swap the class that does the actual work.</p>
<div>
<pre style="line-height:12pt;background-color:#f4f4f4;width:100%;font-family:consolas, 'Courier New', courier, monospace;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">interface</span> IHRSystem
{
    ObservableCollection&lt;Employee&gt; GetEmployees();
}</pre>
</div>
<p>This is going to be implemented 3 times as:</p>
<ul>
<li>HRSystemSQL</li>
<li>HRSystemMemory</li>
<li>MockHRSystem</li>
</ul>
<p>They all should be self explanatory. But HRSystemSQL retrieves the results from a SQL database. HRSystemMemory gets it from a list in memory. And MockHRSystem is used for sending through precanned data for testing purposes or for our designtime experience.</p>
<p>So we can see that we can switch out the actual implementation of our Model and it will still work as we are programming against an interface. We don&#8217;t care if we are retriving from a database, or from a webservice, etc.</p>
<p>Here is the implementation of the mock class that will be used to display data for us at design time in blend, or when we are running unit tests</p>
<div>
<pre style="line-height:12pt;background-color:#f4f4f4;width:100%;font-family:consolas, 'Courier New', courier, monospace;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> MockHRSystem : IHRSystem
{
    <span style="color:#0000ff;">public</span> ObservableCollection&lt;Employee&gt; GetEmployees()
    {
        <span style="color:#0000ff;">return</span> <span style="color:#0000ff;">new</span> ObservableCollection&lt;Employee&gt;{ <span style="color:#0000ff;">new</span> Employee{Id=1, Name=<span style="color:#006080;">"John Smith"</span>, Age=31, Occupation=<span style="color:#006080;">"IT Manager"</span>},
            <span style="color:#0000ff;">new</span> Employee{Id=2, Name=<span style="color:#006080;">"Jane Smith"</span>, Age=43, Occupation=<span style="color:#006080;">"Help desk"</span>}};
    }
}</pre>
</div>
<h4>PageViewModel</h4>
<p>The this is the &#8216;ViewModel&#8217; for Page.Xaml, hence the name <strong>Page</strong>ViewModel&#8230; This needs to do 3 things.</p>
<ol>
<li>Expose as properties the data that we want the view to databind against</li>
<li>Have the constructor setup to pass in the implementation of the model class that we want to use (by using dependency injection)</li>
<li>make our properties raise PropertyChanged events to tell the View to update when the data changes</li>
</ol>
<div>
<pre style="line-height:12pt;background-color:#f4f4f4;width:100%;font-family:consolas, 'Courier New', courier, monospace;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> PageViewModel : INotifyPropertyChanged
{
    <span style="color:#0000ff;">private</span> IHRSystem hrSystem; <span style="color:#008000;">//Where do we get the data from?</span>

    <span style="color:#0000ff;">private</span> ObservableCollection&lt;Employee&gt; employees;   <span style="color:#008000;">//The data we are holding so that the View can be databound</span>
    <span style="color:#0000ff;">public</span> ObservableCollection&lt;Employee&gt; Employees     <span style="color:#008000;">//It is exposed as a property that fires property changed events</span>
    {
        get{<span style="color:#0000ff;">return</span> employees;}
        set
        {
            <span style="color:#0000ff;">if</span> (<span style="color:#0000ff;">value</span> != employees)
            {
                employees = <span style="color:#0000ff;">value</span>;
                RaisePropertyChanged(<span style="color:#006080;">"Employees"</span>);
            }
        }
    }

    <span style="color:#008000;">//Using dependency injection to tell us which implementation of the model we are using</span>
    [Inject]
    <span style="color:#0000ff;">public</span> PageViewModel(IHRSystem HRSystem)
    {
        hrSystem = HRSystem;
        employees = hrSystem.GetEmployees();
    }

    <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">event</span> PropertyChangedEventHandler PropertyChanged;
    <span style="color:#008000;">//Raise events when our data changes so that the view knows to update itself.</span>
    <span style="color:#0000ff;">protected</span> <span style="color:#0000ff;">void</span> RaisePropertyChanged(<span style="color:#0000ff;">string</span> propertyName)
    {
        PropertyChangedEventHandler propertyChanged = <span style="color:#0000ff;">this</span>.PropertyChanged;
        <span style="color:#0000ff;">if</span> (propertyChanged != <span style="color:#0000ff;">null</span>)
        {
            propertyChanged(<span style="color:#0000ff;">this</span>, <span style="color:#0000ff;">new</span> PropertyChangedEventArgs(propertyName));
        }
    }
}</pre>
</div>
<h4>MVVMTestModule</h4>
<p>We&#8217;re done with most of the code required to actually get the data that we want. Now we need to say how to wire it all up, since we haven&#8217;t used any code in the code behind files. First we are going to define how the dependency injection is setup in the application. I am using Ninject to handle this, so it will look like this</p>
<div>
<pre style="line-height:12pt;background-color:#f4f4f4;width:100%;font-family:consolas, 'Courier New', courier, monospace;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> MVVMTestModule : StandardModule
{

    <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">override</span> <span style="color:#0000ff;">void</span> Load()
    {
        <span style="color:#0000ff;">bool</span> isBrowser = HtmlPage.IsEnabled;
        <span style="color:#0000ff;">bool</span> isBlend = !isBrowser;

        Bind&lt;IHRSystem&gt;().To&lt;HRSystemMemory&gt;().OnlyIf(c =&gt; (isBrowser));
        Bind&lt;IHRSystem&gt;().To&lt;MockHRSystem&gt;().OnlyIf(c =&gt; (isBlend));

        Bind&lt;PageViewModel&gt;().ToSelf();
    }
}</pre>
</div>
<p>To simplify things, I&#8217;m avoiding using the SQL implementation and will just be holding a list in memory by using the HRSystemMemory implementation.</p>
<h4>ServiceLocator</h4>
<p>We are using dependency injection, but we still need to tell silverlight once where to look for the class that will handle all of the dependency injection niceness for us. Jonas does a great job explaining why we have one, but here is what we will use in this example</p>
<p>Silverlight is now able to get Ninject to pass to us our new PageViewModelClass that has been setup with the correct Model being passed in (Mock or a proper implementation) based on if we are in blend or running the app.</p>
<div>
<pre style="line-height:12pt;background-color:#f4f4f4;width:100%;font-family:consolas, 'Courier New', courier, monospace;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">public</span> <span style="color:#0000ff;">class</span> ServiceLocator
{
    <span style="color:#0000ff;">private</span> <span style="color:#0000ff;">static</span> IKernel kernel;

    <span style="color:#0000ff;">public</span> PageViewModel PageViewModel
    {
        get{<span style="color:#0000ff;">return</span> kernel.Get&lt;PageViewModel&gt;();}
    }

    <span style="color:#0000ff;">public</span> <span style="color:#0000ff;">static</span> T Get&lt;T&gt;()
    {
        <span style="color:#0000ff;">return</span> kernel.Get&lt;T&gt;();
    }

    <span style="color:#0000ff;">static</span> ServiceLocator()
    {
        <span style="color:#0000ff;">if</span> (kernel == <span style="color:#0000ff;">null</span>)
        {
            kernel = <span style="color:#0000ff;">new</span> StandardKernel(<span style="color:#0000ff;">new</span> MVVMTestModule());
        }
    }
}</pre>
</div>
<h4>App.Xaml</h4>
<p>The ServiceLocator class we just created, we need to set it up as an application wide resource, so that any part of our application can access the DI framework.</p>
<div>
<pre style="line-height:12pt;background-color:#f4f4f4;width:100%;font-family:consolas, 'Courier New', courier, monospace;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Application</span> ....
         <span style="color:#ff0000;">xmlns:MVVMTest</span><span style="color:#0000ff;">="clr-namespace:SilverlightMVVMTest1"</span><span style="color:#0000ff;">&gt;</span>
    <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Application.Resources</span><span style="color:#0000ff;">&gt;</span>
        <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">MVVMTest:ServiceLocator</span> <span style="color:#ff0000;">x:Key</span><span style="color:#0000ff;">="serviceLocator"</span><span style="color:#0000ff;">/&gt;</span>
    <span style="color:#0000ff;">&lt;/</span><span style="color:#800000;">Application.Resources</span><span style="color:#0000ff;">&gt;</span></pre>
</div>
<h4>Page.Xaml</h4>
<p>Finally we are at the end!</p>
<p>Create our View using a ListBox to display our List of data. Format it how we like with a datatemplate. but now we bind our entire view to our <strong>Page</strong>ViewModel class and have the UI display it for us.</p>
<div>
<pre style="line-height:12pt;background-color:#f4f4f4;width:100%;font-family:consolas, 'Courier New', courier, monospace;color:black;font-size:8pt;overflow:visible;border-style:none;margin:0;padding:0;"><span style="color:#0000ff;">&lt;</span><span style="color:#800000;">UserControl</span> ...
    <span style="color:#ff0000;">DataContext</span><span style="color:#0000ff;">="{Binding Path=PageViewModel, Source={StaticResource serviceLocator}}"</span><span style="color:#0000ff;">&gt;</span>
    <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">Grid</span> <span style="color:#ff0000;">x:Name</span><span style="color:#0000ff;">="LayoutRoot"</span> <span style="color:#ff0000;">Background</span><span style="color:#0000ff;">="White"</span><span style="color:#0000ff;">&gt;</span>
        <span style="color:#0000ff;">&lt;</span><span style="color:#800000;">ListBox</span> <span style="color:#ff0000;">ItemsSource</span><span style="color:#0000ff;">="{Binding Path=Employees}"</span><span style="color:#0000ff;">&gt;</span></pre>
</div>
<h3>Further work</h3>
<p>This was just a quick rundown on how to create a complete MVVM application that is fully testable. New concepts weren&#8217;t meant to be introduced here, just showing how it all works together. As shown in the initial diagram, converters can be used to do more complex mappings between the ViewModel and the View. We still haven&#8217;t said how to send events through (like clicking on a button to refresh the data, or adding new data). If there is enough interest, I&#8217;ll tie that into this example in another blog post</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/davidburela.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/davidburela.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/davidburela.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/davidburela.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/davidburela.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/davidburela.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/davidburela.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/davidburela.wordpress.com/51/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/davidburela.wordpress.com/51/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/davidburela.wordpress.com/51/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=davidburela.wordpress.com&blog=428267&post=51&subd=davidburela&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://davidburela.wordpress.com/2008/10/19/silverlight-mvvm-dependency-injection/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/628722d2f281b09614aba4a038d64bd2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Burela</media:title>
		</media:content>

		<media:content url="http://davidburela.files.wordpress.com/2008/10/mvvm-thumb.png" medium="image">
			<media:title type="html">MVVM</media:title>
		</media:content>
	</item>
	</channel>
</rss>