<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom">
  <title>Brian Noyes' Blog</title>
  <link rel="alternate" type="text/html" href="http://briannoyes.net/" />
  <link rel="self" href="http://briannoyes.net/SyndicationService.asmx/GetAtom" />
  <icon>favicon.ico</icon>
  <updated>2013-06-05T16:06:50.1721503+00:00</updated>
  <author>
    <name>Brian Noyes</name>
  </author>
  <subtitle>.NET Ramblings</subtitle>
  <id>http://briannoyes.net/</id>
  <generator uri="http://dasblog.info/" version="2.3.12105.0">DasBlog</generator>
  <entry>
    <title>TechEd Talks Done!</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2013/06/05/TechEdTalksDone.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,97b68b21-8059-44ce-b86a-6c1155152c90.aspx</id>
    <published>2013-06-05T16:06:50.1721503+00:00</published>
    <updated>2013-06-05T16:06:50.1721503+00:00</updated>
    <author>
      <name>Brian Noyes</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’ve completed <a href="http://channel9.msdn.com/Events/TechEd/NorthAmerica/2013?sort=sequential&amp;direction=desc&amp;term=&amp;s=Brian-Noyes#fbid=jIwOu6cRBsm" target="_blank">my
talks for TechEd US</a>, which I will also be repeating at TechEd EU in Madrid in
a couple of weeks. Turn out was pretty good, but overall interest in building WinRT
/ Windows Store apps is still slow. 
</p>
        <p>
The slides and video for my talk yesterday on Building Windows Store Line of Business
apps (with <a href="http://prismwindowsruntime.codeplex.com/" target="_blank">Prism
for Windows Runtime</a>) has already posted, the ones for my talk today on Navigation
in Window Store Apps should post at end of today.
</p>
        <p>
All the demos in my Prism talk were done from the sample code that comes with Prism,
so you can just download the <a href="http://code.msdn.microsoft.com/windowsapps/Prism-for-the-Windows-86b8fb72" target="_blank">main
code for Prism here</a>, and download the <a href="http://prismwindowsruntime.codeplex.com/releases" target="_blank">Quickstarts
here</a>, and you will have all the code I showed.
</p>
        <p>
Today’s navigation session I put together a simple app with some navigation from scratch,
so I wanted to make that code available to anyone who wants it as well, so you can <a href="https://dl.dropboxusercontent.com/u/7366831/downloads/TechEd/XAmlNavDemo.zip" target="_blank">download
that from here</a>.
</p>
        <p>
Enjoy, and let me know if you have any questions, here in the comments or on twitter
@briannoyes. Make sure to check out my Pluralsight course “<a href="http://pluralsight.com/training/Courses/TableOfContents/building-windows-store-business-applications-prism" target="_blank">Building
Windows Store Business Apps with Prism</a>” as well as my article series “<a href="http://tinyurl.com/prismrtseries" target="_blank">WinRT
Business Apps with Prism</a>”.
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=97b68b21-8059-44ce-b86a-6c1155152c90" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Awesome new Prism for Windows Runtime resource  - Project and item templates!</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2013/05/24/AwesomeNewPrismForWindowsRuntimeResourceProjectAndItemTemplates.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,aa37439d-6a59-4e74-a809-faf313cea630.aspx</id>
    <published>2013-05-24T17:49:59.7752922+00:00</published>
    <updated>2013-05-24T17:49:59.7752922+00:00</updated>
    <author>
      <name>Brian Noyes</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
One thing that is a little tedious when you are first getting started with Prism for
Windows Runtime is setting up a new project and swapping out base classes on the App
class and each Page that you create, and cleaning up all the boilerplate code that
Visual Studio puts in place. The good news is, you no longer have to, thanks to <a href="http://www.davidbritch.com/" target="_blank">David
Britch</a> (who also wrote all the docs for Prism for Windows Runtime).
</p>
        <p>
You can get the goods for what I am describing in this post <a href="http://visualstudiogallery.msdn.microsoft.com/e86649de-2b5e-45bb-bc65-5c6499b92b34" target="_blank">here</a>.
</p>
        <p>
Using the Prism for Windows Runtime templates, you can now just do a File &gt; New
Project, and select a Prism App from the Windows Store category. You can choose from
the Prism App, which uses manual dependency injection to pass client service references
to the view model in the App.OnInitialize method, or Prism App using Unity to have
it use the Unity container for dependency injection.
</p>
        <p>
          <a href="http://briannoyes.net/content/binary/Windows-Live-Writer/Awesome-new-Prism-for-Windows-Runtime-re_BD6D/5-24-2013%201-33-45%20PM_2.png">
            <img title="5-24-2013 1-33-45 PM" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="5-24-2013 1-33-45 PM" src="http://briannoyes.net/content/binary/Windows-Live-Writer/Awesome-new-Prism-for-Windows-Runtime-re_BD6D/5-24-2013%201-33-45%20PM_thumb.png" width="628" height="355" />
          </a>
        </p>
        <p>
Once you create the project, it will have the App class inheriting from Prism’s MvvmAppBase,
and will have one Page view and corresponding ViewModel, placed in the \Views and
\ViewModels subfolders (and child namespaces), following the default convention for
Prism’s ViewModelLocator.
</p>
        <p>
          <a href="http://briannoyes.net/content/binary/Windows-Live-Writer/Awesome-new-Prism-for-Windows-Runtime-re_BD6D/5-24-2013%201-39-35%20PM_2.png">
            <img title="5-24-2013 1-39-35 PM" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="5-24-2013 1-39-35 PM" src="http://briannoyes.net/content/binary/Windows-Live-Writer/Awesome-new-Prism-for-Windows-Runtime-re_BD6D/5-24-2013%201-39-35%20PM_thumb.png" width="190" height="244" />
          </a>
        </p>
        <p>
Then to add new Views or ViewModels, you just right click on the respective folder
and select Add &gt; New Item, and you will see a number of Prism templates in the
Windows Store category.
</p>
        <p>
          <a href="http://briannoyes.net/content/binary/Windows-Live-Writer/Awesome-new-Prism-for-Windows-Runtime-re_BD6D/5-24-2013%201-42-19%20PM_2.png">
            <img title="5-24-2013 1-42-19 PM" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="5-24-2013 1-42-19 PM" src="http://briannoyes.net/content/binary/Windows-Live-Writer/Awesome-new-Prism-for-Windows-Runtime-re_BD6D/5-24-2013%201-42-19%20PM_thumb.png" width="631" height="328" />
          </a>
        </p>
        <p>
Nice big productivity boost compared to swapping out the base class in the code behind
and XAML of your views and App class manually every time.
</p>
        <p>
If you want a good end to end training on using Prism for Windows Runtime in your
Windows Store apps, please be sure to check out my Pluralsight course <a href="http://pluralsight.com/training/Courses/TableOfContents/building-windows-store-business-applications-prism" target="_blank">Building
Windows Store Business Apps with Prism</a>. If you are not a Pluralsight subscriber,
you should be because it is the best training around for getting up to speed on new
technologies, and the price is soooo worth it.  But if you prefer a written introduction,
check out my article series on Prism here: <a href="http://tinyurl.com/prismrtseries">http://tinyurl.com/prismrtseries</a>. 
</p>
        <p>
Thanks much to David Britch for taking the time to put these templates together. I
know I will be using them from now on with my Prism projects.
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=aa37439d-6a59-4e74-a809-faf313cea630" />
      </div>
    </content>
  </entry>
  <entry>
    <title>New Pluralsight Course &amp; Prism for Windows Runtime Released!</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2013/05/18/NewPluralsightCoursePrismForWindowsRuntimeReleased.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,acab5479-d90d-442e-a8eb-d17184d83b9a.aspx</id>
    <published>2013-05-18T11:31:00.1175105+00:00</published>
    <updated>2013-05-18T11:31:00.1175105+00:00</updated>
    <author>
      <name>Brian Noyes</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I pleased to announce that my new <a href="http://pluralsight.com" target="_blank">Pluralsight</a> course <a href="http://pluralsight.com/training/Courses/TableOfContents/building-windows-store-business-applications-prism" target="_blank">Building
Windows Store Business Applications with Prism</a> is now live, right on the same
day that the subject – <a href="http://code.msdn.microsoft.com/windowsapps/Prism-for-the-Windows-86b8fb72" target="_blank">Prism
for Windows Runtime</a> – is released. How is that for timing? You can read the official
word on the release from the team PM Blaine Wastell <a href="http://blogs.msdn.com/b/blaine/archive/2013/05/18/just-released-prism-for-windows-runtime.aspx" target="_blank">here</a>.
</p>
        <p>
I had the pleasure of working as a vendor on the Prism team (formerly known as the
Kona team during development) part time. I was involved with the initial requirements
definition for the project, the design of the sample applications and the reusable
code libraries, and even wrote some of the code myself. So this is a topic near and
dear to my heart.
</p>
        <p>
If I had to sum Prism for Windows Runtime up in a short statement (or run on sentence
if you are an English teacher), it would be something like this:
</p>
        <p>
Prism for Windows Runtime provides samples, reusable code libraries, and documentation
that will help Windows Store app developers write their apps so that they are well
structured (most likely using the Model-View-ViewModel or MVVM UI separation pattern,
but Prism does not mandate that), maintainable, testable, and leveraging the capabilities
of the WinRT platform while following the style guidelines of Modern UI Style.
</p>
        <p>
Here is a quick rundown of what the course contains. (I’ll just refer to this release
as Prism here for short, but not to be confused with <a href="http://msdn.microsoft.com/en-us/library/gg406140.aspx" target="_blank">Prism
4</a> which targets WPF and Silverlight).
</p>
        <h5>Module 1 – Prism Overview
</h5>
        <p>
In this module I talk about the overall business application context that Prism is
meant to address. I clarify some of the (confusing) branding and terminology around
“Windows Store apps” and I go through what is “in the box” in Prism for Windows Runtime.
I do an end to end walkthrough of the main sample application of Prism – AdventureWorks
Shopper – to point out where all the aspects that Prism tries to provide guidance
and sample and reusable code for show up in that application. Then I close out by
contrasting Prism for Windows Runtime with Prism 4 in terms of their overlap and their
differences.
</p>
        <h5>Module 2 – Getting Started Building WinRT Apps with Prism
</h5>
        <p>
In this module I talk about MVVM and the challenges of doing it with WinRT to get
started. Then I cover in concept and in demo the steps involved in setting up a Prism
application starting from a Windows Store Blank App project template. After that I
talk about the ViewModelLocator, which is part of the reusable code of Prism for Windows
Runtime, and demo how it automates the process of getting Views and ViewModels hooked
up to each other dynamically at runtime. I show how the ViewModelLocator is convention
based by default, and how to override those conventions so that you can provide code
that locates ViewModels and constructs them based on whatever convention or process
you like if you want to do things differently than the simple starter conventions
of Prism.
</p>
        <h5>Module 3 – Commands and Dependencies
</h5>
        <p>
In this module, I talk about the Command Pattern, how it is supported by the WinRT
platform, and how it is used to communicate between Views and ViewModels. Then I cover
the DelegateCommand class of Prism, which was ported over from Prism 4. Next I get
into dependencies, define what a dependency is, how you can do manual dependency injection
in Prism for dependencies that your ViewModels have (such as repositories and other
client side services), as well as a quick introduction to dependency injection (or
IOC) containers, and how to use a container with Prism.
</p>
        <h5>Module 4 – Navigation and Application Lifecycle
</h5>
        <p>
In this module I cover the navigation APIs of WinRT and the styles of navigation that
are common in a WinRT application. Then I show how Prism wraps those and makes it
so your ViewModels can be in charge of navigation as well as be notified when their
respective Page views are navigated to and from so that they can initialize their
data and events appropriately and clean them up when they are going to go away because
their Page has been unloaded and is going away. Then I talk about the app lifecycle
of a WinRT app and how it ties in with both navigation and transient state management.
I show how Prism makes it so your ViewModels can declaratively mark properties so
they will be automatically persisted and restored across a suspend – terminate – launch/resume
lifecycle, as well as how you can do the same thing using a Prism service (SessionStateService)
in your repositories and client side services.
</p>
        <h5>Module 5 – PubSubEvents and EventAggregator
</h5>
        <p>
This module covers how to do loosely coupled communications between ViewModels or
client side services using the EventAggregator of Prism. This is a port of the EventAggregator
from Prism 4 that we moved into a Portable Class Library for this release so this
release version can actually be used by any .NET 4 or later, Silverlight 4 or later,
Windows Phone 7.1 or later, or WinRT project. I cover the EventAggregator pattern
and where it can apply in your MVVM applications, and then demonstrate using it for
simple pub/sub events, using weak references, thread dispatching, and filtering.
</p>
        <h5>Module 6 – Validation
</h5>
        <p>
One of the cool things we did in Prism for Windows Runtime is compensate for an important
omission in WinRT at the current time, especially in the context of business applications
that will probably involve a fair amount of data input instead of being focused mostly
on content consumption (like most Windows Store app samples available). Specifically,
WinRT has no support in Bindings or in the built in controls for handling validation
and displaying it to the user. So this module covers how to leverage the reusable
code we put together to allow your Model or ViewModel objects to declare validation
rules through the standard System.ComponentModel.DataAnnotations attributes, have
those evaluated whenever a property changes, and have them displayed to the user in
a simple to hook up way in the UI.
</p>
        <h5>Module 7 – Calling Web APIs
</h5>
        <p>
This module covers some fundamentals of calling Web APIs (or HTTP Services) from Windows
Store apps. I do a quick intro to creating services with ASP.NET Web API, show how
to use the HttpClient class to make the calls (regardless of the back end platform
that is exposing Web APIs), and then get into how to secure the calls. I also cover
the approach we took for doing server side validation and returning the validation
errors in a standard structured manner to the client based on MVC model validation
that is built in to ASP.NET Web API. I show how to use some reusable classes we implemented
in Prism to consume those errors back on the client side, and get them hooked back
into the client side validation mechanisms we have so that you can display the errors
to the user at a field level in the same way the client side errors get displayed.
</p>
        <h5>Module 8 – Leveraging WinRT Platform Features
</h5>
        <p>
I finish off the course with a quick tour through the implementation in the AdventureWorks
Shopper application that show how to integrate and leverage platform features including
Search charm, Settings charm, Flyout panels, and Live Tiles, but in a way that is
properly structured to be managed and controlled by ViewModels in an MVVM application.
</p>
        <p>
---
</p>
        <p>
So I hope you will check out the course and enjoy it. If you want to read some articles
that don’t go into nearly as much depth but follow a similar structure and material,
you can check out my article series on Prism for Windows Runtime <a href="http://www.silverlightshow.net/items/Windows-Store-LOB-Apps-with-Kona-Getting-Started.aspx" target="_blank">here</a>.
That link points to Part 1, but there are links to the other parts in the right margin.
I’m still working on a few more articles for that series, so be sure to check back
over the next month or so for a few more installments.
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=acab5479-d90d-442e-a8eb-d17184d83b9a" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Kona is Dead, Long Live Prism!</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2013/04/19/KonaIsDeadLongLivePrism.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,c2fff240-79f5-43f2-8fca-7c3dca15dc84.aspx</id>
    <published>2013-04-19T16:02:34.0282563+00:00</published>
    <updated>2013-04-20T11:27:25.8777326+00:00</updated>
    <author>
      <name>Brian Noyes</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
UPDATE: They got the Codeplex URLs updated today, so the new and permanent home for
Prism for Windows Runtime is here: <a href="http://prismwindowsruntime.codeplex.com">http://prismwindowsruntime.codeplex.com</a>.
</p>
        <p>
If you have read my blog, seen me speak at conferences or user groups, or read some
of my articles lately you might know I have been working with the Microsoft patterns
&amp; practices team on guidance for Windows Store Business apps. This guidance has
been code named “Kona” up until recently, and I’ve <a href="http://briannoyes.net/2013/02/20/NewArticleSeriesWindowsStoreLOBAppsWithKona.aspx" target="_blank">posted</a> and <a href="http://www.silverlightshow.net/items/Windows-Store-LOB-Apps-with-Kona-Getting-Started.aspx" target="_blank">written
articles</a> on that in various places.
</p>
        <p>
As the team was getting the <a href="http://konaguidance.codeplex.com/" target="_blank">guidance</a> ready
for release, they decided to rename it to “Prism for Windows Runtime”. The names have
not all been updated on the Codeplex site or in the downloads yet, but the code has
been refactored to the final namespaces and project names that it will ship with.
</p>
        <p>
Specifically the guidance is called “Prism for Windows Runtime”, and it is guidance
on building loosely coupled, maintainable, testable applications based on the MVVM
pattern for WinRT, especially Line of Business or Business to Consumer applications. 
</p>
        <p>
The guidance contains:
</p>
        <ul>
          <li>
An end to end sample application – AdventureWorks Shopper – that is representative
of a real Windows Store application that you might find as a B2C app in the store.
It demonstrates all of the aspects of what Prism for Windows Runtime contains, and
has actually gone through the same approval processes that a 1st party app (an app
produced by Microsoft for the Windows Store) would have to go through. 
</li>
          <li>
Reusable class libraries – Microsoft.Practices.Prism.StoreApps and Microsoft.Practices.Prism.PubSubEvents.
The StoreApps library contains all the reusable infrastructure for doing the MVVM
pattern on WinRT, including base classes for your Application class, Pages, ViewModels,
and model objects, a ViewModelLocator, and stuff to support navigation, app state
management, validation, search and settings charms and more. The PubSubEvents library
is basically the <a href="http://msdn.microsoft.com/en-us/library/gg406140.aspx" target="_blank">Prism
4</a> CompositePresentationEvent pub/sub events code ported to a Portable Class Library
(PCL) that can be used in any .NET 4 or later, Silverlight 4 or later, Windows Phone
7.1 or later, or WinRT application. 
</li>
          <li>
Quickstarts – smaller samples that demonstrate getting started (HelloWorld), Validation,
and PubSubEvents usage 
</li>
          <li>
Documentation 
</li>
        </ul>
        <p>
If you want to learn more, be sure to check out <a href="http://www.silverlightshow.net/items/Windows-Store-LOB-Apps-with-Kona-Getting-Started.aspx" target="_blank">my
article series</a> here, and keep an eye out for <a href="http://pluralsight.com/training/Authors/Details/brian-noyes" target="_blank">my
Pluralsight Course</a> that will be out in a month or so titled “Building Windows
Store Business apps with Prism”.
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=c2fff240-79f5-43f2-8fca-7c3dca15dc84" />
      </div>
    </content>
  </entry>
  <entry>
    <title>DevIntersection Session Wrap Up</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2013/04/11/DevIntersectionSessionWrapUp.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,7a19a12f-02a3-4704-a91f-987c28b8d011.aspx</id>
    <published>2013-04-11T22:02:29.8645252+00:00</published>
    <updated>2013-04-11T22:02:29.8645252+00:00</updated>
    <author>
      <name>Brian Noyes</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I had a great week speaking at <a href="http://www.devintersection.com" target="_blank">DevIntersection</a> this
week and already looking forward to the fall show. If you haven’t made it to this
conference yet, you ought to try to make it to the next show. Just a fantastic set
of speakers and topics all expertly orchestrated by the conference organizers all
set in a great conference venue.
</p>
        <p>
For those that made it or those that didn’t that are interested in the things I presented,
below are the slides and demos for the sessions I gave. Let me know if you have any
questions – best to tweet me @briannoyes if you do leave a comment.
</p>
        <p>
Building MVVM XAML Client Apps    <a href="https://dl.dropboxusercontent.com/u/7366831/downloads/Conferences/DevIntersection/Noyes_BuildingMVVMXAMLClientApps.pdf" target="_blank">Slides</a>    <a href="https://dl.dropboxusercontent.com/u/7366831/downloads/Conferences/DevIntersection/Noyes_MVVMDemos.zip" target="_blank">Demos</a></p>
        <p>
Designing RESTful Services with ASP.NET Web API   <a href="https://dl.dropboxusercontent.com/u/7366831/downloads/Conferences/DevIntersection/Noyes_DesigningRESTfulServicesWithASPNETWebAPI.pdf" target="_blank">Slides</a>    <a href="https://dl.dropboxusercontent.com/u/7366831/downloads/Conferences/DevIntersection/Noyes_DesigningRESTfulWebAPIsDemos.zip" target="_blank">Demos</a></p>
        <p>
Rich HTML Client Data Apps with Breeze    <a href="https://dl.dropboxusercontent.com/u/7366831/downloads/Conferences/DevIntersection/Noyes_BuildingRichDataHTMLClientAppsWithBreeze.pdf" target="_blank">Slides</a>    <a href="https://dl.dropboxusercontent.com/u/7366831/downloads/Conferences/DevIntersection/Noyes_BreezeDemos.zip" target="_blank">Demos</a></p>
        <p>
Expose Data Services with ASP.NET Web API    <a href="https://dl.dropboxusercontent.com/u/7366831/downloads/Conferences/DevIntersection/Noyes_ExposingDataServicesWithASPNETWebAPI.pdf" target="_blank">Slides</a>   <a href="https://dl.dropboxusercontent.com/u/7366831/downloads/Conferences/DevIntersection/Noyes_DataServicesDemos.zip" target="_blank">Demos</a></p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=7a19a12f-02a3-4704-a91f-987c28b8d011" />
      </div>
    </content>
  </entry>
  <entry>
    <title>AngleBrackets and DevIntersection–A great event you shouldn’t miss!</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2013/03/09/AngleBracketsAndDevIntersectionAGreatEventYouShouldntMiss.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,0eeda44b-c8e3-439f-b3a5-55381b849f76.aspx</id>
    <published>2013-03-09T16:03:10.4031141+00:00</published>
    <updated>2013-03-09T16:03:10.4031141+00:00</updated>
    <author>
      <name>Brian Noyes</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’ll be speaking at two co-located conferences in April that a lot of people haven’t
heard of but should get to know and make part of their annual training/conference
plans and budget <a href="http://anglebrackets.org/?refer=NOYES" target="_blank">AngleBrackets</a> and <a href="http://www.devintersection.com/?refer=NOYES" target="_blank">DevIntersection</a>.
</p>
        <p>
          <a href="http://anglebrackets.org/?refer=NOYES" target="_blank">Anglebrackets</a> is
a brand new conference focused on open web technologies. In this ever expanding world
where HTML is the king of UI technologies and developers can less and less be focused
on a single platform, this is a conference that embraces that mentality and offers
up some great content to get you spun up in that world. The speaker roster is full
of top names in web development technologies spanning HTML, CSS, JavaScript and focusing
on both the developer and the designer. I’ll be giving a talk there on Rich Data HTML
Apps with Breeze.
</p>
        <p>
          <a href="http://anglebrackets.org/?refer=NOYES" target="_blank">Anglebrackets</a> is
co-located with <a href="http://www.devintersection.com/?refer=NOYES" target="_blank">DevIntersection</a>,
which itself is a quickly growing conference that is focused on Microsoft development
technologies and packed with all the top speakers in that space. I’ll be giving three
other sessions there on Designing RESTful Services with ASP.NET Web API, Expose Data
Services with ASP.NET Web API, and Building MVVM XAML Applications.
</p>
        <p>
Its going to be a great show and I’d strongly recommend you check them out for a great
opportunity to build your skill set on the technologies that really matter today.
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=0eeda44b-c8e3-439f-b3a5-55381b849f76" />
      </div>
    </content>
  </entry>
  <entry>
    <title>New Pluralsight Course: Building ASP.NET Web API OData Services</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2013/03/06/NewPluralsightCourseBuildingASPNETWebAPIODataServices.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,d0d94abc-82fc-40c4-833c-4d5c5952696b.aspx</id>
    <published>2013-03-06T22:18:41.0505632+00:00</published>
    <updated>2013-03-06T22:35:59.4651871+00:00</updated>
    <author>
      <name>Brian Noyes</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
My latest Pluralsight course is now out and you can <a href="http://pluralsight.com/training/courses/TableOfContents?courseName=aspnetwebapi-odata" target="_blank">check
it out here</a>. This course covers the new OData features that released with the
ASP.NET and Web Tools 2012.2 release just a couple weeks ago.
</p>
        <p>
Here is a quick rundown of what you will learn in this one.
</p>
        <h5>Module 1: ASP.NET Web API Overview, REST, and OData Concepts
</h5>
        <p>
I go through a thorough overview of what ASP.NET Web API is and how it works for developing
HTTP services. I talk about the convention based routing, content negotiation, and
processing pipeline of ASP.NET Web API. Then I talk about the REST Architectural Style
and how it is different from other service styles such as RPC. I finish off the module
by giving a high level overview of what the OData protocol is all about. This module
includes an end to end demo of developing a CRUD-oriented Web API that does not use
OData, but complies with some of the REST architectural constraints.
</p>
        <h5>Module 2: OData Tools and Resources
</h5>
        <p>
In this module I cover the ecosystem of OData. I talk about the similarities and differences
between WCF Data Services and ASP.NET Web API OData, as well as talking a little about
the many server and client platforms that support OData. I demo how to build a simple
OData service with WCF Data Services as a point of comparison and how to consume it
with the WCF Data Services client. I talk about some of the tools out there for consuming
and working with OData, and demo using LINQPad and Fiddler.
</p>
        <h5>Module 3: Supporting OData Queries in ASP.NET Web API
</h5>
        <p>
In this module I show you how to start leveraging OData in your Web APIs to just support
OData query URLs. I talk about the OData query protocol and what kinds of operators
and options there are that you can use to shape queries from the client side. I then
talk about and demonstrate how to add the OData NuGet package to your Web API projects
and use IQueryables and the [Queryable] attribute to light up query support. I finish
off the module by talking about and demonstrating one of the key benefits of supporting
OData queries – deferred execution all the way to the database.
</p>
        <h5>Module 4: Supporting OData Formatting and Entity Data Models
</h5>
        <p>
A big part of the OData protocol is using one of several standardized formats for
your entities as you query and update via your OData services. This depends on part
of the OData spec that delineates how to specify the  data model that you are
exposing for querying and updating. In this module I show you how to set that up so
that you can support the ATOM, JSON-Verbose, and JSON-Light formats of OData for the
message bodies of your queries and updates.
</p>
        <h5>Module 5: Updating via OData
</h5>
        <p>
OData is not just about retrieving data – you can issue updates through it as well.
In this module I show how to do inserts, updates, and deletes using OData. I also
show how to deal with errors and exceptions in an OData compliant way, and how to
expose additional OData Actions on your controllers for calls that go beyond the basic
CRUD patterns of OData.
</p>
        <h5>Module 6: Consuming OData Web APIs from Clients
</h5>
        <p>
In this module I show you how to use the .NET WCF Data Services client to call OData
services (whether implemented with ASP.NET Web API or not) in greater detail than
the demo in module 2. I show you how to do updates and queries, as well as how to
use the async APIs exposed by the Data Services client proxies and how to wrap it
in a Task-based Async Pattern for use with the new async/await keywords of .NET 4.5
and WinRT. Then I switch gears and show how to consume OData from JavaScript clients
using JQuery, DataJS, and <a href="http://www.breezejs.com/" target="_blank">Breeze.js</a>.
</p>
        <p>
 
</p>
        <p>
So that is it. A good end-to-end coverage of the new OData features of ASP.NET Web
API. I hope you will <a href="http://pluralsight.com/training/courses/TableOfContents?courseName=aspnetwebapi-odata" target="_blank">check
it out</a> and spread the word! Don’t forget to check out <a href="http://pluralsight.com/training/Authors/Details/brian-noyes" target="_blank">my
other Pluralsight courses</a> as well.
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=d0d94abc-82fc-40c4-833c-4d5c5952696b" />
      </div>
    </content>
  </entry>
  <entry>
    <title>New Article Series–Windows Store LOB Apps with Kona</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2013/02/20/NewArticleSeriesWindowsStoreLOBAppsWithKona.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,1f9a7e3d-d199-46be-9552-950336ce236c.aspx</id>
    <published>2013-02-20T14:13:47.7669174+00:00</published>
    <updated>2013-02-20T14:13:47.7669174+00:00</updated>
    <author>
      <name>Brian Noyes</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
For the past 6 months or so, I have been working with Microsoft patterns &amp; practices
on a project codenamed “Kona”. It is a set of guidance on building Windows Store (Windows
8, WinRT, Modern UI, etc – the kind of app formerly known as Metro) applications for
Line of Business (LOB) scenarios. That guidance is nearing completion, so I figured
it was time to start getting some articles out there on what it is about and how to
leverage it for building your own applications. The team was composed of several of
the same people at p&amp;p that were part of the <a href="http://msdn.microsoft.com/en-us/library/gg406140.aspx" target="_blank">Prism</a> team
that I also worked on.
</p>
        <p>
The Kona guidance is specifically geared towards people building Windows Store apps
who are not just trying to quickly crank out a fairly small app and get it in the
store quickly, but those that are building apps where maintainability, unit testability,
and evolability are key considerations. Which usually means you are trying to write
an app that will be an integral part of business for a company somewhere. 
</p>
        <p>
Now there are lots of different definitions for what constitutes line of business.
One discriminator I tend to prefer myself is that it is someone’s job to use the app
for a significant part of their day. But in the realm of Windows Store apps, especially
at the current time, there is a lot more focus on B2C – business to consumer – applications
than LOB apps that it is an employee’s job to use as part of their job. 
</p>
        <p>
So if you look at the primary sample application in Kona (called a “Reference Implementation”
or RI by p&amp;p), you may immediately call in to question whether this is for LOB
or not. The scenario is a shopping applications for the AdventureWorks company – so
more of a B2C scenario than a traditional LOB scenario. This scenario was chosen for
a number of reasons, but the key thing is to not get too hung up in whether the sample
scenario is truly an LOB scenario, but realize that it doesn’t really matter what
scenario you pick if you build the application the way you would for an LOB or B2C
app that you expect to have a long life and lots of features, and if that app demonstrates
the things you are trying to show. 
</p>
        <p>
So Kona does that by providing the AWShopper “RI” (sample application) and part of
that is a reusable library that encapsulates a lot of the things you need to do to
fully participate in WinRT application lifecycle, navigation, platform features like
settings and search and so on.
</p>
        <p>
I’m not sure exactly how many articles will end up in the series, but probably at
least 6-10. There is a lot of good stuff in Kona that any Windows Store app developer
can benefit from, especially if they want to do MVVM.
</p>
        <p>
So check out part 1 here, and you will find links to the follow on articles in the
sidebar as I get them written.
</p>
        <p>
          <a title="http://www.silverlightshow.net/items/Windows-Store-LOB-Apps-with-Kona-Getting-Started.aspx" href="http://www.silverlightshow.net/items/Windows-Store-LOB-Apps-with-Kona-Getting-Started.aspx">http://www.silverlightshow.net/items/Windows-Store-LOB-Apps-with-Kona-Getting-Started.aspx</a>
        </p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=1f9a7e3d-d199-46be-9552-950336ce236c" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Consuming an ASP.NET Web API OData Service with Breeze</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2013/02/16/ConsumingAnASPNETWebAPIODataServiceWithBreeze.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,c66c5a98-384c-4abf-b11d-2b1993b041cf.aspx</id>
    <published>2013-02-16T23:51:43.5368349+00:00</published>
    <updated>2013-02-16T23:51:43.5368349+00:00</updated>
    <author>
      <name>Brian Noyes</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
One of the last things I figured out to include in my <a href="http://www.pluralsight.com" target="_blank">Pluralsight</a> course
“Building ASP.NET Web API OData Services” (which should be out in a week or two –
all done, just waiting for the editorial process to complete) was how to consume my
Web API OData services with <a href="http://www.breezejs.com/home" target="_blank">Breeze.js</a>.
</p>
        <p>
Breeze is a great JavaScript library for including rich service-based data access
in HTML 5 / JavaScript applications. It acts as a smart client side repository that
can make the retrieve and update service calls for you, caches the data client side
so you can avoid unnecessary round trips, does change tracking on the entities so
that it knows what to send back for update when you as it to (following a unit-of-work
pattern), integrates nicely with Knockout (or other observable-based libraries) and
more. Its also capable of consuming both Breeze Web APIs that you can easily set up
with their ASP.NET Web API server libraries, or OData services (regardless of what
platform those are on). 
</p>
        <p>
When it comes to integrating with OData, for now Breeze just supports querying (retrieval)
data, not updating through the OData mechanisms. But it provides a nice abstraction
layer for doing so because it lets you formulate LINQ-like syntax in your JavaScript
code for things like “where” (filter operations at an OData wire level), orderby,
top, skip and so on. 
</p>
        <p>
So it was a natural fit for the module in my course on consuming OData from .NET and
JavaScript clients. Most of getting it working was totally straightforward, I just
followed the great documentation on the <a href="http://www.breezejs.com/home" target="_blank">Breeze
site</a> on setting up the Breeze configuration for OData and making the calls. There
was one trick that I sorted out with the help of a little code that <a href="http://neverindoubtnet.blogspot.com/" target="_blank">Ward
Bell</a> and the Web API team had been slinging around. Specifically, take note of
the comments in Step 4 below about matching up the EDM namespace and the entity type
namespace.
</p>
        <p>
So here is a quick walkthrough so others can just take it by the numbers.
</p>
        <h5>Step 1: Create your Web API Project
</h5>
        <p>
File &gt; New Project, Web category, MVC 4 Application, select Web API project type.
</p>
        <p>
          <a href="http://briannoyes.net/content/binary/WindowsLiveWriter/Con.NET-Web-API-OData-Service-with-Breez_D5D3/Figure1.png">
            <img title="Figure1" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Figure1" src="http://briannoyes.net/content/binary/WindowsLiveWriter/Con.NET-Web-API-OData-Service-with-Breez_D5D3/Figure1_thumb.png" width="595" height="332" />
          </a>
        </p>
        <p>
          <a href="http://briannoyes.net/content/binary/WindowsLiveWriter/Con.NET-Web-API-OData-Service-with-Breez_D5D3/Figure2.png">
            <img title="Figure2" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Figure2" src="http://briannoyes.net/content/binary/WindowsLiveWriter/Con.NET-Web-API-OData-Service-with-Breez_D5D3/Figure2_thumb.png" width="569" height="538" />
          </a>
        </p>
        <p>
Delete the ValuesController that it puts in the \Controllers folder.
</p>
        <h5>Step 2: Add the OData NuGet
</h5>
        <p>
Right click on the project in Solution Explorer, find Manage NuGet Packages.
</p>
        <p>
          <a href="http://briannoyes.net/content/binary/WindowsLiveWriter/Con.NET-Web-API-OData-Service-with-Breez_D5D3/Figure3.png">
            <img title="Figure3" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Figure3" src="http://briannoyes.net/content/binary/WindowsLiveWriter/Con.NET-Web-API-OData-Service-with-Breez_D5D3/Figure3_thumb.png" width="450" height="570" />
          </a>
        </p>
        <p>
Search for OData and find the ASP.NET Web API OData package.
</p>
        <p>
          <a href="http://briannoyes.net/content/binary/WindowsLiveWriter/Con.NET-Web-API-OData-Service-with-Breez_D5D3/Figure4.png">
            <img title="Figure4" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Figure4" src="http://briannoyes.net/content/binary/WindowsLiveWriter/Con.NET-Web-API-OData-Service-with-Breez_D5D3/Figure4_thumb.png" width="640" height="420" />
          </a>
        </p>
        <h5>Step 3: Define a Data Model
</h5>
        <p>
I’m gonna use the venerable Northwind Customers table here to keep it simple. Add
a connection string to your web.config:
</p>
        <h5 id="codeSnippetWrapper">
          <div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum1" style="color: #606060"> 1:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">add</span>
              <span style="color: #ff0000">name</span>
              <span style="color: #0000ff">="NorthwindDbContext"</span>
              <span style="color: #ff0000">connectionString</span>
              <span style="color: #0000ff">="server=.;
</span>
            </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum2" style="color: #606060"> 2:</span> database=Northwind;trusted_Connection=true" </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum3" style="color: #606060"> 3:</span>
              <span style="color: #ff0000">providerName</span>
              <span style="color: #0000ff">="System.Data.SqlClient"</span>
              <span style="color: #0000ff">/&gt;</span>
            </pre>
            <!--CRLF-->
          </div>
        </h5>
        <p>
Add a Customers class to the Model folder:
</p>
        <div id="codeSnippetWrapper">
          <div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum1" style="color: #606060"> 1:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> Customer</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum2" style="color: #606060"> 2:</span> {</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum3" style="color: #606060"> 3:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">string</span> CustomerID
{ get; set; }</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum4" style="color: #606060"> 4:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">string</span> CompanyName
{ get; set; }</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum5" style="color: #606060"> 5:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">string</span> Phone
{ get; set; }</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum6" style="color: #606060"> 6:</span> }</pre>
            <!--CRLF-->
          </div>
        </div>
        <p>
And a NorthwindDbContext class (Entity Framework code first approach – could use DB
First or any model you want).
</p>
        <div id="codeSnippetWrapper">
          <div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum1" style="color: #606060"> 1:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> NorthwindDbContext
: DbContext</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum2" style="color: #606060"> 2:</span> {</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum3" style="color: #606060"> 3:</span>
              <span style="color: #0000ff">public</span> DbSet&lt;Customer&gt;
Customers { get; set; }</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum4" style="color: #606060"> 4:</span> }</pre>
            <!--CRLF-->
          </div>
        </div>
        <h5>Step 4:  Define an EDM
</h5>
        <p>
Open the App_Start folder in the project, open WebApiConfig.cs. Add a helper method
to define an Entity Data Model:
</p>
        <div id="codeSnippetWrapper">
          <div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum1" style="color: #606060"> 1:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">static</span> IEdmModel
GetEdmModel()</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum2" style="color: #606060"> 2:</span> {</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum3" style="color: #606060"> 3:</span> ODataModelBuilder
builder = <span style="color: #0000ff">new</span> ODataConventionModelBuilder();</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum4" style="color: #606060"> 4:</span> builder.EntitySet&lt;Customer&gt;(<span style="color: #006080">"Customers"</span>);</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum5" style="color: #606060"> 5:</span> builder.Namespace
= <span style="color: #006080">"WebAPIODataWithBreezeConsumer.Models"</span>;</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum6" style="color: #606060"> 6:</span>
              <span style="color: #0000ff">return</span> builder.GetEdmModel();</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum7" style="color: #606060"> 7:</span> }</pre>
            <!--CRLF-->
          </div>
        </div>
        <p>
          <strong>
          </strong>
        </p>
        <p>
The ODataConventionModelBuilder just needs to know the collections you want to expose.
It will reflect on the types, and declare all their properties in the EDM with corresponding
EDM types, will follow navigation properties to related entities and declare those,
and will infer what the entity keys are.
</p>
        <p>
          <strong>IMPORTANT:</strong> Note line 5 – you need to make sure the namespace of the
EDM matches the namespace your entity types are contained in.
</p>
        <h5>Step 5: Add an OData Route
</h5>
        <p>
In the Register method, add an OData route for your EDM (line 3 below):
</p>
        <div id="codeSnippetWrapper">
          <div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum1" style="color: #606060"> 1:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">static</span>
              <span style="color: #0000ff">void</span> Register(HttpConfiguration
config)</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum2" style="color: #606060"> 2:</span> {</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum3" style="color: #606060"> 3:</span> config.Routes.MapODataRoute(<span style="color: #006080">"odata"</span>, <span style="color: #006080">"odata"</span>,
GetEdmModel());</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum4" style="color: #606060"> 4:</span> config.Routes.MapHttpRoute(</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum5" style="color: #606060"> 5:</span> name: <span style="color: #006080">"DefaultApi"</span>,</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum6" style="color: #606060"> 6:</span> routeTemplate: <span style="color: #006080">"api/{controller}/{id}"</span>,</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum7" style="color: #606060"> 7:</span> defaults: <span style="color: #0000ff">new</span> {
id = RouteParameter.Optional }</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum8" style="color: #606060"> 8:</span> );</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum9" style="color: #606060"> 9:</span> }</pre>
            <!--CRLF-->
          </div>
        </div>
        <p>
The MapODataRoute extension method takes three arguments: a name for the route, a
prefix off the site root address where you can get to the EDM model you will expose,
and the EDM model itself.
</p>
        <h5>Step 6: Create an EntitySetController
</h5>
        <p>
Add a project folder called ODataControllers. Add a class in there called CustomersController,
with a base class of EntitySetController&lt;Customer,string&gt;. Add a Get method
to it that uses the NorthwindDbContext to return Customers:
</p>
        <div id="codeSnippetWrapper">
          <div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum1" style="color: #606060"> 1:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> CustomersController
: EntitySetController&lt;Customer,<span style="color: #0000ff">string</span>&gt;</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum2" style="color: #606060"> 2:</span> {</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum3" style="color: #606060"> 3:</span> NorthwindDbContext
_Context = <span style="color: #0000ff">new</span> NorthwindDbContext();</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum4" style="color: #606060"> 4:</span>  </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum5" style="color: #606060"> 5:</span> [Queryable]</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum6" style="color: #606060"> 6:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">override</span> IQueryable&lt;Customer&gt;
Get()</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum7" style="color: #606060"> 7:</span> {</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum8" style="color: #606060"> 8:</span>
              <span style="color: #0000ff">return</span> _Context.Customers;</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum9" style="color: #606060"> 9:</span> }</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum10" style="color: #606060"> 10:</span>  </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum11" style="color: #606060"> 11:</span>
              <span style="color: #0000ff">protected</span>
              <span style="color: #0000ff">override</span>
              <span style="color: #0000ff">void</span> Dispose(<span style="color: #0000ff">bool</span> disposing)</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum12" style="color: #606060"> 12:</span> {</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum13" style="color: #606060"> 13:</span>
              <span style="color: #0000ff">base</span>.Dispose(disposing);</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum14" style="color: #606060"> 14:</span> _Context.Dispose();</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum15" style="color: #606060"> 15:</span> }</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum16" style="color: #606060"> 16:</span> }</pre>
            <!--CRLF-->
          </div>
        </div>
        <p>
Note the [Queryable] attribute on the Get method – this in combination with the IQueryable
return type is what enables OData query syntax. The EntitySetController takes care
of making sure the OData formatter is used instead of the default JSON formatter,
as well as taking care of mapping OData routing scheme to this controller. The default
OData format is JSON-Light (as opposed to JSON-Verbose or ATOM XML).
</p>
        <p>
At this point you have a working OData service. You should be able to hit it in the
browser with an address of /odata/Customers and you will get back the customers in
the default JSON-Light format. If you want ATOM or JSON-Verbose, you will need to
use a tool like Fiddler where you can control the headers.
</p>
        <p>
          <a href="http://briannoyes.net/content/binary/WindowsLiveWriter/Con.NET-Web-API-OData-Service-with-Breez_D5D3/Figure5.png">
            <img title="Figure5" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Figure5" src="http://briannoyes.net/content/binary/WindowsLiveWriter/Con.NET-Web-API-OData-Service-with-Breez_D5D3/Figure5_thumb.png" width="671" height="357" />
          </a>
        </p>
        <h5>Step 7: Add DataJS and Breeze.js through NuGet
</h5>
        <p>
Go back into Manage NuGet Packages from Solution Explorer and search for Breeze. Select
the Breeze for ASP.NET Web Api Projects package and install. Then do the same to find
and install DataJS.
</p>
        <p>
          <a href="http://briannoyes.net/content/binary/WindowsLiveWriter/Con.NET-Web-API-OData-Service-with-Breez_D5D3/Figure6.png">
            <img title="Figure6" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Figure6" src="http://briannoyes.net/content/binary/WindowsLiveWriter/Con.NET-Web-API-OData-Service-with-Breez_D5D3/Figure6_thumb.png" width="579" height="380" />
          </a>
        </p>
        <h5>Step 8: Create an HTML page + JS with JQuery, Knockout, Q, and Breeze
</h5>
        <p>
Go into the Views folder of your Web project and find the /Home/Index.cshtml file.
Clear out all the HTML in there and add the following scripts to the top (Note: you
can do this by dragging and dropping the script file from the /scripts folder (you
may need to update the JQuery and Knockout NuGet packages in your project to match
these versions).
</p>
        <div id="codeSnippetWrapper">
          <div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum1" style="color: #606060"> 1:</span>
              <span style="color: #006080">&lt;</span>
              <span style="color: #0000ff">script</span> src="~/Scripts/jquery-1.9.1<span style="color: #cc6633">.js</span>"<span style="color: #006080">&gt;</span><span style="color: #006080">&lt;</span>/<span style="color: #0000ff">script</span><span style="color: #006080">&gt;</span></pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum2" style="color: #606060"> 2:</span>
              <span style="color: #006080">&lt;</span>
              <span style="color: #0000ff">script</span> src="~/Scripts/knockout-2.2.1<span style="color: #cc6633">.js</span>"<span style="color: #006080">&gt;</span><span style="color: #006080">&lt;</span>/<span style="color: #0000ff">script</span><span style="color: #006080">&gt;</span></pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum3" style="color: #606060"> 3:</span>
              <span style="color: #006080">&lt;</span>
              <span style="color: #0000ff">script</span> src="~/Scripts/<span style="color: #0000ff">q</span><span style="color: #cc6633">.js</span>"<span style="color: #006080">&gt;</span><span style="color: #006080">&lt;</span>/<span style="color: #0000ff">script</span><span style="color: #006080">&gt;</span></pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum4" style="color: #606060"> 4:</span>
              <span style="color: #006080">&lt;</span>
              <span style="color: #0000ff">script</span> src="~/Scripts/datajs-1.1.0<span style="color: #cc6633">.js</span>"<span style="color: #006080">&gt;</span><span style="color: #006080">&lt;</span>/<span style="color: #0000ff">script</span><span style="color: #006080">&gt;</span></pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum5" style="color: #606060"> 5:</span>
              <span style="color: #006080">&lt;</span>
              <span style="color: #0000ff">script</span> src="~/Scripts/breeze<span style="color: #cc6633">.debug</span><span style="color: #cc6633">.js</span>"<span style="color: #006080">&gt;</span><span style="color: #006080">&lt;</span>/<span style="color: #0000ff">script</span><span style="color: #006080">&gt;</span></pre>
            <!--CRLF-->
          </div>
        </div>
        <p>
Next we need to start building the JavaScript that will use Breeze to execute a query
and put it in a view model we can bind to. First step is to initialize Breeze and
tell it we will be dealing with OData:
</p>
        <p>
 
</p>
        <div id="codeSnippetWrapper">
          <div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum1" style="color: #606060"> 1:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">script</span>
              <span style="color: #ff0000">type</span>
              <span style="color: #0000ff">="text/javascript"</span>
              <span style="color: #0000ff">&gt;</span>
              <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
                <span id="lnum1" style="color: #606060"> 1:</span>  </pre>
              <!--CRLF-->
              <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
                <span id="lnum2" style="color: #606060"> 2:</span>
                <span style="color: #0000ff">var</span> my
= {}; <span style="color: #008000">//my namespace</span></pre>
              <!--CRLF-->
              <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
                <span id="lnum3" style="color: #606060"> 3:</span> $(<span style="color: #0000ff">function</span> ()
{</pre>
              <!--CRLF-->
              <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
                <span id="lnum4" style="color: #606060"> 4:</span>
                <span style="color: #0000ff">var</span> serverAddress
= <span style="color: #006080">"/odata/"</span>;</pre>
              <!--CRLF-->
              <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
                <span id="lnum5" style="color: #606060"> 5:</span> breeze.config.initializeAdapterInstances({
dataService: <span style="color: #006080">"OData"</span> });</pre>
              <!--CRLF-->
              <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
                <span id="lnum6" style="color: #606060"> 6:</span>
                <span style="color: #0000ff">var</span> manager
= <span style="color: #0000ff">new</span> breeze.EntityManager(serverAddress);</pre>
              <!--CRLF-->
              <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
                <span id="lnum7" style="color: #606060"> 7:</span> });</pre>
              <!--CRLF-->
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">script</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
          </div>
        </div>
        <p>
Next we need a simple view model that we will data bind to from our HTML, declared
inside the script block:
</p>
        <p>
 
</p>
        <div id="codeSnippetWrapper">
          <div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum1" style="color: #606060"> 1:</span> my.vm
= {</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum2" style="color: #606060"> 2:</span> customers:
ko.observableArray([]),</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum3" style="color: #606060"> 3:</span> load: <span style="color: #0000ff">function</span> ()
{</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum4" style="color: #606060"> 4:</span> }</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum5" style="color: #606060"> 5:</span> }</pre>
            <!--CRLF-->
          </div>
        </div>
        <p>
 
</p>
        <p>
Next the code that calls the load and sets up the data binding with Knockout at the
end of our script block, inside the JQuery ready function:
</p>
        <div id="codeSnippetWrapper">
          <div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum1" style="color: #606060"> 1:</span> my.vm.load();</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum2" style="color: #606060"> 2:</span> ko.applyBindings(my.vm);</pre>
            <!--CRLF-->
          </div>
        </div>
        <p>
Next some simple Knockout bound HTML to render the customers (outside the script block
obviously):
</p>
        <div id="codeSnippetWrapper">
          <div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum1" style="color: #606060"> 1:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">h2</span>
              <span style="color: #0000ff">&gt;</span>Customers
(<span style="color: #0000ff">&lt;</span><span style="color: #800000">span</span><span style="color: #ff0000">data-bind</span><span style="color: #0000ff">="text:
customers().length"</span><span style="color: #0000ff">&gt;&lt;/</span><span style="color: #800000">span</span><span style="color: #0000ff">&gt;</span>)<span style="color: #0000ff">&lt;/</span><span style="color: #800000">h2</span><span style="color: #0000ff">&gt;</span></pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum2" style="color: #606060"> 2:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">table</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum3" style="color: #606060"> 3:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">thead</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum4" style="color: #606060"> 4:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">tr</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum5" style="color: #606060"> 5:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">th</span>
              <span style="color: #0000ff">&gt;</span>CustomerID<span style="color: #0000ff">&lt;/</span><span style="color: #800000">th</span><span style="color: #0000ff">&gt;</span></pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum6" style="color: #606060"> 6:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">th</span>
              <span style="color: #0000ff">&gt;</span>CompanyName<span style="color: #0000ff">&lt;/</span><span style="color: #800000">th</span><span style="color: #0000ff">&gt;</span></pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum7" style="color: #606060"> 7:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">th</span>
              <span style="color: #0000ff">&gt;</span>Phone<span style="color: #0000ff">&lt;/</span><span style="color: #800000">th</span><span style="color: #0000ff">&gt;</span></pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum8" style="color: #606060"> 8:</span>
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">tr</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum9" style="color: #606060"> 9:</span>
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">thead</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum10" style="color: #606060"> 10:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">tbody</span>
              <span style="color: #ff0000">data-bind</span>
              <span style="color: #0000ff">="foreach:
customers"</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum11" style="color: #606060"> 11:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">tr</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum12" style="color: #606060"> 12:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">td</span>
              <span style="color: #ff0000">data-bind</span>
              <span style="color: #0000ff">="text:
CustomerID"</span>
              <span style="color: #0000ff">&gt;&lt;/</span>
              <span style="color: #800000">td</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum13" style="color: #606060"> 13:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">td</span>
              <span style="color: #ff0000">data-bind</span>
              <span style="color: #0000ff">="text:
CompanyName"</span>
              <span style="color: #0000ff">&gt;&lt;/</span>
              <span style="color: #800000">td</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum14" style="color: #606060"> 14:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">td</span>
              <span style="color: #ff0000">data-bind</span>
              <span style="color: #0000ff">="text:
Phone"</span>
              <span style="color: #0000ff">&gt;&lt;/</span>
              <span style="color: #800000">td</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum15" style="color: #606060"> 15:</span>
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">tr</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum16" style="color: #606060"> 16:</span>
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">tbody</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum17" style="color: #606060"> 17:</span>
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">table</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
          </div>
        </div>
        <h5>Step 9: Query Away!
</h5>
        <p>
Now all we have to do is flesh out our load method in the view model. All we need
to do is form a query and execute it with the Breeze EntityManager, putting the results
where we want them – in this case I loop over the results in a success callback function,
pushing them into my observable array in my view model. The really cool thing is that
Breeze takes care of downloading the OData metadata for the Entity Data Model and
automatically creates observable types for the data objects, so the individual objects
I am adding into my array are data binding friendly JS types with observable properties.
</p>
        <div id="codeSnippetWrapper">
          <div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum1" style="color: #606060"> 1:</span> load: <span style="color: #0000ff">function</span> ()
{</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum2" style="color: #606060"> 2:</span>
              <span style="color: #0000ff">var</span> query
= breeze.EntityQuery.from(<span style="color: #006080">"Customers"</span>);</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum3" style="color: #606060"> 3:</span> manager.executeQuery(query, <span style="color: #0000ff">function</span> (data)
{</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum4" style="color: #606060"> 4:</span>
              <span style="color: #0000ff">var</span> results
= data.results;</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum5" style="color: #606060"> 5:</span> $.each(data.results, <span style="color: #0000ff">function</span> (i,
c) {</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum6" style="color: #606060"> 6:</span> my.vm.customers.push(c);</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum7" style="color: #606060"> 7:</span> });</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum8" style="color: #606060"> 8:</span> });</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum9" style="color: #606060"> 9:</span> }</pre>
            <!--CRLF-->
          </div>
        </div>
        <p>
 
</p>
        <p>
We can now run and we should get all customers:
</p>
        <p>
          <a href="http://briannoyes.net/content/binary/WindowsLiveWriter/Con.NET-Web-API-OData-Service-with-Breez_D5D3/Figure7.png">
            <img title="Figure7" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Figure7" src="http://briannoyes.net/content/binary/WindowsLiveWriter/Con.NET-Web-API-OData-Service-with-Breez_D5D3/Figure7_thumb.png" width="611" height="421" />
          </a>
        </p>
        <p>
The other cool thing is that now we can start formulating more complicated LINQ-like
queries with Breeze. instead of just asking for all customers above, we could change
it to ask for customers who’s company name starts with B and order by the CustomerID.
Just change line 2 above to:
</p>
        <p>
 
</p>
        <div id="codeSnippetWrapper">
          <div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span id="lnum1" style="color: #606060"> 1:</span>
              <span style="color: #0000ff">var</span> query
= breeze.EntityQuery.from(<span style="color: #006080">"Customers"</span>)</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span id="lnum2" style="color: #606060"> 2:</span> .where(<span style="color: #006080">"CompanyName"</span>,<span style="color: #006080">"startsWith"</span>,<span style="color: #006080">"B"</span>).orderBy(<span style="color: #006080">"CustomerID"</span>);</pre>
            <!--CRLF-->
          </div>
        </div>
        <p>
 
</p>
        <p>
And viola:
</p>
        <p>
          <a href="http://briannoyes.net/content/binary/WindowsLiveWriter/Con.NET-Web-API-OData-Service-with-Breez_D5D3/Figure8.png">
            <img title="Figure8" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="Figure8" src="http://briannoyes.net/content/binary/WindowsLiveWriter/Con.NET-Web-API-OData-Service-with-Breez_D5D3/Figure8_thumb.png" width="622" height="429" />
          </a>
        </p>
        <h5>Summary
</h5>
        <p>
Web API makes exposing OData services a piece of cake and gives you more power and
flexibility to integrate your own business logic and data access than you get in WCF
Data Services. Breeze makes a great JavaScript client library to query those services,
allowing you to write LINQ like code to formulate your queries. Of course Breeze goes
way beyond just letting you query – it gives you a really rich experience for binding,
editing, validating, going offline, and then pushing changes to the data back to the
server. But those things will have to wait for another post…
</p>
        <p>
Please check out my Pluralsight Course “Building ASP.NET Web API OData Services” (due
out by end of February) for the full story on Web API and OData.
</p>
        <p>
You can download the full source code <a href="https://dl.dropbox.com/u/7366831/downloads/Blog/WebAPIODataWithBreezeConsumer.zip" target="_blank">for
this sample here</a>.
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=c66c5a98-384c-4abf-b11d-2b1993b041cf" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Designing RESTful Services with ASP.NET Web API–NYC.net Developers Group</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2013/01/18/DesigningRESTfulServicesWithASPNETWebAPINYCnetDevelopersGroup.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,d56e4193-4ee5-49ae-aa93-033214583653.aspx</id>
    <published>2013-01-18T16:02:20.0332903+00:00</published>
    <updated>2013-01-18T16:02:20.0332903+00:00</updated>
    <author>
      <name>Brian Noyes</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Last night I presented this topic at the <a href="http://www.nycdotnetdev.com/" target="_blank">NYC.net
Developers Group</a> to a packed house. The talk covers the fundamentals of developing
HTTP Services or Web APIs with ASP.NET, then gets into the concepts of REST as an
architectural style, contrasting it with SOAP and RPC style services and discussing
the different levels of compliance that you might choose to have with the full REST
architectural style as <a href="http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm" target="_blank">defined
by its author</a>.
</p>
        <p>
I’ll be presenting this same talk <a href="http://www.netda.net/" target="_blank">in
Redmond</a> on 4 Feb, <a href="http://caparea.net" target="_blank">CapArea.net</a> on
26 Feb, and at the <a href="http://www.devintersection.com/" target="_blank">DevIntersection
conference</a> in Vegas in April, so try to make one of those if you can to get bootstrapped
on how to build Web APIs that comply (at least to some degree) with what REST is all
about.
</p>
        <p>
Here are the slides and demos for you to check out:
</p>
        <p>
          <a href="https://dl.dropbox.com/u/7366831/downloads/UGs/DesigningRESTfulServicesWithASP.NETWebAPI.pdf" target="_blank">Slides</a> 
</p>
        <p>
          <a href="https://dl.dropbox.com/u/7366831/downloads/UGs/DesigningRESTfulWebAPIsDemos.zip" target="_blank">Demos</a>
        </p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=d56e4193-4ee5-49ae-aa93-033214583653" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Scaling Windows Azure Web Sites from Free/Shared to Reserved</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2013/01/02/ScalingWindowsAzureWebSitesFromFreeSharedToReserved.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,55a15fec-b8d2-4c4b-9fd2-803649dd39dd.aspx</id>
    <published>2013-01-02T13:41:59.7551036+00:00</published>
    <updated>2013-01-02T13:41:59.7551036+00:00</updated>
    <author>
      <name>Brian Noyes</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Last week DasBlog freaked out on my blog and pegged the CPU on my Windows Azure Web
Sites (WAWS) hosted blog. Because I had it configured as a Shared instance (which
allows me to point my custom briannoyes.net and briannoyes.com domains at it from
DNS), there are Usage Quotas that kicked in for how much CPU time your site can consume
in a given window and my site got suspended for exceeding those quotas. As a result,
my blog was down for almost a 24 hour period until the quota gets reset. 
</p>
        <p>
When I discovered the problem (thanks to @MLaritz for alerting me via Twitter), I
thought “well, I can just scale it up to a Reserved instance for a period until the
quota gets reset and then can scale back down.” 
</p>
        <p>
What surprised me was when I tried to do that I got the following warning:
</p>
        <p>
"This will upgrade all web sites in the West US region to Reserved mode. This
will take several minutes to complete and your sites will keep running during the
process."
</p>
        <p>
I had two other sites on the same account in the same sub-region, and this made it
sound like they were each going to become a Reserved instances (billing out at ~$57/mo
instead of ~$10/mo for shared). So I instead opted for waiting and letting my blog
be down for a day.
</p>
        <p>
I followed up with the Azure team and was pointed to <a href="http://brentdacodemonkey.wordpress.com/2012/12/11/windows-azure-web-sites-quotas-scaling-and-pricing/">this
great post by Brent Stineman</a>. The important subtlety here is that yes, in fact
all of my sites would have been moved to a Reserved instance, but they would all be
moved to a single instance and it would basically become a dedicated VM acting as
a shared host for all of my sites, which I could then scale as appropriate. That means
if you have more than 6 sites you would actually save money compared to the shared
hosting option.  Well, in my case I only had three and it would have been a little
more expensive, but no where near what I thought it was telling me – that I would
jump to paying 6 X 3 = 18 times as much.
</p>
        <p>
So just realize that when you scale from Shared to Reserved mode and you get this
notice, it means those sites will be moved together to a single reserved instance,
not individual instances.
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=55a15fec-b8d2-4c4b-9fd2-803649dd39dd" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Attached Behaviors vs Attached Properties vs Blend Behaviors</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2012/12/20/AttachedBehaviorsVsAttachedPropertiesVsBlendBehaviors.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,752377c9-3934-4c7d-bd32-b6670a311c94.aspx</id>
    <published>2012-12-20T03:20:00.3786586+00:00</published>
    <updated>2012-12-20T03:20:00.3786586+00:00</updated>
    <author>
      <name>Brian Noyes</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://brianlagunas.com/" target="_blank">Brian Lagunas</a> asked a very
good question based on <a href="http://www.facebook.com/skonnard/posts/398993640178823?comment_id=61998146" target="_blank">seeing
my sample video</a> from my Pluralsight Windows 8 MVVM XAML Apps course, the gist
of which was (paraphrased): “Why do you call them Attached Behaviors – won’t that
cause confusion with what is an Attached Property and with Blend Behaviors?”
</p>
        <p>
My initial answer was along the lines of “because that is what we called them back
in the day, long before Blend picked up the concept and created their own behaviors.”
</p>
        <p>
          <a title="http://blogs.msdn.com/b/dancre/archive/2006/03/04/543854.aspx" href="http://blogs.msdn.com/b/dancre/archive/2006/03/04/543854.aspx">http://blogs.msdn.com/b/dancre/archive/2006/03/04/543854.aspx</a>
        </p>
        <p>
But Brian rightly pointed out that not everyone has as deep of history working with
XAML as I do and a lot of people only associated the term behavior with <a href="http://blogs.msdn.com/b/dphill/archive/2009/09/25/blend-behaviors.aspx" target="_blank">Blend
Behaviors</a>. He also asked how to discriminate a simple attached property from an
attached behavior.
</p>
        <p>
Here is my response: 
</p>
        <p>
I think the distinction in my mind is this: "normal" attached properties
are there as metadata for some other piece of code (i.e. a container control like
a Grid or a ToolTip) to modify its own behavior based on the presence of that attached
property. When used like that, attached properties are like attributes in C# or VB
code - they don't do any work themselves, they are just there to influence behavior
implemented somewhere else.
</p>
        <p>
When an attached property has a change handler that acts on the exposed API of the
DependencyObject to which it is attached, it is an attached behavior - in which case
it is much more like an extension method in C# - a chunk of code that can be associated
with that object to supplement that object's behavior or functionality without that
object's knowledge.
</p>
        <p>
A similar discussion also recently came up while working with the Microsoft patterns
&amp; practices Kona team on Line-Of-Business guidance for Windows 8. As a result
of that discussion, I wrote up a couple page summary with some snippets to compare
and contrast Attached vs Blend Behaviors. So I’m including that content here as well.
</p>
        <h3>Attached and Blend Behaviors
</h3>
        <p>
Behaviors are a way of supplementing the functionality, or behavior, of XAML elements.
A behavior is a chunk of code you write that can be used in XAML by attaching it to
some element through attached properties. The behavior can use the exposed API of
the element to which it is attached to add functionality to that element or other
elements in the visual tree of the view. In this way, they are the XAML equivalent
of C# extension methods. Extension methods allow you to define additional methods
for some class in C# without modifying the class definition itself, and they work
against the exposed API of the class. Behaviors allow you to add functionality to
an element by writing that functionality in the behavior class and attaching it to
the element as if it was part of the element itself.
</p>
        <p>
Ultimately behaviors package up code that you would normally have to write as code
behind because it directly interacts with the API of XAML elements in a way that it
can be concisely hooked up to an element in the XAML and packaged for reuse across
more than one view or application. They can be used to encapsulate a complex coding
pattern of interaction for a given control, do visual tree walks to discover and hook
things up throughout a view, and virtually any scenario where you ask yourself “how
do I do XYZ?” and the answer is “you write this code behind”. In the context of MVVM,
they are a great way to bridge from things that are happening in the view due to user
interaction and getting the information and execution into a view model. So you can
hook events and properties from a given control type and feed those down into a view
model in a standardized fashion.
</p>
        <p>
All behaviors are in some sense “attached behaviors” because they use Attached Properties
in XAML to hook the behavior in to some element within the XAML. But two styles of
implementation for behaviors are dominant. The first is generally referred to as simply
an Attached Behavior, and the second as a Blend Behavior.
</p>
        <h4>Attached Behaviors
</h4>
        <p>
Attached behaviors are defined as a static class with one or more Attached Properties
defined within it. An Attached Property can define a change callback handler for when
the property gets set on some target element, and the callback handler gets passed
a reference to the element on which it is being attached (much like the “this” parameter
reference in an extension method) and an argument that tells what the old and new
values for the property are. The “behavior” comes in when you use that change callback
handler to wire up new functionality to the element the property is attached to by
manipulating the reference to it that gets passed in. The typical pattern is that
the change callback handler will cast the element reference (which comes in as just
a DependencyObject) to some known element type that the behavior is designed to enhance.
Then it will hook up to events exposed by that element type, modify properties of
the element, or call methods on the element to manifest the “behavior” desired.
</p>
        <p>
An example would be to cast the reference to the ListViewBase type in WinRT, which
is the base class for GridView and ListView, then subscribe to the ItemClick event,
and in the handler for that event, make something happen like navigation or invoke
a command.
</p>
        <p>
The syntax for the behavior would look like this:
</p>
        <div id="codeSnippetWrapper">
          <div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">static</span>
              <span style="color: #0000ff">class</span> ItemClickNavBehavior</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">    {</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">static</span>
              <span style="color: #0000ff">string</span> GetDestination(DependencyObject
obj)</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">        {</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span style="color: #0000ff">return</span> (<span style="color: #0000ff">string</span>)obj.GetValue(DestinationProperty);</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">        }</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"> </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">static</span>
              <span style="color: #0000ff">void</span> SetDestination(DependencyObject
obj, <span style="color: #0000ff">string</span><span style="color: #0000ff">value</span>)</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">        {</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">            obj.SetValue(DestinationProperty, <span style="color: #0000ff">value</span>);</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">        }</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"> </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">static</span>
              <span style="color: #0000ff">readonly</span> DependencyProperty
DestinationProperty =</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">            DependencyProperty.RegisterAttached(<span style="color: #006080">"Destination"</span>, <span style="color: #0000ff">typeof</span>(<span style="color: #0000ff">string</span>), </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span style="color: #0000ff">typeof</span>(ItemClickNavBehavior), <span style="color: #0000ff">new</span> PropertyMetadata(<span style="color: #0000ff">null</span>, </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">            HookupBehavior));</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"> </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span style="color: #0000ff">private</span>
              <span style="color: #0000ff">static</span>
              <span style="color: #0000ff">void</span> HookupBehavior(DependencyObject
d, </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">            DependencyPropertyChangedEventArgs e)</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">        {</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">            ListViewBase lvb = d <span style="color: #0000ff">as</span> ListViewBase;</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span style="color: #0000ff">if</span> (lvb
== <span style="color: #0000ff">null</span>) <span style="color: #0000ff">return</span>;</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">            lvb.ItemClick += DoNavigation;</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">        }</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white"> </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span style="color: #0000ff">private</span>
              <span style="color: #0000ff">static</span>
              <span style="color: #0000ff">void</span> DoNavigation(<span style="color: #0000ff">object</span> sender,
ItemClickEventArgs e)</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">        {</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span style="color: #008000">//...</span>
            </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">        }</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">    }</pre>
            <!--CRLF-->
          </div>
        </div>
        <p>
And the hookup for the behavior in the XAML like this:
</p>
        <div id="codeSnippetWrapper">
          <div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">GridView</span>
              <span style="color: #ff0000">local:ItemClickNavBehavior</span>.<span style="color: #ff0000">Destination</span><span style="color: #0000ff">="Home"</span> ...<span style="color: #0000ff">&gt;</span></pre>
            <!--CRLF-->
          </div>
        </div>
        <p>
 
</p>
        <h4>Blend Behaviors
</h4>
        <p>
The problem with Attached Behaviors as described above is that they are defined entirely
through a set of public static variables and methods within a static class. As a result,
there is not good encapsulating, and you have to be very careful with unsubscribing
from events that you subscribe to at the appropriate time so you do not cause memory
leaks. Additionally, they are not easy to use in a visual designer because there is
not a visual designer metaphor for dragging and dropping a property onto an element.
You can drag and drop objects on other objects to set up a hierarchy, and you can
set properties on objects already in the designer through the properties window, but
you cannot do the initial hookup through existing interaction patterns in a designer.
</p>
        <p>
As a result, the Microsoft Expression Blend team standardized a new coding structure
for defining behaviors that is both design tool friendly, and is better encapsulated.
With a Blend Behavior, you define a non-static class as your behavior , derived from
a Behavior or Behavior&lt;T&gt; base class. In your behavior you override a base class
method called OnAttached, and you have a base class property called AssociatedObject
that gives you a reference to the element to which the behavior is attached. The behavior
then gets attached to the element through an Attached Property that is a collection
of Behaviors. This allows a drag and drop interaction in a visual designer. You drag
and drop the behavior onto the element that you want to attach it to, and an instance
of the behavior class is created in the Behaviors Attached Property collection on
the target element.
</p>
        <p>
With a Blend Behavior, the syntax for defining one for the same scenario as the Attached
Behavior shown earlier looks like this:
</p>
        <div id="codeSnippetWrapper">
          <div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> ItemClickNavBehavior2
: Behavior&lt;ListViewBase&gt;</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">{</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">string</span> Destination</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">    {</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">        get { <span style="color: #0000ff">return</span> (<span style="color: #0000ff">string</span>)GetValue(DestinationProperty);
}</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">        set { SetValue(DestinationProperty, <span style="color: #0000ff">value</span>);
}</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">    }</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"> </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">static</span>
              <span style="color: #0000ff">readonly</span> DependencyProperty
DestinationProperty =</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">        DependencyProperty.Register(<span style="color: #006080">"Destination"</span>, <span style="color: #0000ff">typeof</span>(<span style="color: #0000ff">string</span>), </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span style="color: #0000ff">typeof</span>(ItemClickNavBehavior2), <span style="color: #0000ff">new</span> PropertyMetadata(<span style="color: #0000ff">null</span>));</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"> </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span style="color: #0000ff">protected</span>
              <span style="color: #0000ff">override</span>
              <span style="color: #0000ff">void</span> OnAttached()</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">    {</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span style="color: #0000ff">base</span>.OnAttached();</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">        AssociatedObject.ItemClick += DoNavigation;</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">    }</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
            </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span style="color: #0000ff">private</span>
              <span style="color: #0000ff">void</span> DoNavigation(<span style="color: #0000ff">object</span> sender,
ItemClickEventArgs e) { <span style="color: #008000">/* ... */</span> }</pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">}</pre>
            <!--CRLF-->
          </div>
        </div>
        <p>
 
</p>
        <p>
And the attaching code looks like this:
</p>
        <div id="codeSnippetWrapper">
          <div id="codeSnippet" style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">GridView</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">i:Interaction.Behaviors</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">local:ItemClickNavBehavior2</span>
              <span style="color: #ff0000">Destination</span>
              <span style="color: #0000ff">="Home"</span>
              <span style="color: #0000ff">/&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4">
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">i:Interaction.Behaviors</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: white">
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">GridView</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-top-style: none; overflow: visible; font-size: 8pt; border-left-style: none; font-family: 'Courier New', courier, monospace; border-bottom-style: none; color: black; padding-bottom: 0px; direction: ltr; text-align: left; padding-top: 0px; border-right-style: none; padding-left: 0px; margin: 0em; line-height: 12pt; padding-right: 0px; width: 100%; background-color: #f4f4f4"> </pre>
            <!--CRLF-->
          </div>
        </div>
        <p>
 
</p>
        <p>
The base classes and the attached property class for Blend behaviors come out of the
Blend SDK. Unfortunately this is not available for WinRT yet. There are several community
developed replacements for it, such as the <a href="http://winrtbehaviors.codeplex.com/" target="_blank">WinRtBehaviors</a> project.
Those use the exact same syntax and structuring as Blend behaviors, just a different
namespace so the code can be portable to a Blend SDK once one is released for WinRT.
As a result, I would still refer to these as “Blend Behaviors”.
</p>
        <p>
The Blend SDK also ships with a number of pre-built, general purpose behaviors such
as InvokeCommandAction, CallMethodAction, and ChangePropertyAction that can be used
in MVVM scenarios. These behaviors actually get attached through a Triggers attached
property collection instead of Behaviors because they get defined as a pair of objects
– a Trigger object such as an EventTrigger, DataTrigger, TimerTrigger and so on, and
the associated Action that will be invoked when the trigger fires. 
</p>
        <p>
So in the end, even Blend Behaviors are hooked up with an attached property.
</p>
        <p>
Hope that makes it all clear as mud. <img class="wlEmoticon wlEmoticon-smile" style="border-top-style: none; border-left-style: none; border-bottom-style: none; border-right-style: none" alt="Smile" src="http://briannoyes.net/content/binary/Windows-Live-Writer/69c328aa9f74_117DD/wlEmoticon-smile_2.png" /></p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=752377c9-3934-4c7d-bd32-b6670a311c94" />
      </div>
    </content>
  </entry>
  <entry>
    <title>DevIntersection slides and demos</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2012/12/16/DevIntersectionSlidesAndDemos.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,b26ff6a3-20f4-43ef-b19c-6b5db80388ae.aspx</id>
    <published>2012-12-16T15:49:51.8995145+00:00</published>
    <updated>2012-12-16T15:49:51.8995145+00:00</updated>
    <author>
      <name>Brian Noyes</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
It was a fun week speaking at the DevIntersection conference in Las Vegas this week.
A great set of speakers and attendees. I'd definitely recommend you check out this
conference at the next one in the spring: <a href="http://devintersection.com" target="_blank">http://devintersection.com/</a></p>
        <p>
I gave four talks at the conference. You can grab the slides and demos for those talks
below.
</p>
        <p>
Expose Data Services with ASP.NET Web API    <a href="http://dl.dropbox.com/u/7366831/downloads/Conferences/DevIntersection/AS05_Noyes_ExposingDataServicesWithWebAPI.pdf" target="_blank">Slides</a>.     <a href="http://dl.dropbox.com/u/7366831/downloads/Conferences/DevIntersection/AS05_Noyes_DataServices_Demos.zip" target="_blank">Demos</a></p>
        <p>
Building Extensible XAML Client Apps.      <a href="http://dl.dropbox.com/u/7366831/downloads/Conferences/DevIntersection/AS07_Noyes_BuildingExtensibleXAMLClientApps.pdf" target="_blank">Slides</a>.    <a href="http://dl.dropbox.com/u/7366831/downloads/Conferences/DevIntersection/AS07_Noyes_BuildExtensibleXAMLClientApps_Demos.zip" target="_blank">Demos</a></p>
        <p>
Designing RESTful Services with ASP.NET Web API.    <a href="http://dl.dropbox.com/u/7366831/downloads/Conferences/DevIntersection/AS04_Noyes_DesigningRESTfulServicesWithASP.NETWebAPI.pdf" target="_blank">Slides</a>.    <a href="http://dl.dropbox.com/u/7366831/downloads/Conferences/DevIntersection/AS04_Noyes_RESTfulWebAPIs_Demos.zip" target="_blank">Demos</a></p>
        <p>
Securing ASP.NET Web API Services     <a href="http://dl.dropbox.com/u/7366831/downloads/Conferences/DevIntersection/AS14_Noyes_SecuringASP.NETWebAPIServices.pdf" target="_blank">Slides</a>.    <a href="http://dl.dropbox.com/u/7366831/downloads/Conferences/DevIntersection/AS14_Noyes_SecuringWebAPIs_Demos.zip" target="_blank">Demos</a></p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=b26ff6a3-20f4-43ef-b19c-6b5db80388ae" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Solliance – My New Company</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2012/12/08/SollianceMyNewCompany.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,fac4fead-71d0-42d2-81d9-49f236d3911b.aspx</id>
    <published>2012-12-08T22:27:16.5305683+00:00</published>
    <updated>2012-12-09T00:30:11.1343878+00:00</updated>
    <author>
      <name>Brian Noyes</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I am excited to announce a new adventure in my professional life - I am starting a
new company in partnership with my friends and colleagues Michele Leroux Bustamante
and Zoiner Tejada named Solliance (www.solliance.net). Our new company will be focused
on end to end software solutions development, including everything from initial architecture
and design, user experience, development, security, project management, testing, deployment
and operations. Of course, its not just the three of us involved in this endeavor.
We have already assembled a team for a few large projects - pulling from our own resources
at Solliance, and our partner network. Our web site will eventually have more details
on this as well. Basically, we assemble the right team for a job, using experts in
our ecosystem.
</p>
        <p>
In addition, since all three of us are solution architects ourselves, we will continue
to do architecture, security, and development consulting as needed for teams that
are already staffed to build the products themselves, but just need some expert level
assistance at times. Along those lines we can use our expert partners to cover technologies
and disciplines that we do not cover ourselves to make it easy to find the help you
need for your projects - come to us and we will get you the help you need. We will
also be offering training and mentoring in the technologies and skill sets we specialize
in.
</p>
        <p>
So wish us luck in our new adventure, and please keep us in mind and spread the word
about Solliance as a great new company available to help you build and deliver your
products fast and well.
</p>
        <p>
Our site at <a href="http://www.solliance.net/">www.solliance.net</a> is a little
sparse at the moment, we haven't had time to get that all fleshed out and beautified
quite yet, but we'll get it there shortly. We will be adding an events feed for all
the conferences, classes, and other activities we will be participating in, feeds
for our articles and other publications, and other resources such as sample code,
slide decks, etc over time. So be sure to revisit the site in a month or so to see
all that stuff after it has been lit up more fully.
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=fac4fead-71d0-42d2-81d9-49f236d3911b" />
      </div>
    </content>
  </entry>
  <entry>
    <title>New Pluralsight Course: Building Windows 8 MVVM XAML Apps</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2012/11/21/NewPluralsightCourseBuildingWindows8MVVMXAMLApps.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,60fb06f9-68ec-49d1-a92b-8fa15aad65ec.aspx</id>
    <published>2012-11-21T02:04:28.4878251+00:00</published>
    <updated>2012-11-21T02:04:28.4878251+00:00</updated>
    <author>
      <name>Brian Noyes</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
My new course went live today at Pluralsight.com: <a href="http://pluralsight.com/training/Courses/TableOfContents/win8mvvm" target="_blank">Building
Windows 8 MVVM XAML Apps</a>. It was a lot of fun making this course and I plan to
do a lot more Pluralsight courses in the future. I wanted to give you a quick rundown
of what the course contains beyond just what you see in the outline at the link above.
</p>
        <p>
It is important to point out that 70% or more of the content of this course apply
equally to WPF and Silverlight developers. There are some Windows 8 specifics in the
first module and in the one on navigation. But otherwise the rest of the course applies
just as much to any XAML technology.
</p>
        <h4>Windows 8 MVVM Fundamentals
</h4>
        <p>
In this module I cover the basic concepts of what it means to be a Windows 8 / Windows
Store / Modern UI / WinRT app – the app style formerly known as “Metro”. I cover some
of the nuances of what differentiates those terms and what the requirements are to
be one, as well as how it affects you in designing the app. Then I talk about the
design goals of MVVM, some background on how it relates to MVC and MVP, and also how
MVVM is a shared pattern across other XAML technologies.
</p>
        <h4>
        </h4>
        <h4>Getting Started with MVVM
</h4>
        <p>
This module is partly about what you need to know to get started with MVVM, as well
as some core concepts, or a quickstart on MVVM at the end of the module. I cover fundamentals
of Data Binding, Property and Collection Change events, and Commands as platform level
features that you need to understand and leverage to do MVVM in the first place. Then
I talk about the up front, 5 minute elevator pitch of what you need to know about
MVVM in a single slide, and then demo a simple MVVM application showing how all those
things come together.
</p>
        <h4>Structuring an App with MVVM
</h4>
        <p>
This is one of the most important modules in the course. It is where I drill into
the fundamental responsibilities of Views, ViewModels, and Models and how they relate
to one another and how to get them wired up to one another. Then I dig into the communications
between Views and ViewModels, talking about and demonstrating how and when to use
PropertyChanged notificiations from the ViewModel or Model properties up to the View,
Commands from the View down into the ViewModel, property setting from the View as
a means of communication down into the ViewModel, and direct calls from the ViewModel
up to the View when necessary through an interface abstraction.
</p>
        <h4>MVVM Support – Behaviors and Repositories
</h4>
        <p>
This module covers two related concepts that become very important when trying to
stick to the MVVM pattern: how to define and use Behaviors (both Attached and Blend-style
behaviors) to add functionality into a view that the elements don’t directly support
themselves, such as transforming a control event into a command invocation on the
ViewModel. Then I talk about repositories, which are a pattern that you can use on
the client side to decouple your view models from how data gets into and out of your
UI layer. And of course I have good demos of how to create a use an Attached Behavior,
a Blend-style behavior with <a href="http://winrtbehaviors.codeplex.com/" target="_blank">WinRtBehaviors</a> (
a great little community NuGet package to help us bridge the gap until the Blend team
gets around to getting us a Blend SDK for WinRT), and a Respository that uses the
new async/await keywords (the Task-Based Async Pattern).
</p>
        <h4>Dynamic MVVM Structuring
</h4>
        <p>
In this module I cover how to get Views and ViewModels dynamically associated and
hooked up through DataTemplates in a container control such as a ContentControl or
FlipView, using a two level ViewModel hierarchy where a parent view model exposes
a collection of child view models, which get rendered based on a DataTemplate associated
with them. In WinRT this requires a DataTemplateSelector, which I also show how to
define and use in the demo. Then I talk about the concept of ViewModelLocators and
show two different ways to get them defined and use them – one through an object you
can put in Application Resources that returns view models through bound properties
similar to how <a href="http://mvvmlight.codeplex.com/" target="_blank">MVVM Light</a> does
it, and one that uses an attached property and convention over configuration to automatically
select a view model.
</p>
        <h4>Windows Store Application Navigation with MVVM
</h4>
        <p>
In this module I get into the navigation mechanisms of WinRT and also how they tie
in with the application lifecycle of suspend-terminate-resume. I cover the build in
project templates and common infrastructure classes that get injected into those project
by default, and how the navigation and state management works using those templates
with no MVVM in the equation. Then I show how you can delegate responsibility to the
ViewModel for persisting the state it is managing and giving it control of when and
where to navigate to.
</p>
        <h4>MVVM Maintainability
</h4>
        <p>
One of the benefits of using MVVM is better testability of your UI logic code. It
is also important to be able to leverage the full capabilities of both the Visual
Studio and Expression Blend designers for better productivity in laying out and hooking
up the elements in your views. So in this module I show how to use the MVVM pattern,
but still have access to the exposed properties of your view model and model objects
for design time hookup without having to edit the XAML, as well as being able to show
custom design time data in the designer while you work on laying out and sizing the
elements in your UI. Then I get into the concepts of unit testing and mocking and
demonstrate some common approaches to testing your view model and mocking out its
dependencies for unit tests.
</p>
        <h4>MVVM Toolkits
</h4>
        <p>
In the last module, I give you a quick intro to some of the most popular MVVM toolkits
/ frameworks out there, specifically <a href="http://mvvmlight.codeplex.com/" target="_blank">MVVM
Light</a>, <a href="http://caliburnmicro.codeplex.com/" target="_blank">Caliburn Micro</a>,
and the Microsoft patterns and practices guidance/toolkits <a href="http://prism.codeplex.com/" target="_blank">Prism</a> and
a follow on they are working on now for WinRT (and I am part of the team for like
I was on <a href="http://briannoyes.net/2008/04/29/PrismCompositeWPFGuidance.aspx" target="_blank">Prism
1</a> and <a href="http://briannoyes.net/2010/06/03/Prism40FirstDropIsOnCodePlex.aspx" target="_blank">Prism
4</a>).
</p>
        <p>
So if you don’t already have a Pluralsight subscription, I recommend you get one and
check it out!
</p>
        <p>
I’m looking forward to any feedback, so if you have some, please make sure to share
it.
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=60fb06f9-68ec-49d1-a92b-8fa15aad65ec" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Building Windows Store Apps with MVVM–NOVA Code Camp talk</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2012/10/29/BuildingWindowsStoreAppsWithMVVMNOVACodeCampTalk.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,a6cac158-6813-4111-94d6-0e6ab2c80de4.aspx</id>
    <published>2012-10-29T00:02:49.4467245+00:00</published>
    <updated>2012-10-29T00:02:49.4467245+00:00</updated>
    <author>
      <name>Brian Noyes</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Yesterday I gave a talk at NOVA Code Camp on building Windows Store (Windows 8) apps
using the MVVM pattern. I covered the core concepts of the pattern and why you might
want to use it, as well as emphasizing that it is less important in a Windows Store
application because you shouldn’t be building apps with hundreds of screens in that
world, but still a good thing to do for testability and good separation of concerns
that MVVM gives you.
</p>
        <p>
The slides and demos from the talk are below for your perusal.
</p>
        <p>
          <a href="http://dl.dropbox.com/u/7366831/downloads/CodeCamps/Win8MVVM-10-27-2012.pdf" target="_blank">Slides</a>
        </p>
        <p>
          <a href="http://dl.dropbox.com/u/7366831/downloads/CodeCamps/Win8MVVMDemos-10-27-2012.zip" target="_blank">Demos</a>
        </p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=a6cac158-6813-4111-94d6-0e6ab2c80de4" />
      </div>
    </content>
  </entry>
  <entry>
    <title>VSLive! Redmond Slides and Demos</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2012/08/09/VSLiveRedmondSlidesAndDemos.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,b139ae7f-3143-4f41-9733-f65efe8c1f72.aspx</id>
    <published>2012-08-09T17:14:56.2432626+00:00</published>
    <updated>2012-08-09T17:14:56.2432626+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’m giving two talks today at VSLive! Redmond. You can grab the slides and demos below.
</p>
        <p>
Blissful Separation of Concerns with MVVM – core concepts and implementation of MVVM
</p>
        <p>
          <a href="http://www.softinsight.com/downloads/Conferences/VSLive/BlissfulSeparationOfConcernsWithMVVM.pdf" target="_blank">Slides</a>    <a href="http://www.softinsight.com/downloads/Conferences/VSLive/MVVMDemo.zip" target="_blank">Demos</a></p>
        <p>
Building Extensible XAML Client Applications – using MEF, MVVM, and Prism to build
highly extensible and loosely coupled XAML apps
</p>
        <p>
          <a href="http://www.softinsight.com/downloads/Conferences/VSLive/BuildingExtensibleXAMLClientApps.pdf" target="_blank">Slides</a>   <a href="http://www.softinsight.com/downloads/Conferences/VSLive/BuildExtensibleXAMLClientApps.zip" target="_blank">Demos</a></p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=b139ae7f-3143-4f41-9733-f65efe8c1f72" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Setting up a Minecraft Server (or other software) in the Cloud on a Windows Azure Virtual Machine</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2012/08/08/SettingUpAMinecraftServerOrOtherSoftwareInTheCloudOnAWindowsAzureVirtualMachine.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,e0a58c1f-41cd-43cf-a3d5-562793d64061.aspx</id>
    <published>2012-08-08T02:43:51.6615995+00:00</published>
    <updated>2012-08-08T02:43:51.6615995+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
My son’s latest addiction is the game <a href="http://minecraft.net/" target="_blank">Minecraft</a>, 
a single or multiplayer game that has a client-server architecture to it, millions
of users, a newly released version (as of last week), and a vibrant community. When
I first saw the game I was put off by the seemingly crude graphics (a cube-constructed
world with overlaid textures on the blocks), but I quickly got over that when I saw
how it was both fun to play, sparks creativity in the way it has you gather materials
and craft things in survival mode or encourages major creativity in building structures
and contraptions in creative mode. I’m also impressed by the huge and vibrant community
of people playing and extending the game with plug-ins (mods), custom maps, and public
server worlds you can go and play in through sites like <a href="http://planetminecraft.net">http://planetminecraft.net</a>.
</p>
        <p>
          <a href="http://minecraft.net/">
            <img title="156faa1b_Minecraft-logo" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="156faa1b_Minecraft-logo" src="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/Setting-up-a-Minecraft-Server-on-a-Windo_7CD3/156faa1b_Minecraft-logo_3.png" width="411" height="89" />
          </a>    <a href="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/Setting-up-a-Minecraft-Server-on-a-Windo_7CD3/windows_azure_small_2.jpg"><img title="windows_azure_small" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="windows_azure_small" src="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/Setting-up-a-Minecraft-Server-on-a-Windo_7CD3/windows_azure_small_thumb.jpg" width="200" height="114" /></a></p>
        <p>
          <strong>Setting up a Minecraft Server</strong>
        </p>
        <p>
With Minecraft you can play single player on a local machine, or you can connect to
remote servers. If you are a power user or someone with some IT chops you can easily
set up a server of your own for which there are dozens of simple tutorials out there.
It basically involves downloading the server software, running it, disabling any intervening
firewalls, and typing in an IP address on the client to the server machine.
</p>
        <p>
Of course what comes next is “Dad, can my friends connect to my Minecraft server?” 
</p>
        <p>
So I went down that route and configured our home router to do port forwarding to
allow open internet traffic to come into the port that Minecraft uses to a machine
on our home network. Not too tough and again dozens of tutorials out there that will
walk you through that. The scary part there is poking holes in your firewall to allow
unknown (and sometimes malicious) parties into your home network and onto a machine
that may have other personal information on it. You also have the fact that one of
the most important factors in smooth gameplay when connecting to a server is the bandwidth
of the connection. If you don’t have a screaming fast internet connection, or have
bandwidth limitations on your connection, you could simply be setting up an unusable
server in the first place.
</p>
        <p>
          <strong>Enter Windows Azure Virtual Machines</strong>
        </p>
        <p>
Being a Microsoft Windows Azure Insider, it naturally occurred to me that there is
some infrastructure out there that is optimal for this kind of shared access – Windows
Azure. Windows Azure has a lot of capabilities to it including shared host roles,
storage, access control and more – what is generally referred to as PaaS – Platform
as a Service. But a relatively new offering from Windows Azure is IaaS – Infrastructure
as a Service – which includes virtual machine hosting.
</p>
        <p>
The benefits of doing something like this on a Windows Azure virtual machine are many:
</p>
        <ul>
          <li>
Full control of the machine 
</li>
          <li>
Very high bandwidth connections to Windows Azure data centers 
</li>
          <li>
Scalable architecture to accommodate different amounts of load 
</li>
          <li>
Redundancy and geo-distribution for high availability if appropriate 
</li>
          <li>
Simple set up and administration 
</li>
        </ul>
        <p>
If you, like me, are just trying to get something up and running for your kids and
don’t want to have to spend any money at all, then setting up a server on a home computer
is going to be your cheapest option. But it does have the downsides of not being able
to support many players, possibly slow /  glitchy performance, and raises some
security concerns about exposing your machines and network. 
</p>
        <p>
With Windows Azure you can set up a free 3 month trial that includes 150 compute hours
(the primary unit of billing for an Azure virtual machine), which means you can run
for a month continuous free, or you can shut it down at times and only spin it up
while it is in use and potentially stretch that 150 hours over a 3 month free period.
After that, if you stay with an “Extra Small Instance” that can accommodate up to
about 8 players concurrently for less than $10 per month.
</p>
        <p>
So lets step through what I did to get this set up and running.
</p>
        <p>
          <strong>Setting up a Windows Azure Account</strong>
        </p>
        <p>
If you don’t already have a Windows Azure account, you can go and create a free trial
easily <a href="https://www.windowsazure.com/en-us/pricing/free-trial/">here</a>. 
</p>
        <p>
          <a href="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/Setting-up-a-Minecraft-Server-on-a-Windo_7CD3/FreeTrial_2.png">
            <img title="FreeTrial" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="FreeTrial" src="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/Setting-up-a-Minecraft-Server-on-a-Windo_7CD3/FreeTrial_thumb.png" width="537" height="404" />
          </a>
        </p>
        <p>
After setting up your account, you will follow the link/button in the upper right
corner to the Portal. At the time of writing this, they are switching the management
portal over from an old one to a new one, so you might be prompted to use the preview
portal. If so, click to use the preview one. You will be presented with a welcome
tour the first time in, feel free to go through that to get a sense of what all is
there.
</p>
        <p>
The virtual machine capabilities of Windows Azure are still in preview status, so
initially you won’t see anything about virtual machines in your portal. To get to
them, you can click the + at the bottom of the screen for adding new services, and
follow the link from the virtual machine option to sign up for the preview program.
Depending on when you are reading this, that may no longer be needed if you see virtual
machines listed in the main navigation on the left in the portal. Follow the link
from the greyed out virtual machine item and click the Try It Now button. Then follow
the link back to the management portal and you will see virtual machines as one of
your services.
</p>
        <p>
          <a href="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/Setting-up-a-Minecraft-Server-on-a-Windo_7CD3/Virtual%20machines_2.png">
            <img title="Virtual machines" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Virtual machines" src="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/Setting-up-a-Minecraft-Server-on-a-Windo_7CD3/Virtual%20machines_thumb.png" width="532" height="365" />
          </a>
        </p>
        <p>
          <strong>Creating your first virtual machine</strong>
        </p>
        <p>
Click on the link to create a new virtual machine, and chose the option to create
from the gallery. I chose to use Windows Server 2008 R2 SP1, June 2012 template, but
you can choose one of the others as appropriate for your needs.
</p>
        <p>
In the step for VM Configuration, enter a virtual machine name – this is what will
be listed in your portal and has a length limitation to it, a password for the admin
account, and a size. The Extra Small size is going to be the cheapest once you start
paying (&lt;$10/mo), but your free trial includes a small instance, so if you want
more memory for better performance during your trial period, leave the default of
small. You can change the sizing of your virtual machine later by deleting it and
adding it back with a different instance size so you could switch to extra small once
you have to start paying.
</p>
        <p>
          <a href="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/Setting-up-a-Minecraft-Server-on-a-Windo_7CD3/VMConfiguration_2.png">
            <img title="VMConfiguration" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="VMConfiguration" src="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/Setting-up-a-Minecraft-Server-on-a-Windo_7CD3/VMConfiguration_thumb.png" width="503" height="403" />
          </a>
        </p>
        <p>
In the VM Mode screen, you pick your VERY IMPORTANT DNS name. This is what users will
use to connect to your virtual machine as an address from the internet, so think about
what you want ahead of time. The name you pick will have to be unique across all Azure
virtual machines already out there, so you may not be able to use something too simple.
</p>
        <p>
          <a href="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/Setting-up-a-Minecraft-Server-on-a-Windo_7CD3/VMMode_2.png">
            <img title="VMMode" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="VMMode" src="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/Setting-up-a-Minecraft-Server-on-a-Windo_7CD3/VMMode_thumb.png" width="513" height="407" />
          </a>
        </p>
        <p>
The other defaults in this step will be fine. For the final step, just leave the Availability
Set Not Set and click the check mark to complete the wizard. You will see your virtual
machine listed now and it will start in a state of “Provisioning”.
</p>
        <p>
          <a href="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/Setting-up-a-Minecraft-Server-on-a-Windo_7CD3/Provisioning_2.png">
            <img title="Provisioning" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Provisioning" src="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/Setting-up-a-Minecraft-Server-on-a-Windo_7CD3/Provisioning_thumb.png" width="412" height="148" />
          </a>
        </p>
        <p>
It will transition through “Starting (Provisioning)” to “Stopped” to “Running (Provisioning)”
over a period of about 5-10 minutes. <strong><em>It is important to realize that stopped
virtual machines still consume compute hours</em></strong>. The reason is that hardware
resources are still reserved for them an unavailable for other customers. You have
to remove your virtual machine to stop incurring charges for it, which I’ll talk about
later in this post.
</p>
        <p>
          <strong>Connecting to your virtual machine</strong>
        </p>
        <p>
Once the status reaches at least “Running (Provisioning)” you can click on the Connect
button at the bottom. This will try to open an rdp file, which is a Remote Desktop
connection file. Click on the Open prompt in the browser or download the file and
then open it to open Remote Desktop Connection and connect to your virtual machine.
Accept the various connect prompts and enter the password you chose in the earlier
step for the admin password to connect. Next thing you know you will be staring at
the desktop of your newly provisioned machine with the Initial Configuration Tasks
window in front of you.
</p>
        <p>
          <strong>Opening the Minecraft ports in the Windows Firewall</strong>
        </p>
        <p>
Minecraft uses port 25565 by default, so we need to unblock that in preparation for
running Minecraft server. Since the Windows Firewall is one of the tasks in the Initial
Confguration Tasks window before us, we might as well tackle that now. Click on Configure
Windows Firewall at the bottom of the window. Click on Advanced Settings, then Inbound
Rules in the tree. Click on New Rule in the upper right, then select Port and click
Next at the bottom of the dialog. Type in 25565 in the specific local ports entry
and click Next. Keep “Allow the Connection” in the next step, then keep all the checkboxes
checked in the next step. Give the new rule a name of Minecraft in the next step and
click Finish.
</p>
        <p>
          <strong>Turn off Internet Explorer ESC</strong>
        </p>
        <p>
Internet Explorer has Enahnced Security Configuration enabled by default. This will
interfere with some of the downloads you need to do to get Minecraft installed, so
you need to turn this off. In the Server Manager window that came up when you went
to advanced firewall settings, there is a link in the bottom right corner to configure
ESC. Click on that link and disable ESC for Administrators.
</p>
        <p>
          <a href="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/Setting-up-a-Minecraft-Server-on-a-Windo_7CD3/ServerManager_2.png">
            <img title="ServerManager" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="ServerManager" src="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/Setting-up-a-Minecraft-Server-on-a-Windo_7CD3/ServerManager_thumb.png" width="548" height="398" />
          </a>
        </p>
        <p>
          <strong>Install Java</strong>
        </p>
        <p>
Minecraft is built on Java, so you need to get the Java platform installed. The OS
of the Windows Azure virtual machine I selected was Server 2008, and they use the
64 bit variant. So you will want to make sure you get the 64 bit version of Java 7,
not the 32 bit one that they want to install by default. To do this, fire up Internet
Explorer from the start menu, accepts the defaults on the initial configuration of
IE, and head on over to <a href="http://www.java.com">www.java.com</a>, click the
Free Download button, and then find and click the See All Java Downloads link. Download
and install the 64 bit version for Windows.
</p>
        <p>
          <strong>Installing Minecraft Server</strong>
        </p>
        <p>
While Java is installing, you can head over to minecraft.net and find the download
button on the right margin. You will have to set up an account ($27 annual), but I’m
assuming you are well past that point if you want to set up your own server already.
You could download the Minecraft Server.exe, but the .jar version gives you better
configurability of the memory it will use, which is important for the memory constrained
extra small instance or small instance in Windows Azure. So download the minecraft_server.jar
file to the desktop of your virtual machine. It actually downloads it as a .zip file
extension even though it is really a .jar file.
</p>
        <p>
Go into your Windows Explorer Folder and Search Options and disable the option to
“Hide Extensions for Known File Types” so that you can see the .jar file extension
on the file you just downloaded.
</p>
        <p>
Once you see the .zip file extension, change it to .jar.
</p>
        <p>
Right click on the desktop and select New &gt; Text Document. Name it Minecraft.bat
and accept the file extension change. If you are not prompted for changing the file
extension then you don’t have the option off to not hide file extensions and the file
won’t run as a batch file. Then right click on the file and select Edit. Enter this
text in the bat : 
</p>
        <p>
@ECHO OFF 
<br />
SET BINDIR=%~dp0 
<br />
CD /D "%BINDIR%" 
<br />
java -Xmx512M -Xms512M -jar minecraft_server.jar 
<br />
PAUSE
</p>
        <p>
If you are using a small instance instead of an extra small instance for your virtual
machine, you can bump both of those numbers up to 1024 instead of 512. Those affect
how much memory the Java virtual machine will try to consume. Save the file and close
it. 
</p>
        <p>
Create a folder on the desktop (call it Minecraft or whatever you like and move both
the minecraft_server.jar and the Minecraft.bat file into it.
</p>
        <p>
Then double click on Minecraft.bat to run it.
</p>
        <p>
You should see the Minecraft server start up and it will create some additional files
in the folder. For the full details of those files and what they do for you, see the
Minecraft Server topic on the <a href="http://www.minecraftwiki.net/wiki/Servers" target="_blank">Minecraft
Wiki</a>.
</p>
        <p>
          <strong>Configuring endpoints</strong>
        </p>
        <p>
Besides the firewall built in to the Windows OS that we opened the Minecraft port
on earlier, you also need to open ports in the Azure infrastructure so that people
can get to your virtual machine in the first place. To do that, you go to the Endpoints
button at the top, add a new endpoint, give it a name (i.e. Minecraft), and specify
the external and internal ports. For a default Minecraft setup, those will both be
25565.
</p>
        <p>
          <strong>Play!</strong>
        </p>
        <p>
At this point you should be able to go into the Minecraft game on any internet connection
computer, Add a Server, and enter the address of your server in the form mymcserverdns.cloudapp.net.
</p>
        <p>
          <strong>Deleting your virtual machine to avoid incurring charges</strong>
        </p>
        <p>
As mentioned before, your virtual machine will continue to consume compute hours while
it is running and even if you simply shut it down. You need to delete or remove the
virtual machine to stop the clock ticking on your compute hours. Deleting your virtual
machine does not mean you have to set it all up again when you want to start it up
again. When you delete a virtual machine, the machine image is stored into your storage
account, and you can easily create a new virtual machine based on that image and it
will start up with everything just as you left it before you deleted the virtual machine.
</p>
        <p>
To do this, go into the management portal, open your virtual machine page, and click
on the Delete button at the bottom.
</p>
        <p>
          <a href="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/Setting-up-a-Minecraft-Server-on-a-Windo_7CD3/DeletingServer_2.png">
            <img title="DeletingServer" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="DeletingServer" src="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/Setting-up-a-Minecraft-Server-on-a-Windo_7CD3/DeletingServer_thumb.png" width="634" height="398" />
          </a>
        </p>
        <p>
 
</p>
        <p>
          <strong>Recreating your virtual machine to spin it up again</strong>
        </p>
        <p>
After your virtual machine has been deleted, a “Cloud Service” with the same name
will be created that holds the DNS name for your virtual machine. You will need to
delete that cloud service to recreate your virtual machine with the same DNS. So go
select the cloud service with the same name as your virtual machine and delete it.
</p>
        <p>
Next you go back to the virtual machine section and add a new virtual machine. Select
the Gallery, and you will see your previous virtual machine listed at the bottom.
</p>
        <p>
          <a href="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/Setting-up-a-Minecraft-Server-on-a-Windo_7CD3/Recreate%20vm_2.png">
            <img title="Recreate vm" style="border-left-width: 0px; border-right-width: 0px; background-image: none; border-bottom-width: 0px; padding-top: 0px; padding-left: 0px; display: inline; padding-right: 0px; border-top-width: 0px" border="0" alt="Recreate vm" src="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/Setting-up-a-Minecraft-Server-on-a-Windo_7CD3/Recreate%20vm_thumb.png" width="562" height="450" />
          </a>
        </p>
        <p>
Select it, and in the next step, reclaim your previous DNS name and you are off and
running again. When the machine finishes provisioning, you will have your previous
machine as you left it.
</p>
        <p>
If you want a little more automated process for doing this, as well as not letting
someone else have the opportunity to grab your DNS name between when you delete it
and reclaim it, you can follow use the powershell scripts outlined here:
</p>
        <p>
          <a href="http://michaelwasham.com/2012/06/18/importing-and-exporting-virtual-machine-settings/">http://michaelwasham.com/2012/06/18/importing-and-exporting-virtual-machine-settings/</a>
        </p>
        <p>
          <strong>Other options</strong>
        </p>
        <p>
Once you want more than about 10 concurrent players supported, a Windows Azure machine
is going to get more expensive than some of the Minecraft hosting providers out there,
for example servercraft.co.
</p>
        <p>
          <strong>Wrapping Up</strong>
        </p>
        <p>
Whether you are trying to set up a Minecraft server or some other kind of internet
accessible piece of software, Windows Azure provides an attractive and easy to use
hosting option. Setting up your own virtual machine you have full control over installing
whatever software you need and configuring the box. The machine is sitting in a high
bandwidth data center that can handle traffic much better than your own machines through
a home or small office connection. You don’t have to worry about exposing your own
machines or network to the open internet because you can put what you want to be publicly
accessible out in the cloud, isolated from your own stuff.
</p>
        <p>
Hope you found this little tutorial to be helpful.
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=e0a58c1f-41cd-43cf-a3d5-562793d64061" />
      </div>
    </content>
  </entry>
  <entry>
    <title>MADExpo and CapArea.NET talks</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2012/06/27/MADExpoAndCapAreaNETTalks.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,f78794f3-640a-4343-a94e-5f28b6ba95dd.aspx</id>
    <published>2012-06-27T19:29:18.0202531+00:00</published>
    <updated>2012-06-27T19:29:18.0202531+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Last night I spoke at CapArea.NET and presented a longer variant of the talk I am
giving today and tomorrow at the MADExpo conference in VA. I’m also giving a talk
on the Single Page Application capabilities in development for ASP.NET and the client
side Upshot library that provides a lot of its capabiities.
</p>
        <p>
Here are the slides and demos for those talks:
</p>
        <p>
Embrace Async    <a href="http://www.softinsight.com/downloads/Conferences/MADExpo/EmbraceAsync.pdf" target="_blank">Slides</a>    <a href="http://www.softinsight.com/downloads/Conferences/MADExpo/AsyncDemos.zip" target="_blank">Demos</a></p>
        <p>
Rich HTML 5 Client Data Applications with Upshot    <a href="http://www.softinsight.com/downloads/Conferences/MADExpo/RichHTML5ClientDataApps.pdf" target="_blank">Slides</a>    <a href="http://www.softinsight.com/downloads/Conferences/MADExpo/RichHTML5CDataClientDemos.zip" target="_blank">Demos</a></p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=f78794f3-640a-4343-a94e-5f28b6ba95dd" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Stronger User Access Control (UAC) Minimum in Windows 8</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2012/06/08/StrongerUserAccessControlUACMinimumInWindows8.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,e8a7e57e-6870-4e33-8434-e943f4865aae.aspx</id>
    <published>2012-06-08T19:51:38.3283184+00:00</published>
    <updated>2012-06-08T19:51:38.3283184+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I recently stumbled over a new feature in Windows 8 that some people, especially developers
may want to be aware of. In Windows 7 if you were logged in with a user account associated
with the Administrators group, and you turned the User Access Control (UAC) slider
down to its minimum level, you were basically running all apps as full admin permission.
</p>
        <p>
Once I started developing in Windows 8, I tried setting things up the same way but
was a little baffled when some things started prompting me for running as admin or
failing for permissions reasons. For example, launching a particular solution I was
working on in Visual Studio 2010 for debugging resulted in this:
</p>
        <p>
          <a href="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/d3b3146fe1fa_BB35/AdminPermission_4.png">
            <img title="AdminPermission" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="AdminPermission" src="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/d3b3146fe1fa_BB35/AdminPermission_thumb_1.png" width="476" height="317" />
          </a>
        </p>
        <p>
And several command line scripts that I have to run on a regular basis for development
were failing as well.
</p>
        <p>
The fix was simply to make sure I launched whatever process was failing with “Run
as Administrator”. But that seemed weird because I thought I was running as Administrator.
</p>
        <p>
I did some digging with the Windows 8 team and found out that in fact they have made
some changes in UAC. Even though the dialog looks the same as it did in Windows 7
and says “Never Notify”:
</p>
        <p>
          <a href="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/d3b3146fe1fa_BB35/6-8-2012%201-30-02%20PM_2.png">
            <img title="6-8-2012 1-30-02 PM" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="6-8-2012 1-30-02 PM" src="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/d3b3146fe1fa_BB35/6-8-2012%201-30-02%20PM_thumb.png" width="402" height="298" />
          </a>
        </p>
        <p>
The underlying meaning of that setting is a little different. Instead of “UAC off”
it really means “UAC auto-approve/never prompt” but not <i>actually</i> off. If something
actually needs full admin permissions to run, you will have to explicitly run the
process as Administrator. 
</p>
        <p>
The team also said that apps that require implicit Administrator permissions to run
are considered obsolete and only partially supported. 
</p>
        <p>
So if you have been using Administrator permissions required as a crutch in your applications,
get over it. And as a dev, you might sometimes have to explicitly start processes
as Adminstrator even if you did not in Windows 7.
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=e8a7e57e-6870-4e33-8434-e943f4865aae" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Upcoming VSLive! Redmond Talks -  Register Now!</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2012/05/29/UpcomingVSLiveRedmondTalksRegisterNow.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,7f3559a5-1186-4fa9-97c5-e1e1ff7d6e8f.aspx</id>
    <published>2012-05-29T22:55:50.561441+00:00</published>
    <updated>2012-05-29T22:55:50.561441+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’m really looking forward to speaking at VSLive! Redmond this year and think it is
going to be a great conference. As usual there is a star studded lineup of speakers
with great topics.
</p>
        <p>
I’ll be giving two talks – Blissful Separation of Concerns with MVVM, and Building
Extensible XAML Client Applications.
</p>
        <p>
If you are interested in the conference, now is the time to register since the super
early bird special is up on June 1 and the early bird doesn’t go too far beyond that.
Click on the image below to get registered now for a great conference!
</p>
        <p>
          <a href="http://vslive.com/Events/Redmond-2012/Home.aspx?utm_source=AttendeeMktg&amp;utm_medium=Banner%20Ad&amp;utm_campaign=VNSP20">
            <img title="VSLRED12 Speaker Incentive_Noyes" style="border-top: 0px; border-right: 0px; background-image: none; border-bottom: 0px; padding-top: 0px; padding-left: 0px; border-left: 0px; display: inline; padding-right: 0px" border="0" alt="VSLRED12 Speaker Incentive_Noyes" src="http://www.softinsight.com/bnoyes/content/binary/Windows-Live-Writer/Upcoming-VSLive-Redmond-Talks_10966/VSLRED12%20Speaker%20Incentive_Noyes_3.jpg" width="129" height="129" />
          </a>
        </p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=7f3559a5-1186-4fa9-97c5-e1e1ff7d6e8f" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Book Review: Microsoft Silverlight 5 and Windows Azure Enterprise Integration</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2012/05/25/BookReviewMicrosoftSilverlight5AndWindowsAzureEnterpriseIntegration.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,0d158774-bb50-4f4f-bae6-0b05400db436.aspx</id>
    <published>2012-05-25T12:24:58.8232537+00:00</published>
    <updated>2012-05-25T12:24:58.8232537+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I finally got the time to finish reading and reviewing the book <a href="http://www.packtpub.com/microsoft-silverlight-5-enterprise-integration-on-windows-azure/book">Microsoft
Silverlight 5 and Windows Azure Enterprise Integration</a>. By the way, the initial
promotion of the book is up at the end of May, so now would be a good time to go buy.
</p>
        <p>
My high level summary is this: 
</p>
        <p>
I think this book is an outstanding read and resource for developers and architects
who are getting started with Windows Azure and what is involved in building cloud-based
solutions. It does a great job of covering most of the capabilities exposed by the
Windows Azure platform, and tying them into a Silverlight application context through
the samples presented throughout the chapters. You do not have to be a Silverlight
client developer to benefit from this book – any .NET developer who wants to start
building applications leveraging the Windows Azure cloud can start with this book
to get a great sense of what the individual features of Windows Azure are and how
they can tie into either a web-based front end client like Silverlight or ASP.NET
or even how to tie them in with back-end services that support something like a WPF
or Metro client app (even though those are not explicitly covered in the book).
</p>
        <p>
I won’t do a chapter-by-chapter break down of the book, a quick look at the <a href="http://www.packtpub.com/microsoft-silverlight-5-enterprise-integration-on-windows-azure/book">TOC</a> will
give a good sense of what is covered. One of the main downsides to this book I think
is the title. It is less about Silverlight than it is about Windows Azure (and as
mentioned, you definitely don’t need to be a Silverlight developer to get a lot out
of the book if you are new to Azure), and the “Enterprise Integration” part of the
title is kind of vague and misleading. The “integration” part is one of the strong
aspects of the book, it does a good job of first educating you on what each of the
Windows Azure services is, and then shows how to build applications that leverage
one or more of those services in an integrated fashion.
</p>
        <p>
You are not going to learn how to build Silverlight applications from this book, or
even become an expert in Windows Azure. Each feature of Azure really needs a book
unto itself to achieve expert level knowledge in it. But this book is great for building
the big picture of what each Windows Azure capability is, what it does for your architecture,
how to use it from a basics perspective, and also how to tie it in with other Azure
services and your application architecture.
</p>
        <p>
Some of the things you get expose to in the book are:
</p>
        <p>
- How to get your development environment set up to do Azure development, as well
as a good survey of related and useful tools for building Silverlight and web client
application on Azure
</p>
        <p>
- A good survey of all the Windows Azure features
</p>
        <p>
- How to get web client and Silverlight client applications and services hosted in
Windows Azure web roles
</p>
        <p>
- Working with Azure queues, blob storage, and tables
</p>
        <p>
- Working with SQL Azure, Entity Framework, WCF RIA Services, and OData (very light
coverage on the latter three, but enough to see how they fit into an Azure deployment
scenario on top of SQL Azure)
</p>
        <p>
- Basics of securing your Azure hosted applications
</p>
        <p>
- Scaling and using AppFabric Cache
</p>
        <p>
Bottom line, think it is definitely a good read for someone wanting to get their hands
dirty for the first time doing some cloud Azure development, especially (but not only)
if you are a Silverlight developer.
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=0d158774-bb50-4f4f-bae6-0b05400db436" />
      </div>
    </content>
  </entry>
  <entry>
    <title>VSLive! NYC Talks and Demos</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2012/05/16/VSLiveNYCTalksAndDemos.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,0b3e1c96-c643-47a4-a12f-5121162aed59.aspx</id>
    <published>2012-05-16T20:10:30.1901437+00:00</published>
    <updated>2012-05-16T20:10:30.1901437+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I presented 4 sessions at VSLive NYC over the last two days and had a great time.
I love the set up of this conference – not too spread out, good sized rooms, great
attendees, and lots of great speakers.
</p>
        <p>
Below are the slides and demos for those interested, enjoy!
</p>
        <p>
Build Extensible XAML Client Applications:   <a href="http://www.softinsight.com/downloads/Conferences/VSLive/BuildingExtensibleXAMLClientApps.pdf" target="_blank">Slides</a>   <a href="http://www.softinsight.com/downloads/Conferences/VSLive/BuildExtensibleXAMLClientApps.zip" target="_blank">Demos</a></p>
        <p>
Build Portable XAML Client Code and Resources:   <a href="http://www.softinsight.com/downloads/Conferences/VSLive/BuildPortableXAMLClients.pdf" target="_blank">Slides</a>   <a href="http://www.softinsight.com/downloads/Conferences/VSLive/MusicClientDemo.zip" target="_blank">Demos</a></p>
        <p>
Secure and Personalize Silverlight 5 Apps:   <a href="http://www.softinsight.com/downloads/Conferences/VSLive/SecuringandPersonalizingSilverlight5ClientApps.pdf" target="_blank">Slides</a>   <a href="http://www.softinsight.com/downloads/Conferences/VSLive/SecureandPersonalizeSilverlight5Apps.zip" target="_blank">Demos</a></p>
        <p>
Learn to Behave – Extending XAML with Client Behaviors:   <a href="http://www.softinsight.com/downloads/Conferences/VSLive/LearntoBehave-ExtendingXAMLwithCustomBehaviors.pdf" target="_blank">Slides</a>   <a href="http://www.softinsight.com/downloads/Conferences/VSLive/LearntoBehaveDemos-5-16-2012.zip" target="_blank">Demos</a></p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=0b3e1c96-c643-47a4-a12f-5121162aed59" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Upcoming Book Review&amp;ndash;Microsoft Silverlight 5 and Windows</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2012/04/21/UpcomingBookReviewndashMicrosoftSilverlight5AndWindows.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,11bf5d58-f784-4322-bf4a-0aa6c14a6d08.aspx</id>
    <published>2012-04-21T21:24:12.9942167+00:00</published>
    <updated>2012-04-21T21:24:12.9942167+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I picked up a book that looks very interesting:
</p>
        <a href="http://www.packtpub.com/microsoft-silverlight-5-enterprise-integration-on-windows-azure/book">Microsoft
Silverlight 5 and Windows Azure Enterprise Integration</a>
        <br />
        <p>
A bit of a mouthful, but the table of contents looks very good. There are a lot of
Silverlight books out there, but few that actually focus on all the other stuff you
need to know outside the boundary of your client application - the hosting, services,
and deployment to Windows Azure. Its got chapters focused on the hosting, working
with Azure storage, RIA Services, OData services and more. I'll write up a review
here in a couple weeks after I've had time to make it through it.
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=11bf5d58-f784-4322-bf4a-0aa6c14a6d08" />
      </div>
    </content>
  </entry>
  <entry>
    <title>DevConnections Demos and Slides&amp;ndash;Web API, Async, and Extensible XAML Clients</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2012/03/29/DevConnectionsDemosAndSlidesndashWebAPIAsyncAndExtensibleXAMLClients.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,3b77401b-2d9d-4484-add9-bee8957959e8.aspx</id>
    <published>2012-03-29T20:48:01.2051996+00:00</published>
    <updated>2012-03-29T20:48:01.2051996+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Today I am giving three sessions at DevConnections. The first on the new ASP.NET Web
API, both defining and consuming WEB API and RESTful services from many client platforms.
The second is on the new async patterns in .NET and WinRT with the Task-based Asynchronous
Pattern, TPL, and PFX. The last is on building extensible XAML client applications.
</p>
        <p>
You can grab the slides and demos below.
</p>
        <p>
Leveraging ASP.NET Web API to Reach Many Clients :   <a href="http://www.softinsight.com/downloads/DevConnections/Noyes_VS_VLA310_LeverageWebAPIToReachManyClients.pdf" target="_blank">Slides</a>    <a href="http://www.softinsight.com/downloads/DevConnections/VLA310_WebApiDemos.zip" target="_blank">Demos</a></p>
        <p>
Embrace Async:    <a href="http://www.softinsight.com/downloads/DevConnections/Noyes_VS_VLA412_EmbraceAsync.pdf" target="_blank">Slides</a>    <a href="http://www.softinsight.com/downloads/DevConnections/VLA412_AsyncDemos.zip" target="_blank">Demos</a></p>
        <p>
Building Extensible XAML Client Applications : <a href="http://www.softinsight.com/downloads/DevConnections/Noyes_H5C_CXA401_BuildingExtensibleClientApps.pdf" target="_blank">Sides</a>    <a href="http://www.softinsight.com/downloads/DevConnections/CXA401_XAMLClientExtensibilityDemos.zip" target="_blank">Demos</a></p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=3b77401b-2d9d-4484-add9-bee8957959e8" />
      </div>
    </content>
  </entry>
  <entry>
    <title>DevConnections Slides and Demos&amp;ndash;Upshot and Prism</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2012/03/28/DevConnectionsSlidesAndDemosndashUpshotAndPrism.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,6708ba40-d2f5-4f44-af00-054dcec7fb82.aspx</id>
    <published>2012-03-28T20:26:16.1033319+00:00</published>
    <updated>2012-03-28T20:26:16.1033319+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Today I’ll be giving two sessions at DevConnections. The first is on building Rich
HTML Client Data Applications with WCF RIA Services and Upshot. The second is on Building
Loosely Coupled XAML Client Applications with Prism.
</p>
        <p>
You can grab the slides and demos for these talks below.
</p>
        <p>
Rich HTML Client Data Applications with Upshot:   <a href="http://www.softinsight.com/downloads/DevConnections/Noyes_H5C_CHT303_RichHTML5ClientDataAppsWithUpshot.pdf" target="_blank">Slides</a>    <a href="http://www.softinsight.com/downloads/DevConnections/CHT303_UpshotDemos.zip" target="_blank">Demos</a></p>
        <p>
Building Loosely Coupled XAML Client Applications with Prism:     <a href="http://www.softinsight.com/downloads/DevConnections/Noyes_VS_VLA311_BuildingLooselyCoupledXAMLClientAppsWithPrism.pdf" target="_blank">Slides</a>    <a href="http://www.softinsight.com/downloads/DevConnections/VLA311_PrismDemos.zip" target="_blank">Demos</a></p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=6708ba40-d2f5-4f44-af00-054dcec7fb82" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Working With Prism 4 Part 4 Posted</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2012/02/17/WorkingWithPrism4Part4Posted.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,95ab2d4c-e46f-40c0-82b5-fa4f182a17ee.aspx</id>
    <published>2012-02-17T11:05:02.1077238+00:00</published>
    <updated>2012-02-17T11:05:02.1077238+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Part 4 of my article series on Prism 4 <a href="http://www.silverlightshow.net/items/Working-with-Prism-4-Part-4-Region-Navigation.aspx" target="_blank">is
live here</a>. In this article, I cover the navigation features that were added to
regions in Prism 4. These features let you use a loosely coupled URI-based navigation
scheme for changing out or activating views within a region. The views (or their view
models) can participate in the navigation by identifying if they are the target view
for a navigation action, can be notified when they are navigated to with URI parameters,
navigated away from. Additionally views (or their view models can decide if they should
be navigated away from (such as to prompt the user) and when it should happen.
</p>
        <p>
Read <a href="http://www.silverlightshow.net/items/Working-with-Prism-4-Part-4-Region-Navigation.aspx" target="_blank">all
the details here</a>!
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=95ab2d4c-e46f-40c0-82b5-fa4f182a17ee" />
      </div>
    </content>
  </entry>
  <entry>
    <title>DevConnections Coming&amp;ndash;Lots to Talk About</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2012/02/10/DevConnectionsComingndashLotsToTalkAbout.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,d9d307fe-2d66-4516-a897-0540b24231ab.aspx</id>
    <published>2012-02-10T17:22:38.7991209+00:00</published>
    <updated>2012-02-10T17:22:38.7991209+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://devconnections.com/home.aspx" target="_blank">DevConnections</a> Spring
2012 show is rapidly approaching, especially for us foolish speakers who submitted
a bunch of talks, got a bunch selected, and now have to have put the slides and demos
together in time for the show!
</p>
        <p>
This year I’ll be giving 5 talks – 3 in the Visual Studio track and 2 in the Silverlight
track. Here is a quick rundown of what I’ll be talking about.
</p>
        <p>
          <strong>VLA311 - Building Loosely Coupled XAML Apps with Prism</strong>
        </p>
        <p>
This will be a soup-to-nuts talk on what Prism has to offer, showing how you can employ
parts of Prism with a light touch on your app such as commands and events, or going
whole hog with what Prism has to offer by also embracing modularity and regions or
dynamically pluggable and extensible client apps.
</p>
        <p>
          <strong>VLA412 - Embrace Async</strong>
        </p>
        <p>
In this I’ll be covering the new Task-based Async Pattern (async keywords) coming
in .NET 4.5, Task Parallel Library, and a quick look at the Parallel class and PLINQ
for dealing with collections in an async way.
</p>
        <p>
          <strong>VLA310 - Leveraging Web API to Reach Many Client Platforms </strong>
        </p>
        <p>
This one will cover the basics of the new Web API stack that allows you to easily
expose HTTP services without needing to tackle the complexity of WCF, and also embrace
the full REST architectural style if you want. The session will show the basics of
exposing services with Web API on the service side, as well as how to consume them
from multiple client platforms including .NET, Silverlight, Metro, and iOS.
</p>
        <p>
          <strong>CXA401 - Building Extensible XAML Client Apps </strong>
        </p>
        <p>
This session covers a rich combination of using MEF, MVVM, and Prism to build highly
flexible and extensible XAML client applications. This one is an advanced session
that really requires a trace of exposure to at least of couple of those technologies
to really follow everything I’ll be packing into a 75 minute session. You’ll see how
the right structure in a core application can gain you a huge advantage in being able
to plug in new functionality without having to touch the core application code as
you add incremental new capabilities to the application.
</p>
        <p>
          <strong>CHT303 - Rich HTML5 Client Data Applications with WCF RIA Services </strong>
        </p>
        <p>
This session explores another great new capability coming in the next release of web
technologies. It covers a new set of JavaScript libraries being developed by Microsoft
to both extend the reach of WCF RIA Services to HTML client applications, and also
to allow rich stateful interactions with data on the client side of an HTML application
in JavaScript, following similar patterns as are used in Silverlight clients with
WCF RIA Services.
</p>
        <p>
I’m very excited about talking about all this cool new capability headed our way,
and hope to see you there!
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=d9d307fe-2d66-4516-a897-0540b24231ab" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Part 3 of my Prism 4 Series is out</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2012/01/29/Part3OfMyPrism4SeriesIsOut.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,7926bad7-6f77-4cb5-9e6d-cd9b57fe42fa.aspx</id>
    <published>2012-01-29T16:29:51.0368165+00:00</published>
    <updated>2012-01-29T16:29:51.0368165+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
PArt 3 of my series on Prism 4 is now live <a href="http://www.silverlightshow.net/items/Working-with-Prism-4-Part-3-Composite-Command-and-Pub-Sub-Events.aspx" target="_blank">on
the Silverlight Show here</a>. This one drills down into CompositeCommands and Prism
pub/sub events with the EventAggregator. I show how to use CompositeCommands to hook
up loosely coupled parts of the app but still have the enable/disable functionality
that commands off that events do not. Then I show using Prism events to keep two loosely
coupled parts of the user interface synchronized without them needing to know about
each other.
</p>
        <p>
Check it out!
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=7926bad7-6f77-4cb5-9e6d-cd9b57fe42fa" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Prism 4 Series on Silverlight Show</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2011/11/15/Prism4SeriesOnSilverlightShow.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,bf99d636-280f-4193-8273-2b5868182db4.aspx</id>
    <published>2011-11-15T01:55:39.643505+00:00</published>
    <updated>2011-11-15T01:55:39.643505+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’ve started a new article series on <a href="http://tinyurl.com/Prism4Series" target="_blank">The
Silverlight Show</a> site that will be covering Prism 4 end to end over about 5-6
articles. The first installment is up: <a href="http://tinyurl.com/Prism4Series" target="_blank">Working
with Prism 4 Series Part 1 – Getting Started</a>. This one covers the broad concepts
of what Prism is for, what features it offers, and walks you through putting together
a basic Prism app with one module and plugging a view into a region.
</p>
        <p>
I should be putting a new installment up every two weeks. In the next article, I’ll
be putting a little more functionality into a couple of views, including using commands
and the MVVM pattern, and communicating between the view with Prism loosely coupled
events. After that I will expand on using region navigation, implementing custom module
loaders, and other aspects.
</p>
        <p>
Hope you check it out!
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=bf99d636-280f-4193-8273-2b5868182db4" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Architecting Silverlight/WPF/Metro XAML Applications Class&amp;ndash;28 Nov 2011</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2011/11/11/ArchitectingSilverlightWPFMetroXAMLApplicationsClassndash28Nov2011.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,1dc587a6-85be-4296-940e-7d15c5b9ca49.aspx</id>
    <published>2011-11-11T18:55:23.3450852+00:00</published>
    <updated>2011-11-11T18:55:23.3450852+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
My class is now confirmed for 28 Nov – 2 Dec with our training partner Benchmark Learning,
but there are still seats available. You can find the full syllabus and registration
information here:
</p>
        <p>
          <a title="http://www.benchmarklearning.com/Courses/CrsDetail.aspx?C=IDWPFMaster" href="http://www.benchmarklearning.com/Courses/CrsDetail.aspx?C=IDWPFMaster">http://www.benchmarklearning.com/Courses/CrsDetail.aspx?C=IDWPFMaster</a>
        </p>
        <p>
Sign up now!
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=1dc587a6-85be-4296-940e-7d15c5b9ca49" />
      </div>
    </content>
  </entry>
  <entry>
    <title>DevConnections Slides and Demos&amp;ndash;Desktop Client Extensibility &amp;amp; Silverlight Validation</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2011/11/03/DevConnectionsSlidesAndDemosndashDesktopClientExtensibilityAmpSilverlightValidation.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,9e5dbbb1-f4b5-44b3-b03b-eb5a5bedb783.aspx</id>
    <published>2011-11-03T16:03:12.3001265+00:00</published>
    <updated>2011-11-03T16:03:12.3001265+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Two more talks today at DevConnections. One showing an approach to combining MEF,
MVVM, and Prism for maximum desktop client extensibility and one showing how to get
the most out of Silverlight validation for data entry.
</p>
        <p>
You can grab the slides and demos here:
</p>
        <p>
Desktop Client Extensibility   <a href="http://www.softinsight.com/downloads/DevConnections/Noyes_VSC_VS09_BuildExtensibleDesktopApps.pdf" target="_blank">Slides</a>    <a href="http://www.softinsight.com/downloads/DevConnections/DesktopClientExtensibility-11-2-2011.zip" target="_blank">Demos</a></p>
        <p>
Silverlight Validation    <a href="http://www.softinsight.com/downloads/DevConnections/Noyes_SLC_LVL08_BlackBeltSLBusinessValidation.pdf" target="_blank">Slides</a>    <a href="http://www.softinsight.com/downloads/DevConnections/SilverlightBusinessDataValidation-11-2-2011.zip" target="_blank">Demos</a></p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=9e5dbbb1-f4b5-44b3-b03b-eb5a5bedb783" />
      </div>
    </content>
  </entry>
  <entry>
    <title>DevConnections Demos&amp;ndash; WCF Flavors and Async</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2011/11/02/DevConnectionsDemosndashWCFFlavorsAndAsync.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,8fdb7859-eda7-4602-88ed-c8483ac47e25.aspx</id>
    <published>2011-11-02T16:42:11.829821+00:00</published>
    <updated>2011-11-02T16:42:11.829821+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Today I am giving two talks at DevConnections. One that compares and contrasts WCF,
WCF Data Services, WCF RIA Services, and WCF Web API. The other focuses on Async –
the Parallel frameworks, Task Parallel Library, and the Async CTP.
</p>
        <p>
Here are the slides and demos for those who want them:
</p>
        <p>
WCF Flavors – <a href="http://www.softinsight.com/downloads/DevConnections/Noyes_VSC_VS10_WCFFlavorsWhenToUseWhich.pdf" target="_blank">Slides</a>    <a href="http://www.softinsight.com/downloads/DevConnections/TaskServicesDemo-11-2-2011.zip" target="_blank">Demos</a></p>
        <p>
Async – <a href="http://www.softinsight.com/downloads/DevConnections/Noyes_VSC_VS08_ThisOneGoesTo11.pdf" target="_blank">Slides</a>   <a href="http://www.softinsight.com/downloads/DevConnections/AsyncDemos-11-2-2011.zip" target="_blank">Demos</a></p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=8fdb7859-eda7-4602-88ed-c8483ac47e25" />
      </div>
    </content>
  </entry>
  <entry>
    <title>NOVA CodeCamp Keynote&amp;ndash;Slides and Demos</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2011/10/01/NOVACodeCampKeynotendashSlidesAndDemos.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,7a4e73af-21c4-446a-9b81-8c35d418a071.aspx</id>
    <published>2011-10-01T16:47:09.1959093+00:00</published>
    <updated>2011-10-01T16:47:09.1959093+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Today I gave the keynote for the <a href="http://novacodecamp.org" target="_blank">NOVA
CodeCamp</a>, in which I focused on the new features of Silverlight 5 and what’s coming
with Win 8 and WinRT / Metro development. I covered XAML enhancements, security, text
improvements, graphics, 3D, and other features of Silverlight 5. Then I summarized
what Windows 8 is all about and what WinRT and Metro are and how they relate to Silverlight
and other development technologies for the Microsoft platform in use today.
</p>
        <p>
You can grab the slides and demos here:  <a href="http://www.softinsight.com/downloads/CodeCamps/WhatsNewinSL5andbeyond.pdf" target="_blank">Slides</a>    <a href="http://www.softinsight.com/downloads/CodeCamps/CodeCampKeynoteDemos-10-1-2011.zip" target="_blank">Demos</a></p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=7a4e73af-21c4-446a-9b81-8c35d418a071" />
      </div>
    </content>
  </entry>
  <entry>
    <title>CapArea.NET BUILD Summary</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2011/09/28/CapAreaNETBUILDSummary.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,a261e589-60e2-446b-af41-4047dd184090.aspx</id>
    <published>2011-09-28T13:30:59.3607174+00:00</published>
    <updated>2011-09-28T13:30:59.3607174+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Last night I gave a talk at the Capital Area .NET Users Group (<a href="http://caparea.net">http://caparea.net</a>)
summarizing the announcements and new technologies coming out from the BUILD conference.
We had a good crowd and great interaction with lots of questions as people tried to
grok Windows 8, WinRT, and Metro and what it really meant to the kinds of apps they
are building today. About half the crowd had not watched any of the videos from the
conference, so they were starting with a clean slate in terms of understanding the
new stuff, which made it interesting to see the kinds of questions I got.
</p>
        <p>
I had a pretty simple slide deck and spent most of the time demoing things and discussing
the concepts and implications, but here are the slides for anyone who is interested.
</p>
        <p>
          <a href="http://www.softinsight.com/downloads/INETA/BUILDTalk.pdf" target="_blank">Slides</a>
        </p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=a261e589-60e2-446b-af41-4047dd184090" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Silverlight Developers Have the Smoothest Road to Metro</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2011/09/15/SilverlightDevelopersHaveTheSmoothestRoadToMetro.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,9d454633-7087-4ac1-b1a7-09045aafa1e7.aspx</id>
    <published>2011-09-15T23:40:05.5313354+00:00</published>
    <updated>2011-09-15T23:40:05.5313354+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
There is a ton of discussion going on around the announcements at //BUILD/ this week
and what the implications are for Silverlight developers and for the future of Silverlight
itself. A lot of that speculation has quickly sped to the realm of <a href="http://en.wikipedia.org/wiki/Fear,_uncertainty_and_doubt">FUD</a>.
As a Silverlight MVP, I for one thing the future is quite bright and shiny for Silverlight
developers, and even for Silverlight applications in terms of moving to the new platform
and building Metro style applications.
</p>
        <p>
If you have no idea what a “Metro style” application is or what WinRT is, you have
lots to read. The short story is that a WinRT application is one built for codename
Windows 8, and one that runs with the new user interface style and experience called
Metro. Just go check out some of the many videos available now of Windows 8 to get
a better sense of what this means. But from a developer perspective, it mean you build
a client app to run against the new Windows runtime (WinRT), and it is not a .NET
Framework application. There is a lot more to say there, but that is for other posts.
What I want to focus on here is what it means at a high level for Silverlight developers.
</p>
        <p>
If you are a Silverlight developer, here are a set of characteristics of your application
that you have to deal with on every Silverlight app you write because they are part
of the platform:
</p>
        <ul>
          <li>
It is a XAML-based user interface application, with code behind in C# or VB</li>
          <li>
The XAML that you use is a constrained set of XAML compared to WPF – there are some
capabilities missing, even in SL5</li>
          <li>
It runs in a security constrained sandbox by default, with constrained access to underlying
machine capabilities</li>
          <li>
Anything in the platform API (Silverlight) that might take “a while” is only exposed
as an Async API</li>
        </ul>
        <p>
So what are some of the things we can say about developing Metro apps at a high level?
These same exact statements about the platform hold true for Metro, they just have
some slightly different manifestations. This means that not only will developing applications
for Windows Metro feel familiar and comfortable to Silverlight developers, more of
their code will be portable to Metro applications than other .NET UI applications. 
</p>
        <p>
Now I am not saying your Silverlight apps are going to “just run” or that you won’t
have to do some non-trivial porting to turn a Silverlight application into a Metro
application, but there will be a lot less impedance mismatch there than there will
be for your typical WPF or Windows Forms application. Those applications will likely
have tons of code that is doing synchronous things that have to become async, and
probably also use parts of the .NET Framework capabilities that just wont exist in
WinRT, at least for the first release.
</p>
        <p>
However the kinds of capabilities that are in the Silverlight plug in and its supporting
libraries are exactly the kinds of things that WinRT will support, just with different
namespaces, type names, and some different API member names and arguments. 
</p>
        <p>
So the kinds of things you will have to change to port your application if it is well
designed will include:
</p>
        <ul>
          <li>
XAML – there are new controls to comply with the Metro look and feel, but they follow
very similar patterns to existing ContentControl and ItemsControl derived controls
in Silverlight</li>
          <li>
Code that touches the Silverlight framework APIs themselves – but this should be fairly
straightforward if you are not too exotic in what you do</li>
          <li>
Any COM/PInvoke code</li>
        </ul>
        <p>
So while it is not going to be “just a weekend project” to port a significant Silverlight
application to Metro, a well designed and layered Silverlight application should also
not be anything close to a total rewrite. Significant parts of things like model objects,
view models, service calls, and application logic should just recompile to WinRT.
Significant parts of your XAML and XAML resources can probably still be used as-is.
The rest should have fairly straightforward porting paths since the underlying platforms
are really very similar.
</p>
        <p>
Now I should caveat this with the fact that I have not sat down and done a significant
port of any Silverlight apps I have yet to validate this perspective. I plan to dig
into that over the next few weeks and will definitely continue to share my perspectives.
But at least from what I have seen at the conference, I’m not sweating it. I like
what I see and I am looking forward to continuing to use the skills I have invested
in Silverlight and WPF to start building Metro apps.
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=9d454633-7087-4ac1-b1a7-09045aafa1e7" />
      </div>
    </content>
  </entry>
  <entry>
    <title>WCF RIA Services talk at Twin Cities Developer Group</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2011/08/10/WCFRIAServicesTalkAtTwinCitiesDeveloperGroup.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,35487c65-d587-454c-b7bc-23b7e3738300.aspx</id>
    <published>2011-08-10T12:16:10.4730976+00:00</published>
    <updated>2011-08-10T12:16:10.4730976+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Last night I gave an overview talk on WCF RIA Services. I covered what RIA Services
is for, what the features are and spent most of the time demonstrating those features.
I went through basic query and update with RIA services, validating data, and securing
and personalizing your app.
</p>
        <p>
You can find the slides and demos for that session here:
</p>
        <p>
          <a href="http://www.softinsight.com/downloads/INETA/WCFRIAServices-8-9-11.pdf" target="_blank">Slides</a>
        </p>
        <p>
          <a href="http://www.softinsight.com/downloads/INETA/WCRRIADemos-8-9-11.zip" target="_blank">Demos</a>
        </p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=35487c65-d587-454c-b7bc-23b7e3738300" />
      </div>
    </content>
  </entry>
  <entry>
    <title>WCF RIA Services at Twin Cities Developers Group 8/9/2011</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2011/07/15/WCFRIAServicesAtTwinCitiesDevelopersGroup892011.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,eb6d0f0b-7584-4374-a539-71c36fac5bfc.aspx</id>
    <published>2011-07-15T12:04:26.9020106+00:00</published>
    <updated>2011-07-15T12:04:26.9020106+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’ll be giving a talk on WCF RIA Services at the Twin Cities Developers Group in Edina
MN near Minneapolis on 8/9/2011. This will be an overview talk on the capabilities
of WCF RIA Services for querying and updating data, validating input data, and securing
Silverlight applications. You can find the full details on their registration page.
If you are in the area, I hope to see you there!
</p>
        <p>
          <a href="http://www.twincitiesdevelopersgroup.com/2011/07/15/accelerate-silverlight-business-app-development-with-wcf-ria-services/">http://www.twincitiesdevelopersgroup.com/2011/07/15/accelerate-silverlight-business-app-development-with-wcf-ria-services/</a>
        </p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=eb6d0f0b-7584-4374-a539-71c36fac5bfc" />
      </div>
    </content>
  </entry>
  <entry>
    <title>DevTeach: Expose and Consume WCF Data Services Session</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2011/05/31/DevTeachExposeAndConsumeWCFDataServicesSession.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,b8e7404a-9284-49d3-9c8d-a2d01e8026ec.aspx</id>
    <published>2011-05-31T12:35:10.1299015+00:00</published>
    <updated>2011-05-31T12:35:10.1299015+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Today I am giving a session on WCF Data Services at DevTeach. In the session, I cover
the concepts of WCF Data Services including what it is for, how it works, OData protocol,,
REST-style web services, and relations to other parts of the .NET communications stack.
Then I spend most of the session walking through a demo building up a data service,
showing how to query it from various clients, showing how to create a .NET client
and query and update through it, as well as using interceptors and securing the service.
</p>
        <p>
The resulting demo code can be downloaded here:  <a href="http://www.softinsight.com/downloads/Conferences/DevTeach/NET323_WCFDataServicesDemos.zip" target="_blank">Demos</a>.
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=b8e7404a-9284-49d3-9c8d-a2d01e8026ec" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Webinar: Secure and Personalize Your Silverlight App</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2011/05/24/WebinarSecureAndPersonalizeYourSilverlightApp.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,8a8a2152-ce7b-4175-b2b5-d5c5f54770be.aspx</id>
    <published>2011-05-24T16:51:37.0283496+00:00</published>
    <updated>2011-05-24T16:51:37.0283496+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Tomorrow I’ll be giving a webinar on securing Silverlight apps with WCF RIA Services.
It will show how you can leverage the security and personalization features of WCF
RIA Services whether you choose to use that technology for your service calls or not.
You’ll see how to set things up, how to get a client side security context, and also
how to secure service calls from your client using the same secure session.
</p>
        <p>
Hope to see you there:
</p>
        <p>
          <a href="http://www.silverlightshow.net/news/Webinar-Security-WCF-RIA.aspx">http://www.silverlightshow.net/news/Webinar-Security-WCF-RIA.aspx</a>
        </p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=8a8a2152-ce7b-4175-b2b5-d5c5f54770be" />
      </div>
    </content>
  </entry>
  <entry>
    <title>DevTeach Sessions: Async, RIA Security, and WCF Data Services</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2011/05/20/DevTeachSessionsAsyncRIASecurityAndWCFDataServices.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,25cd523c-4ad2-48d4-9a55-17491f732a61.aspx</id>
    <published>2011-05-20T19:41:59.9635075+00:00</published>
    <updated>2011-05-20T19:41:59.9635075+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’ve just uploaded my materials for my upcoming <a href="http://www.devteach.com/" target="_blank">DevTeach</a> sessions
and I’m really looking forward to the conference. DevTeach is a great conference,
and Montreal is a beautiful city to visit in the spring.
</p>
        <p>
This year I am giving three talks. The abstracts are below for those. Keep an eye
on my blog the week of the event if you want to get your hands on the demos for the
sessions. If you are planning to attend, you can check out the <a href="http://www.devteach.com/Schedule.aspx" target="_blank">schedule
here</a> so you can try to fit these in.
</p>
        <p>
NET323 – Expose and Consume WCF Data Services
</p>
        <p>
WCF Data Services is a framework built on top of WCF that allows you to easily expose
collections of data via the OData protocol for ad-hoc query from clients as well as
for data updating scenarios. In this session, you'll learn how to define and host
WCF Data Services, how to consume them from .NET clients, how to secure access to
the data, and how to perform data updates through the services with validation and
business logic in the call chain. You'll learn a little bit about the OData protocol
along the way and how these same services can be consumed by any platform since they
are based on open standards. 
</p>
        <p>
SLV365 – Secure and Personalize Your Silverlight Apps with WCF RIA Services
</p>
        <p>
One of the appealing features of WCF RIA Services is that you can easily secure calls
to your services using standard browser-based security mechanisms including Windows
and Forms authentication. You can use RIA Services declarative security model in your
domain services to authenticate and authorize access to them, as well as to establish
a security context in the Silverlight client that can be used for authorization and
personalization. These features can be used from WCF RIA Services even if you do not
use any other aspects of WCF RIA Services and just call other WCF services as part
of your application. Additionally, the WCF RIA Services security can be integrated
with other WCF services in the same host for a single unified security model. This
session will walk you through how to leverage these features of WCF RIA Services. 
</p>
        <p>
SLV368 - Tackle the Complexity of Async Calls in Silverlight and WPF clients 
<br />
Whenever doing blocking tasks, particularly service calls in a Silverlight or WPF
client, you will need to make those calls asynchronously. While async calls have been
around for a long time in .NET, the patterns for addressing them have been changing
and improving. This session will cover several common patterns for addressing async
calls in client applications, including new and emerging approaches to async patterns
including Reactive Extensions that let you treat asynchronous execution like a LINQ
collection and the Task-based Async pattern and keywords coming for the C# and VB
languages. This session will take the mystery and confusion out of what happens when
and how to keep your code clean and safe in an inherently asynchronous client world. 
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=25cd523c-4ad2-48d4-9a55-17491f732a61" />
      </div>
    </content>
  </entry>
  <entry>
    <title>TechEd NA MID 311&amp;ndash;WCF RIA Services&amp;ndash;Ready for Business</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2011/05/18/TechEdNAMID311ndashWCFRIAServicesndashReadyForBusiness.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,36d6f957-9d80-4ee2-9a6e-01d0e6574fd3.aspx</id>
    <published>2011-05-18T17:50:26.9725964+00:00</published>
    <updated>2011-05-18T17:50:26.9725964+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’m about to head off to do my talk on WCF RIA Services at TechEd and wanted to make
the demo code available to the attendees ahead of time.
</p>
        <p>
In this talk, I cover the concepts and capabilities of WCF RIA Services. I talk about
what it is good for, as well as some scenarios where you should not use it. I cover
the features of querying, updating, and validating data, as well as securing your
Silverlight clients with it. 
</p>
        <p>
The demos I will do during the event can be downloaded here: <a href="http://www.softinsight.com/downloads/TechEd/MID311Demos.zip" target="_blank">Demos</a>.
</p>
        <p>
Enjoy!
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=36d6f957-9d80-4ee2-9a6e-01d0e6574fd3" />
      </div>
    </content>
  </entry>
  <entry>
    <title>TechEd NA 2011&amp;ndash;Tackle the Complexity of Async Calls in WPF and Silverlight</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2011/05/17/TechEdNA2011ndashTackleTheComplexityOfAsyncCallsInWPFAndSilverlight.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,63acf504-5228-497b-9c49-1f76378d2372.aspx</id>
    <published>2011-05-17T14:22:18.3813526+00:00</published>
    <updated>2011-05-17T14:22:18.3813526+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I just finished up my session on async calls at TechEd and wanted to share the demos
with the attendees and anyone else who cares to take a look.
</p>
        <p>
In the talk I demoed working with the Dispatcher to get work put onto the UI thread
at the appropriate time, but spent most of the talk working through a simple UI workflow
example with a synchronous method, a Begin/End async method, an Async/Completed version,
a Task Parallel Library (TPL) version, and a Async CTP (Task-based Async Pattern)
approach. I finished off with some coverage of Reactive Extensions (Rx), showing an
example of an auto-complete textbox that looks up customer data through async service
calls.
</p>
        <p>
The demo code includes both a Silverlight and a WPF version of the app, but since
TPL and the Async CTP stuff is not available in Silverlight yet but will be in a future
version, the WPF code is the more complete.
</p>
        <p>
You can download the full sample code here: <a href="http://www.softinsight.com/downloads/TechEd/AsyncDemo.zip" target="_blank">AsyncDemo.zip</a>.
</p>
        <p>
Enjoy!
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=63acf504-5228-497b-9c49-1f76378d2372" />
      </div>
    </content>
  </entry>
  <entry>
    <title>DevConnections Day 1 (for me)&amp;ndash;WCF RIA Services</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2011/03/29/DevConnectionsDay1ForMendashWCFRIAServices.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,28a2e0cb-a1c6-429f-bb61-d12f0a78f018.aspx</id>
    <published>2011-03-29T13:33:21.5544787+00:00</published>
    <updated>2011-03-29T13:33:21.5544787+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Today at DevConnections I’ll be presenting an overview talk on WCF RIA Services. I
wanted to make the demos available to the attendees and anyone else who wants them,
so here they are:
</p>
        <p>
          <a href="http://www.softinsight.com/downloads/DevConnections/Noyes_SLC_LWS09_SLBusinessAppsWCFRIAServices.zip" target="_blank">WCF
RIA Services demos</a>
        </p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=28a2e0cb-a1c6-429f-bb61-d12f0a78f018" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Cloud Plumbing Podcast Interview</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2011/03/24/CloudPlumbingPodcastInterview.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,3b9829bd-9056-48dc-9189-35c506767bc1.aspx</id>
    <published>2011-03-24T22:04:37.6009552+00:00</published>
    <updated>2011-03-24T22:04:37.6009552+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I did a podcast interview on a podcast a lot of people have probably not heard of
yet, but should check out called <a href="http://cloudplumbing.com/" target="_blank">Cloud
Plumbing</a>.
</p>
        <p>
          <a href="http://cloudplumbing.com/episode/brian-noyes-interview" target="_blank">In
my interview</a>, we discussed the positioning of WCF RIA Services compared to other
service technologies and UI technologies. If you are not quite sure about when WCF
RIA Services might be appropriate for you, this would be a great listen to get you
started.
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=3b9829bd-9056-48dc-9189-35c506767bc1" />
      </div>
    </content>
  </entry>
  <entry>
    <title>WCF RIA Services Validation Webinar</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2011/03/11/WCFRIAServicesValidationWebinar.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,690f1775-5f42-4304-9bdb-bc54bbf9e7ce.aspx</id>
    <published>2011-03-11T01:44:34.5991667+00:00</published>
    <updated>2011-03-11T01:44:34.5991667+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’m going to be doing a Webinar next week for the Silverlight Show highlighting the
features of WCF RIA Services for validation. This is one of my favorite aspects of
RIA Services because it makes validation so incredibly easy. You can use validation
attributes from the System.ComponentModel.DataAnnotations namespace and they will
be validated on both the client and server side. You can do programmatic validation
on the server side and throw a ValidationException and it will get turned into client
side validation errors for the appropriate entities. And you can do async validation
calls to the server side and affiliate the errors with the entities yourself through
a simple API. In all cases, the error get all hooked up in the entity base class so
that it ties in perfectly with the built-in validation mechanisms of Silverlight. 
</p>
        <p>
So come check it out, next Wednesday at 1000 PST:
</p>
        <p>
          <a title="http://www.silverlightshow.net/news/Webinar-WCF-RIA-Services-Validation.aspx" href="http://www.silverlightshow.net/news/Webinar-WCF-RIA-Services-Validation.aspx">http://www.silverlightshow.net/news/Webinar-WCF-RIA-Services-Validation.aspx</a>
        </p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=690f1775-5f42-4304-9bdb-bc54bbf9e7ce" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Silverlight a-plenty at DevConnections</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2011/03/10/SilverlightAplentyAtDevConnections.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,c496b3b1-be13-4591-9552-bb364ed5a2b6.aspx</id>
    <published>2011-03-10T01:48:07.167+00:00</published>
    <updated>2011-03-10T01:55:34.1066718+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Only a few weeks left until DevConnections in Orlando, and I am really looking forward
to the conference as always. This year I will be giving 4 sessions, 3 of which are
Silverlight focused.
</p>
        <p>
Here is my full lineup and a short breakdown of what I’ll be covering. If you can
make it to the conference, which you should, I hope you track me down and say hi!
</p>
        <p>
          <b>Learn to Behave — Extending the Power of XAML with Custom Behaviors </b>
          <br />
Behaviors are chunks of code you can write to add functionality to existing UI elements
or to provide glue code between the XAML and code behind the scenes like view models
in a loosely coupled way. This session will walk you through what a behavior is, how
they are implemented, both as attached behaviors and leveraging the Blend SDK, and
will also show you how to use some of the pre-built behaviors available in the Blend
SDK and frameworks like Prism 4.
</p>
        <p>
          <strong>Tackle the Complexity of Async Calls in Silverlight and WPF clients 
<br /></strong>Whenever doing blocking tasks, particularly service calls in a Silverlight
or WPF client, you will need to make those calls asynchronously. While async calls
have been around for a long time in .NET, the patterns for addressing them have been
changing and improving. This session will cover several common patterns for addressing
async calls in client applications, including new and emerging approaches to async
patterns including Reactive Extensions that let you treat asynchronous execution like
a LINQ collection and the Task-based Async pattern and keywords coming for the C#
and VB languages. This session will take the mystery and confusion out of what happens
when and how to keep your code clean and safe in an inherently asynchronous client
world.
</p>
        <p>
          <br />
          <strong>Accelerate Silverlight Business App Development with WCF RIA Services 
<br /></strong>WCF RIA Services can add a lot of productivity for building data-intensive
Silverlight business applications. It makes querying and updating simple, provides
rich validation support, simple declarative security for the services and client,
and rich error handling. In this session, you will get a quick intro into how to build
Silverlight clients and services with RIA Services and see how quickly you can leverage
these features so that you can just focus on the logic and appearance of your application
instead of the plumbing. You'll see how to define domain services, query and update
data, and apply declarative and imperative validation rules in the data pipeline.
WCF RIA Services is no silver bullet, so you'll also learn about the limitations of
the technology and where its sweet spot is for balancing productivity, performance,
and scale.
</p>
        <p>
 
</p>
        <p>
And finally, not to be left out is good old Workflow 4:
</p>
        <p>
          <strong>Workflow Foundation 4: Should I Bother or Care? 
<br /></strong>Windows Workflow Foundation 4 is a complete rewrite of the workflow framework
that first shipped in .NET 3.0. There have been a lot of improvements compared to
the previous version,  but because of the rewrite, there are some not so nice
portions of it too. The challenge with WF4 is deciding what it is good for, when to
use it, and how to use it for some specific scenarios where it does make sense. This
session will give a good overview of Workflow 4 as it exists in .NET, as well as a
preview of some of the improvements that are coming in the next release. You’ll learn
about the different kinds of workflow, what its capabilities are, some of the sweet
spots where it can make a lot of sense to use it, as well as where it is not so great
and you may want to stay away even if it looks like a good fit at a surface level.
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=c496b3b1-be13-4591-9552-bb364ed5a2b6" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Prism Talk&amp;ndash;Infragegistics MVPs</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2011/02/11/PrismTalkndashInfragegisticsMVPs.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,42e2c25d-93c0-4a81-8dc9-0f613f80768e.aspx</id>
    <published>2011-02-11T15:18:24.7057146+00:00</published>
    <updated>2011-02-11T15:18:24.7057146+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Last week I gave a talk for a group of Infragistics MVPs on Prism 4. For those who
would like to get the slides and demos, you can find them at the links below.
</p>
        <p>
          <a href="http://www.softinsight.com/downloads/Blog/Prism-2-1-2011.pdf" target="_blank">Slides</a>
        </p>
        <p>
          <a href="http://www.softinsight.com/downloads/Blog/PrismDemos-2-1-2011.zip" target="_blank">Demos</a>
        </p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=42e2c25d-93c0-4a81-8dc9-0f613f80768e" />
      </div>
    </content>
  </entry>
  <entry>
    <title>WCF RIA Services Webinar&amp;ndash;Querying and Updating Data</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2011/02/04/WCFRIAServicesWebinarndashQueryingAndUpdatingData.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,9905c07c-c005-4687-9ea3-275be9cd87f6.aspx</id>
    <published>2011-02-04T12:58:50.906736+00:00</published>
    <updated>2011-02-04T12:58:50.906736+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
On Wednesday I conducted a Webinar for the SilverlightShow.net on WCF RIA Services,
focusing on the fundamental concepts, plus querying and updating data capabilities.
This will be the first of a series that parallel and supplement the content in my
ten <a href="http://www.silverlightshow.net/items/WCF-RIA-Services-Part-1-Getting-Started.aspx" target="_blank">part
series of articles on WCF RIA Services</a>.
</p>
        <p>
You can find the recorded webinar/webcast here:
</p>
        <p>
          <a title="http://www.silverlightshow.net/shows/WCF-RIA-Services-Webinar-1.aspx" href="http://www.silverlightshow.net/shows/WCF-RIA-Services-Webinar-1.aspx">http://www.silverlightshow.net/shows/WCF-RIA-Services-Webinar-1.aspx</a>
        </p>
        <p>
Enjoy!
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=9905c07c-c005-4687-9ea3-275be9cd87f6" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Prism 4 Gems: Rendering Heterogeneous Collections with DataTemplateSelector</title>
    <link rel="alternate" type="text/html" href="http://briannoyes.net/2011/01/15/Prism4GemsRenderingHeterogeneousCollectionsWithDataTemplateSelector.aspx" />
    <id>http://briannoyes.net/PermaLink,guid,93286349-87e6-404c-bbd2-8ba5bfbfb646.aspx</id>
    <published>2011-01-15T04:32:38.525102+00:00</published>
    <updated>2011-01-15T04:47:32.5746165+00:00</updated>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Prism 4 has a lot to offer in terms of its primary features, which includes UI Composition
(Regions), Modularity, Pub/Sub events, Commands, Navigation, and MVVM guidance. But
there are also a number of helpful little chunks of code included that you can use
or copy even if you are not using the rest of Prism.
</p>
        <p>
One of those that I want to show you how to use in this post is the DataTemplateSelector
class. DataTemplates in WPF have a very important feature: the DataType property that
allows DataTemplates to be automatically applied to a data bound object based on its
type. This feature is very similar to the implicit styles capability that WPF has
had since the start that is a new feature in Silverlight 4.
</p>
        <p>
Unfortunately Silverlight is still lacking this feature. In Silverlight, you have
to associated a single data template with a data bound control through its template
property (ItemTemplate for ItemsControl and ContentTemplate for ContentControl). When
you want to bind to a heterogeneous collection of objects (that all share a common
base class or interface that the collection is defined in terms of), you are kind
of stuck in Silverlight if you want to write specific templates per derived type.
</p>
        <p>
DataTemplateSelector from Prism comes to the rescue for this scenario however. The
definition of DataTemplateSelector is kind of strange – it is a ContentControl derived
class that amounts to a switch-case statement you can put in your XAML to select the
right data template based on the actual type of the data object it is being rendered
for.
</p>
        <p>
So as a simple example, say that you had some base class that a number of different
derived classes were going to inherit from. Each derived class was going to define
its own set of properties that need to be presented and bound to controls when that
type is encountered in a collection of the base class type.
</p>
        <p>
So with a simple base type like the following:
</p>
        <div id="codeSnippetWrapper">
          <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum1"> 1:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> DataTypeBase
{ }</pre>
            <!--CRLF-->
          </div>
        </div>
        <p>
We could define two derived types like the following:
</p>
        <div id="codeSnippetWrapper">
          <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum1"> 1:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> DataType1
: DataTypeBase</pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum2"> 2:</span> {</pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum3"> 3:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">int</span> ID
{ get; set; }</pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum4"> 4:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">string</span> Name
{ get; set; }</pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum5"> 5:</span> }</pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum6"> 6:</span>  </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum7"> 7:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> DataType2
: DataTypeBase</pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum8"> 8:</span> {</pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum9"> 9:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">int</span> Index
{ get; set; }</pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum10"> 10:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">string</span> Description
{ get; set; }</pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum11"> 11:</span> }</pre>
            <!--CRLF-->
          </div>
        </div>
        <p>
Then if we were going to present items of that type in a ListBox, ComboBox or other
ItemsControl-based control, we would define the data templates we wanted to use to
render them out:
</p>
        <div id="codeSnippetWrapper">
          <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum1"> 1:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">DataTemplate</span>
              <span style="color: #ff0000">x:Key</span>
              <span style="color: #0000ff">="DataType1"</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum2"> 2:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">StackPanel</span>
              <span style="color: #ff0000">Orientation</span>
              <span style="color: #0000ff">="Horizontal"</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum3"> 3:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">TextBlock</span>
              <span style="color: #ff0000">Text</span>
              <span style="color: #0000ff">="{Binding
ID}"</span>
              <span style="color: #0000ff">/&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum4"> 4:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">toolkit:Separator</span>
              <span style="color: #0000ff">/&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum5"> 5:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">TextBlock</span>
              <span style="color: #ff0000">Text</span>
              <span style="color: #0000ff">="{Binding
Name}"</span>
              <span style="color: #0000ff">/&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum6"> 6:</span>
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">StackPanel</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum7"> 7:</span>
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">DataTemplate</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum8"> 8:</span>  </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum9"> 9:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">DataTemplate</span>
              <span style="color: #ff0000">x:Key</span>
              <span style="color: #0000ff">="DataType2"</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum10"> 10:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">StackPanel</span>
              <span style="color: #ff0000">Orientation</span>
              <span style="color: #0000ff">="Horizontal"</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum11"> 11:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">TextBox</span>
              <span style="color: #ff0000">Text</span>
              <span style="color: #0000ff">="{Binding
Index}"</span>
              <span style="color: #0000ff">/&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum12"> 12:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">toolkit:Separator</span>
              <span style="color: #0000ff">/&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum13"> 13:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">TextBox</span>
              <span style="color: #ff0000">Text</span>
              <span style="color: #0000ff">="{Binding
Description}"</span>
              <span style="color: #0000ff">/&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum14"> 14:</span>
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">StackPanel</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum15"> 15:</span>
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">DataTemplate</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
          </div>
        </div>
        <p>
 
</p>
        <p>
This is all just simple, basic Silverlight (and WPF) data binding concepts so far.
</p>
        <p>
Now say we want to expose a collection from a view model that allows us to put instances
of both DataType1 and DataType2 in it. We would just define a collection in terms
of the base class:
</p>
        <div id="codeSnippetWrapper">
          <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum1"> 1:</span>
              <span style="color: #0000ff">public</span>
              <span style="color: #0000ff">class</span> MainPageViewModel</pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum2"> 2:</span> {</pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum3"> 3:</span>
              <span style="color: #0000ff">public</span> MainPageViewModel()</pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum4"> 4:</span> {</pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum5"> 5:</span> Data
= <span style="color: #0000ff">new</span> ObservableCollection&lt;DataTypeBase&gt;();</pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum6"> 6:</span>
              <span style="color: #008000">//
Hard code some items for demo purposes</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum7"> 7:</span> Data.Add(<span style="color: #0000ff">new</span> DataType1
{ ID = 42, Name = <span style="color: #006080">"Fred"</span> });</pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum8"> 8:</span> Data.Add(<span style="color: #0000ff">new</span> DataType2
{ Index = 33, Description = <span style="color: #006080">"This is a different
data type"</span> });</pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum9"> 9:</span> }</pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum10"> 10:</span>
              <span style="color: #0000ff">public</span> ObservableCollection&lt;DataTypeBase&gt;
Data { get; set; }</pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum11"> 11:</span> }</pre>
            <!--CRLF-->
          </div>
        </div>
        <p>
 
</p>
        <p>
Now the only problem in Silverlight is how to associate those data templates applied.
If there were only going to be a single type or a single rendering of the objects
in the bound control, you could just set a single data template through the ItemTemplate
property:
</p>
        <div id="codeSnippetWrapper">
          <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum1"> 1:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">ListBox</span>
              <span style="color: #ff0000">ItemsSource</span>
              <span style="color: #0000ff">="{Binding
Data}"</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum2"> 2:</span>
              <span style="color: #ff0000">ItemTemplate</span>
              <span style="color: #0000ff">="{StaticResource
MyDataTemplate}"</span>
              <span style="color: #0000ff">/&gt;</span>
            </pre>
            <!--CRLF-->
          </div>
        </div>
        <p>
 
</p>
        <p>
But we want both data templates defined above to be applied to their respective types,
which will be in the bound collection. This is where the DataTemplateSelector comes
in. 
</p>
        <p>
The way you use it is to define a DataTemplate (typically as a resource at the current
time because of <a href="http://forums.silverlight.net/forums/t/171739.aspx" target="_blank">this
bug that causes memory leaks if you define a DataTemplate nested under the element</a>).
Inside the DataTemplate, you create an instance of the DataTemplateSelector. Then
you simply nest the multiple DataTemplates you want to apply by type inside the DataTemplateSelector’s
resources:
</p>
        <div id="codeSnippetWrapper">
          <div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum1"> 1:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">UserControl.Resources</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum2"> 2:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">DataTemplate</span>
              <span style="color: #ff0000">x:Key</span>
              <span style="color: #0000ff">="SelectorDataTemplate"</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum3"> 3:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">prism:DataTemplateSelector</span>
              <span style="color: #ff0000">Content</span>
              <span style="color: #0000ff">="{Binding}"</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum4"> 4:</span>
              <span style="color: #ff0000">HorizontalContentAlignment</span>
              <span style="color: #0000ff">="Stretch"</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum5"> 5:</span>
              <span style="color: #ff0000">IsTabStop</span>
              <span style="color: #0000ff">="False"</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum6"> 6:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">prism:DataTemplateSelector.Resources</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum7"> 7:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">DataTemplate</span>
              <span style="color: #ff0000">x:Key</span>
              <span style="color: #0000ff">="DataType1"</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum8"> 8:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">StackPanel</span>
              <span style="color: #ff0000">Orientation</span>
              <span style="color: #0000ff">="Horizontal"</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum9"> 9:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">TextBlock</span>
              <span style="color: #ff0000">Text</span>
              <span style="color: #0000ff">="{Binding
ID}"</span>
              <span style="color: #0000ff">/&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum10"> 10:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">toolkit:Separator</span>
              <span style="color: #0000ff">/&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum11"> 11:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">TextBlock</span>
              <span style="color: #ff0000">Text</span>
              <span style="color: #0000ff">="{Binding
Name}"</span>
              <span style="color: #0000ff">/&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum12"> 12:</span>
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">StackPanel</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum13"> 13:</span>
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">DataTemplate</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum14"> 14:</span>  </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum15"> 15:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">DataTemplate</span>
              <span style="color: #ff0000">x:Key</span>
              <span style="color: #0000ff">="DataType2"</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum16"> 16:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">StackPanel</span>
              <span style="color: #ff0000">Orientation</span>
              <span style="color: #0000ff">="Horizontal"</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum17"> 17:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">TextBox</span>
              <span style="color: #ff0000">Text</span>
              <span style="color: #0000ff">="{Binding
Index}"</span>
              <span style="color: #0000ff">/&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum18"> 18:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">toolkit:Separator</span>
              <span style="color: #0000ff">/&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum19"> 19:</span>
              <span style="color: #0000ff">&lt;</span>
              <span style="color: #800000">TextBox</span>
              <span style="color: #ff0000">Text</span>
              <span style="color: #0000ff">="{Binding
Description}"</span>
              <span style="color: #0000ff">/&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum20"> 20:</span>
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">StackPanel</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum21"> 21:</span>
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">DataTemplate</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum22"> 22:</span>  </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum23"> 23:</span>
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">prism:DataTemplateSelector.Resources</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum24"> 24:</span>
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">prism:DataTemplateSelector</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum25"> 25:</span>
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">DataTemplate</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
            <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px">
              <span style="color: #606060" id="lnum26"> 26:</span>
              <span style="color: #0000ff">&lt;/</span>
              <span style="color: #800000">UserControl.Resources</span>
              <span style="color: #0000ff">&gt;</span>
            </pre>
            <!--CRLF-->
          </div>
        </div>
        <p>
 
</p>
        <p>
You can see that because the DataTemplateSelector is a ContentControl, it can be the
single root element of a DataTemplate, and an “instance” of it will be rendered out
for each item in the collection it is used with. However, the DataTemplateSelector
does not really have any visual appearance of its own. What it does is render out
one of the DataTemplates defined in its Resources collection, selecting the appropriate
one based on the data type of the object that is the DataContext.
</p>
        <p>
So the steps are as follows:
</p>
        <ul>
          <li>
Define a DataTemplate in your Resources and give it a key. 
</li>
          <li>
Declare a Prism DataTemplateSelector as the element of the DataTemplate. 
</li>
          <li>
Set its Content by binding to the DataContext that flows into it (Content={Binding}). 
</li>
          <li>
Add individual DataTemplates in the Resources collection of the DataTemplateSelector 
</li>
          <li>
Set the x:Key for each nested DataTemplate to the Type name of the data object you
want it to be used for. 
</li>
          <li>
Set the root DataTemplate as the ItemTemplate on a control bound to a heterogeneous
collection of those types. 
</li>
        </ul>
        <p>
Simple, straightforward, works great. You can <a href="http://www.softinsight.com/downloads/Blog/DataTemplateSelectorDemo.zip" target="_blank">download
a full sample here</a>.
</p>
        <p>
Enjoy!
</p>
        <img width="0" height="0" src="http://briannoyes.net/aggbug.ashx?id=93286349-87e6-404c-bbd2-8ba5bfbfb646" />
      </div>
    </content>
  </entry>
</feed>