<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Ruurd Boeke Enterprise development and technobabble</title>
    <link>http://www.sitechno.com/Blog/</link>
    <description>All about agile, OR-mapping and winfx - yeah baby!</description>
    <language>en-us</language>
    <copyright>Ruurd Boeke</copyright>
    <lastBuildDate>Fri, 25 Jul 2008 08:46:13 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.9.6264.0</generator>
    <managingEditor>contact@sitechno.com</managingEditor>
    <webMaster>contact@sitechno.com</webMaster>
    <item>
      <trackback:ping>http://www.sitechno.com/Blog/Trackback.aspx?guid=02c38c95-b751-4f12-b02b-16e1e513d43f</trackback:ping>
      <pingback:server>http://www.sitechno.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.sitechno.com/Blog/PermaLink,guid,02c38c95-b751-4f12-b02b-16e1e513d43f.aspx</pingback:target>
      <dc:creator>Ruurd Boeke</dc:creator>
      <wfw:comment>http://www.sitechno.com/Blog/CommentView,guid,02c38c95-b751-4f12-b02b-16e1e513d43f.aspx</wfw:comment>
      <wfw:commentRss>http://www.sitechno.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=02c38c95-b751-4f12-b02b-16e1e513d43f</wfw:commentRss>
      <slash:comments>3</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p>
        </p>
        <p>
I started my career when I was still in university. I started a company named <a href="http://www.sitechno.com" target="_blank">Sitechno</a> that
did webapplications and custom solutions. The last few years, I’ve been hired as a
consultant on some big projects. 
<br />
The role I was given on my last project, allowed me to do some crazy cool stuff, using
nHibernate and winforms. I was able to push WCF, WF and WPF into a big client/server
application, and had great success with it. We reformed a monolithic data-oriented
application into a domain-oriented loosely coupled application.
</p>
        <p>
It’s easy enough to find new projects, but the market for the cutting edge technologies
is not very big ;-)
</p>
        <p>
When I was asked to join Microsoft, my main attraction to the offer was the opportunity
to work on cutting edge technology with a group of passionate people. When I talked
Microsofties on the Redmond campus, it became clear that they could certainly offer
just that.
</p>
        <p>
I was torn between working on EF (which, I’ve been very involved with lately) and
on Silverlight. 
<br />
In the end, Silverlight won, because I strongly believe it to be the strongest contender
in the client space, there is an interesting ‘war’ going on right now, and I have
really enjoyed working with the WPF-framework in the past. I was torn by the decision
because whatever choice I made, I knew that a great opportunity would be lost. 
</p>
        <p>
We will be heading to Vancouver, Canada in September and I will work for Microsoft
Canada for a year. After that, I will be allowed to work in the U.S.A. and we will
move to Redmond.
</p>
        <p>
You can not believe how excited I am about this opportunity. I will be working for <a href="http://blogs.msdn.com/sburke/default.aspx" target="_blank">Shawn
Burke</a> on Silverlight Controls. I’m not sure yet who else is working on the team,
but I believe/hope I’ll be working with <a href="http://blogs.msdn.com/delay/default.aspx" target="_blank">David</a>,
Ted, <a href="http://blogs.msdn.com/kirti/default.aspx" target="_blank">Kirti</a> and <a href="http://www.jeff.wilcox.name/" target="_blank">Jeff</a>. 
</p>
        <p>
As for <a href="http://www.codeplex.com/efcontrib" target="_blank">EFContrib</a>:
although I’m dedicated to it, I’m having a hard time finding the time to work on it.
Also, since version 2.0 of EF will feature some nice Poco capabilities. So, I’m not
sure if people are waiting for the solution. It would be nice to make it work with
SL though! So, if I find the time, or get lots of mail of people wanting me to finish
it properly, I’ll work on it some more.
</p>
        <img width="0" height="0" src="http://www.sitechno.com/Blog/aggbug.ashx?id=02c38c95-b751-4f12-b02b-16e1e513d43f" />
      </body>
      <title>I&amp;rsquo;m joining Microsoft!!</title>
      <guid isPermaLink="false">http://www.sitechno.com/Blog/PermaLink,guid,02c38c95-b751-4f12-b02b-16e1e513d43f.aspx</guid>
      <link>http://www.sitechno.com/Blog/IrsquomJoiningMicrosoft.aspx</link>
      <pubDate>Fri, 25 Jul 2008 08:46:13 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
I started my career when I was still in university. I started a company named &lt;a href="http://www.sitechno.com" target="_blank"&gt;Sitechno&lt;/a&gt; that
did webapplications and custom solutions. The last few years, I’ve been hired as a
consultant on some big projects. 
&lt;br /&gt;
The role I was given on my last project, allowed me to do some crazy cool stuff, using
nHibernate and winforms. I was able to push WCF, WF and WPF into a big client/server
application, and had great success with it. We reformed a monolithic data-oriented
application into a domain-oriented loosely coupled application.
&lt;/p&gt;
&lt;p&gt;
It’s easy enough to find new projects, but the market for the cutting edge technologies
is not very big ;-)
&lt;/p&gt;
&lt;p&gt;
When I was asked to join Microsoft, my main attraction to the offer was the opportunity
to work on cutting edge technology with a group of passionate people. When I talked
Microsofties on the Redmond campus, it became clear that they could certainly offer
just that.
&lt;/p&gt;
&lt;p&gt;
I was torn between working on EF (which, I’ve been very involved with lately) and
on Silverlight. 
&lt;br /&gt;
In the end, Silverlight won, because I strongly believe it to be the strongest contender
in the client space, there is an interesting ‘war’ going on right now, and I have
really enjoyed working with the WPF-framework in the past. I was torn by the decision
because whatever choice I made, I knew that a great opportunity would be lost. 
&lt;/p&gt;
&lt;p&gt;
We will be heading to Vancouver, Canada in September and I will work for Microsoft
Canada for a year. After that, I will be allowed to work in the U.S.A. and we will
move to Redmond.
&lt;/p&gt;
&lt;p&gt;
You can not believe how excited I am about this opportunity. I will be working for &lt;a href="http://blogs.msdn.com/sburke/default.aspx" target="_blank"&gt;Shawn
Burke&lt;/a&gt; on Silverlight Controls. I’m not sure yet who else is working on the team,
but I believe/hope I’ll be working with &lt;a href="http://blogs.msdn.com/delay/default.aspx" target="_blank"&gt;David&lt;/a&gt;,
Ted, &lt;a href="http://blogs.msdn.com/kirti/default.aspx" target="_blank"&gt;Kirti&lt;/a&gt; and &lt;a href="http://www.jeff.wilcox.name/" target="_blank"&gt;Jeff&lt;/a&gt;. 
&lt;/p&gt;
&lt;p&gt;
As for &lt;a href="http://www.codeplex.com/efcontrib" target="_blank"&gt;EFContrib&lt;/a&gt;:
although I’m dedicated to it, I’m having a hard time finding the time to work on it.
Also, since version 2.0 of EF will feature some nice Poco capabilities. So, I’m not
sure if people are waiting for the solution. It would be nice to make it work with
SL though! So, if I find the time, or get lots of mail of people wanting me to finish
it properly, I’ll work on it some more.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.sitechno.com/Blog/aggbug.ashx?id=02c38c95-b751-4f12-b02b-16e1e513d43f" /&gt;</description>
      <comments>http://www.sitechno.com/Blog/CommentView,guid,02c38c95-b751-4f12-b02b-16e1e513d43f.aspx</comments>
      <category>EF (Entity Framework);EF-Contrib;Personal;Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.sitechno.com/Blog/Trackback.aspx?guid=3bfb7a9b-ad9a-4655-b2a6-5ce9c1c2a86a</trackback:ping>
      <pingback:server>http://www.sitechno.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.sitechno.com/Blog/PermaLink,guid,3bfb7a9b-ad9a-4655-b2a6-5ce9c1c2a86a.aspx</pingback:target>
      <dc:creator>Ruurd Boeke</dc:creator>
      <wfw:comment>http://www.sitechno.com/Blog/CommentView,guid,3bfb7a9b-ad9a-4655-b2a6-5ce9c1c2a86a.aspx</wfw:comment>
      <wfw:commentRss>http://www.sitechno.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=3bfb7a9b-ad9a-4655-b2a6-5ce9c1c2a86a</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
          <a href="http://joshsmithonwpf.wordpress.com/2008/07/24/article-about-using-routed-commands-with-mvvm/" target="_blank">Josh
Smith</a> just published a <a href="http://www.codeproject.com/KB/WPF/VMCommanding.aspx" target="_blank">great
article</a> about his solution to using RoutedCommands in WPF.
</p>
        <p>
The problem he solves, has been solved by others before, however, I think this is
a very lightweight succinct way of doing it. 
<br />
Basically, when you set a command to a button, you will have to handle that logic
(canExecute and Execute) in the codebehind of the view. Since you are (hopefully)
using a MVC, MVP or MVVM approach, you would rather not go through the codebehind
of the view, but directly route the commands to the appropriate viewmodel/controller. 
</p>
        <p>
He creates a relaying object that does just that. This results in a completely empty
codebehind for the view, which is exactly what I like! 
</p>
        <p>
Good job Josh!
</p>
        <img width="0" height="0" src="http://www.sitechno.com/Blog/aggbug.ashx?id=3bfb7a9b-ad9a-4655-b2a6-5ce9c1c2a86a" />
      </body>
      <title>Great new way for using RoutedCommands with the ViewModel pattern in WPF</title>
      <guid isPermaLink="false">http://www.sitechno.com/Blog/PermaLink,guid,3bfb7a9b-ad9a-4655-b2a6-5ce9c1c2a86a.aspx</guid>
      <link>http://www.sitechno.com/Blog/GreatNewWayForUsingRoutedCommandsWithTheViewModelPatternInWPF.aspx</link>
      <pubDate>Fri, 25 Jul 2008 08:17:02 GMT</pubDate>
      <description>&lt;p&gt;
&lt;a href="http://joshsmithonwpf.wordpress.com/2008/07/24/article-about-using-routed-commands-with-mvvm/" target="_blank"&gt;Josh
Smith&lt;/a&gt; just published a &lt;a href="http://www.codeproject.com/KB/WPF/VMCommanding.aspx" target="_blank"&gt;great
article&lt;/a&gt; about his solution to using RoutedCommands in WPF.
&lt;/p&gt;
&lt;p&gt;
The problem he solves, has been solved by others before, however, I think this is
a very lightweight succinct way of doing it. 
&lt;br /&gt;
Basically, when you set a command to a button, you will have to handle that logic
(canExecute and Execute) in the codebehind of the view. Since you are (hopefully)
using a MVC, MVP or MVVM approach, you would rather not go through the codebehind
of the view, but directly route the commands to the appropriate viewmodel/controller. 
&lt;/p&gt;
&lt;p&gt;
He creates a relaying object that does just that. This results in a completely empty
codebehind for the view, which is exactly what I like! 
&lt;/p&gt;
&lt;p&gt;
Good job Josh!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.sitechno.com/Blog/aggbug.ashx?id=3bfb7a9b-ad9a-4655-b2a6-5ce9c1c2a86a" /&gt;</description>
      <comments>http://www.sitechno.com/Blog/CommentView,guid,3bfb7a9b-ad9a-4655-b2a6-5ce9c1c2a86a.aspx</comments>
      <category>WPF (Avalon)</category>
    </item>
    <item>
      <trackback:ping>http://www.sitechno.com/Blog/Trackback.aspx?guid=20136f25-a09c-418a-b101-c82fa9f621c0</trackback:ping>
      <pingback:server>http://www.sitechno.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.sitechno.com/Blog/PermaLink,guid,20136f25-a09c-418a-b101-c82fa9f621c0.aspx</pingback:target>
      <dc:creator>Ruurd Boeke</dc:creator>
      <wfw:comment>http://www.sitechno.com/Blog/CommentView,guid,20136f25-a09c-418a-b101-c82fa9f621c0.aspx</wfw:comment>
      <wfw:commentRss>http://www.sitechno.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=20136f25-a09c-418a-b101-c82fa9f621c0</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Well, I wrote about one way to do deeplinking and knew that there had to be something
out there that already did this.
</p>
        <p>
Look no further. It’s <a href="http://web-snippets.blogspot.com/2008/06/enabling-browser-back-button-in.html" target="_blank">here</a>!
</p>
        <img width="0" height="0" src="http://www.sitechno.com/Blog/aggbug.ashx?id=20136f25-a09c-418a-b101-c82fa9f621c0" />
      </body>
      <title>Better navigation management for deeplinking</title>
      <guid isPermaLink="false">http://www.sitechno.com/Blog/PermaLink,guid,20136f25-a09c-418a-b101-c82fa9f621c0.aspx</guid>
      <link>http://www.sitechno.com/Blog/BetterNavigationManagementForDeeplinking.aspx</link>
      <pubDate>Fri, 20 Jun 2008 22:11:52 GMT</pubDate>
      <description>&lt;p&gt;
Well, I wrote about one way to do deeplinking and knew that there had to be something
out there that already did this.
&lt;/p&gt;
&lt;p&gt;
Look no further. It’s &lt;a href="http://web-snippets.blogspot.com/2008/06/enabling-browser-back-button-in.html" target="_blank"&gt;here&lt;/a&gt;!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.sitechno.com/Blog/aggbug.ashx?id=20136f25-a09c-418a-b101-c82fa9f621c0" /&gt;</description>
      <comments>http://www.sitechno.com/Blog/CommentView,guid,20136f25-a09c-418a-b101-c82fa9f621c0.aspx</comments>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.sitechno.com/Blog/Trackback.aspx?guid=e83accde-0144-4ba0-aad1-ade777b06109</trackback:ping>
      <pingback:server>http://www.sitechno.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.sitechno.com/Blog/PermaLink,guid,e83accde-0144-4ba0-aad1-ade777b06109.aspx</pingback:target>
      <dc:creator>Ruurd Boeke</dc:creator>
      <wfw:comment>http://www.sitechno.com/Blog/CommentView,guid,e83accde-0144-4ba0-aad1-ade777b06109.aspx</wfw:comment>
      <wfw:commentRss>http://www.sitechno.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=e83accde-0144-4ba0-aad1-ade777b06109</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
        </p>
        <p>
Ninject is a lightweight dependency injection framework and it has been getting quite
a bit of attention lately. 
<br />
What makes is <em>super</em>special, is that it runs under Silverlight 2.0 beta 2!
</p>
        <p>
The Ninject website is <a href="http://ninject.org/" target="_blank">here</a> and
Nate Kohari talks about this release <a href="http://kohari.org/2008/06/16/ninject-10-goes-gold/" target="_blank">here</a>.
From his post:
</p>
        <blockquote>
          <p>
So, what are some of the features of Ninject 1.0?
</p>
          <ul>
            <li>
Constructor, property, method, and field injection 
</li>
            <li>
Instantiation behaviors (singleton, one-per-thread, one-per-request) 
</li>
            <li>
Fluent interface for declaring type bindings 
</li>
            <li>
Contextual bindings, where the selection of which type to instantiate can be delayed
until activation 
</li>
            <li>
Support for instance scope and deterministic disposal 
</li>
            <li>
Fully pluggable, modular design: each kernel component can be easily replaced to alter
the framework’s behavior 
</li>
            <li>
Lightweight interceptor support (aspect-oriented programming) 
</li>
            <li>
Integrations with other popular frameworks 
</li>
          </ul>
        </blockquote>
        <p>
        </p>
        <p>
        </p>
        <p>
It’s great to see people working on MVC approaches and now even DI frameworks for
SL. Keep it coming!
</p>
        <img width="0" height="0" src="http://www.sitechno.com/Blog/aggbug.ashx?id=e83accde-0144-4ba0-aad1-ade777b06109" />
      </body>
      <title>Ninject goes gold &amp;ndash; silverlight support</title>
      <guid isPermaLink="false">http://www.sitechno.com/Blog/PermaLink,guid,e83accde-0144-4ba0-aad1-ade777b06109.aspx</guid>
      <link>http://www.sitechno.com/Blog/NinjectGoesGoldNdashSilverlightSupport.aspx</link>
      <pubDate>Wed, 18 Jun 2008 10:42:42 GMT</pubDate>
      <description>&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Ninject is a lightweight dependency injection framework and it has been getting quite
a bit of attention lately. 
&lt;br /&gt;
What makes is &lt;em&gt;super&lt;/em&gt;special, is that it runs under Silverlight 2.0 beta 2!
&lt;/p&gt;
&lt;p&gt;
The Ninject website is &lt;a href="http://ninject.org/" target="_blank"&gt;here&lt;/a&gt; and
Nate Kohari talks about this release &lt;a href="http://kohari.org/2008/06/16/ninject-10-goes-gold/" target="_blank"&gt;here&lt;/a&gt;.
From his post:
&lt;/p&gt;
&lt;blockquote&gt; 
&lt;p&gt;
So, what are some of the features of Ninject 1.0?
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
Constructor, property, method, and field injection 
&lt;/li&gt;
&lt;li&gt;
Instantiation behaviors (singleton, one-per-thread, one-per-request) 
&lt;/li&gt;
&lt;li&gt;
Fluent interface for declaring type bindings 
&lt;/li&gt;
&lt;li&gt;
Contextual bindings, where the selection of which type to instantiate can be delayed
until activation 
&lt;/li&gt;
&lt;li&gt;
Support for instance scope and deterministic disposal 
&lt;/li&gt;
&lt;li&gt;
Fully pluggable, modular design: each kernel component can be easily replaced to alter
the framework’s behavior 
&lt;/li&gt;
&lt;li&gt;
Lightweight interceptor support (aspect-oriented programming) 
&lt;/li&gt;
&lt;li&gt;
Integrations with other popular frameworks 
&lt;/li&gt;
&lt;/ul&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
It’s great to see people working on MVC approaches and now even DI frameworks for
SL. Keep it coming!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.sitechno.com/Blog/aggbug.ashx?id=e83accde-0144-4ba0-aad1-ade777b06109" /&gt;</description>
      <comments>http://www.sitechno.com/Blog/CommentView,guid,e83accde-0144-4ba0-aad1-ade777b06109.aspx</comments>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.sitechno.com/Blog/Trackback.aspx?guid=aafd0c70-dcf3-4ed9-a46e-c867c26ec35c</trackback:ping>
      <pingback:server>http://www.sitechno.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.sitechno.com/Blog/PermaLink,guid,aafd0c70-dcf3-4ed9-a46e-c867c26ec35c.aspx</pingback:target>
      <dc:creator>Ruurd Boeke</dc:creator>
      <wfw:comment>http://www.sitechno.com/Blog/CommentView,guid,aafd0c70-dcf3-4ed9-a46e-c867c26ec35c.aspx</wfw:comment>
      <wfw:commentRss>http://www.sitechno.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=aafd0c70-dcf3-4ed9-a46e-c867c26ec35c</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Nihkil wrote sometime ago about ‘<a href="http://www.nikhilk.net/Silverlight-Behaviors.aspx" target="_blank">actions’</a>,
which was a concept he created that attach some behavior to elements. Think of the
action of pressing the ‘enter’ key in a textbutton and executing some logic (sparing
the user a click on the button next to the textbutton).
</p>
        <p>
He has clearly been thinking more about his framework and now posts about the MVC
concept of the ViewModel, extending it with his actions <a href="http://www.nikhilk.net/Entry.aspx?id=198" target="_blank">here</a>.
Good write-up. Go read it. 
</p>
        <p>
Basically, he explains what a ViewModel is and shows how to execute ‘command’-like
behavior on them. As you might know, Silverlight does not support the concepts of
commands, like WPF does. His syntax is like this:
</p>
        <p>
 
</p>
        <pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <span style="color: teal"> 1</span>
            <span style="color: blue">&lt;</span>
            <span style="color: maroon">vm:View</span>
            <span style="color: red">xmlns</span>="<span style="color: blue">...</span>" <span style="color: red">xmlns:x</span>="<span style="color: blue">...</span>" </pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
            <span style="color: teal"> 2</span>
            <span style="color: red">xmlns:vm="clr-namespace:Silverlight.FX.ViewModel;assembly</span>=Silverlight.FX" </pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <span style="color: teal"> 3</span>
            <span style="color: red">xmlns:app</span>="<span style="color: blue">clr-namespace:AmazonSearch.Views</span>"<span style="color: blue">&gt;</span></pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
            <span style="color: teal"> 4</span>
            <span style="color: blue">&lt;</span>
            <span style="color: maroon">vm:View.Model</span>
            <span style="color: blue">&gt;</span>
          </pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <span style="color: teal"> 5</span>
            <span style="color: blue">&lt;</span>
            <span style="color: maroon">app:SearchViewModel</span> /<span style="color: blue">&gt;</span></pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
            <span style="color: teal"> 6</span>
            <span style="color: blue">&lt;</span>/<span style="color: maroon">vm:View.Model</span><span style="color: blue">&gt;</span></pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <span style="color: teal"> 7</span>
          </pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
            <span style="color: teal"> 8</span>
            <span style="color: blue">&lt;</span>
            <span style="color: maroon">Grid</span>
            <span style="color: blue">&gt;</span>
          </pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <span style="color: teal"> 9</span>
            <span style="color: blue">&lt;</span>
            <span style="color: maroon">TextBox</span>
            <span style="color: red">x:Name</span>="<span style="color: blue">searchTextBox</span>"
/<span style="color: blue">&gt;</span></pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
            <span style="color: teal"> 10</span>
            <span style="color: blue">&lt;</span>
            <span style="color: maroon">Button</span>
            <span style="color: red">Content</span>="<span style="color: blue">Search</span>" <span style="color: red">IsEnabled</span>="<span style="color: blue">{Binding
CanSearch}</span>"<span style="color: blue">&gt;</span></pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <span style="color: teal"> 11</span>
            <span style="color: blue">&lt;</span>
            <span style="color: maroon">vm:ButtonEvents.Click</span>
            <span style="color: blue">&gt;</span>
          </pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
            <span style="color: teal"> 12</span>
            <span style="color: blue">&lt;</span>
            <span style="color: maroon">vm:InvokeMethod</span>
            <span style="color: red">MethodName</span>="<span style="color: blue">Search</span>"<span style="color: blue">&gt;</span></pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <span style="color: teal"> 13</span>
            <span style="color: blue">&lt;</span>
            <span style="color: maroon">vm:ElementParameter</span>
            <span style="color: red">ElementName</span>="<span style="color: blue">searchTextBox</span>" <span style="color: red">ElementProperty</span>="<span style="color: blue">Text</span>"
/<span style="color: blue">&gt;</span></pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
            <span style="color: teal"> 14</span>
            <span style="color: blue">&lt;</span>/<span style="color: maroon">vm:InvokeMethod</span><span style="color: blue">&gt;</span></pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <span style="color: teal"> 15</span>
            <span style="color: blue">&lt;</span>/<span style="color: maroon">vm:ButtonEvents.Click</span><span style="color: blue">&gt;</span></pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
            <span style="color: teal"> 16</span>
            <span style="color: blue">&lt;</span>/<span style="color: maroon">Button</span><span style="color: blue">&gt;</span></pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <span style="color: teal"> 17</span>
          </pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
            <span style="color: teal"> 18</span>
            <span style="color: blue">&lt;</span>
            <span style="color: maroon">ItemsControl</span>
            <span style="color: red">ItemsSource</span>="<span style="color: blue">{Binding
Products}</span>"<span style="color: blue">&gt;</span></pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <span style="color: teal"> 19</span>
            <span style="color: blue">&lt;</span>
            <span style="color: maroon">ItemsControl.ItemTemplate</span>
            <span style="color: blue">&gt;</span>
          </pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
            <span style="color: teal"> 20</span>
            <span style="color: blue">&lt;</span>
            <span style="color: maroon">DataTemplate</span>
            <span style="color: blue">&gt;</span>
            <span style="color: blue">&lt;</span>
            <span style="color: maroon">app:ProductView</span> /<span style="color: blue">&gt;</span><span style="color: blue">&lt;</span>/<span style="color: maroon">DataTemplate</span><span style="color: blue">&gt;</span></pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <span style="color: teal"> 21</span>
            <span style="color: blue">&lt;</span>/<span style="color: maroon">ItemsControl.ItemTemplate</span><span style="color: blue">&gt;</span></pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
            <span style="color: teal"> 22</span>
            <span style="color: blue">&lt;</span>/<span style="color: maroon">ItemsControl</span><span style="color: blue">&gt;</span></pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <span style="color: teal"> 23</span>
            <span style="color: blue">&lt;</span>/<span style="color: maroon">Grid</span><span style="color: blue">&gt;</span></pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
            <span style="color: teal"> 24</span>
            <span style="color: blue">&lt;</span>/<span style="color: maroon">vm:View</span><span style="color: blue">&gt;</span></pre>
          <span style="color: teal"> 25</span>
        </pre>
        <p>
The thing to note is in lines 10 to 15. There he invokes a method straight on the
ViewModel.
</p>
        <p>
The concept is quite the same as the Caliburn project from Rob and the idea is very
powerful! 
<br />
It enables you to have no code-behind and go straight to the viewmodel. Very nice!
</p>
        <p>
Thinking about this a bit though, does make me wonder if the added Xaml is worth the
ability to go straight to the viewmodel. Wouldn't it be just as simple to define a
Search method on the codebehind and invoke the correct method in the viewmodel? 
</p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
My point being: is it worth to incorporate such a framework (albeit very small and
succinct). What do you think?
</p>
        <img width="0" height="0" src="http://www.sitechno.com/Blog/aggbug.ashx?id=aafd0c70-dcf3-4ed9-a46e-c867c26ec35c" />
      </body>
      <title>The beginning of an MVC framework for SL</title>
      <guid isPermaLink="false">http://www.sitechno.com/Blog/PermaLink,guid,aafd0c70-dcf3-4ed9-a46e-c867c26ec35c.aspx</guid>
      <link>http://www.sitechno.com/Blog/TheBeginningOfAnMVCFrameworkForSL.aspx</link>
      <pubDate>Wed, 18 Jun 2008 09:04:08 GMT</pubDate>
      <description>&lt;p&gt;
Nihkil wrote sometime ago about ‘&lt;a href="http://www.nikhilk.net/Silverlight-Behaviors.aspx" target="_blank"&gt;actions’&lt;/a&gt;,
which was a concept he created that attach some behavior to elements. Think of the
action of pressing the ‘enter’ key in a textbutton and executing some logic (sparing
the user a click on the button next to the textbutton).
&lt;/p&gt;
&lt;p&gt;
He has clearly been thinking more about his framework and now posts about the MVC
concept of the ViewModel, extending it with his actions &lt;a href="http://www.nikhilk.net/Entry.aspx?id=198" target="_blank"&gt;here&lt;/a&gt;.
Good write-up. Go read it. 
&lt;/p&gt;
&lt;p&gt;
Basically, he explains what a ViewModel is and shows how to execute ‘command’-like
behavior on them. As you might know, Silverlight does not support the concepts of
commands, like WPF does. His syntax is like this:
&lt;/p&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 1&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;vm:View&lt;/span&gt; &lt;span style="color: red"&gt;xmlns&lt;/span&gt;=&amp;quot;&lt;span style="color: blue"&gt;...&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;xmlns:x&lt;/span&gt;=&amp;quot;&lt;span style="color: blue"&gt;...&lt;/span&gt;&amp;quot; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 2&lt;/span&gt; &lt;span style="color: red"&gt;xmlns:vm=&amp;quot;clr-namespace:Silverlight.FX.ViewModel;assembly&lt;/span&gt;=Silverlight.FX&amp;quot; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 3&lt;/span&gt; &lt;span style="color: red"&gt;xmlns:app&lt;/span&gt;=&amp;quot;&lt;span style="color: blue"&gt;clr-namespace:AmazonSearch.Views&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 4&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;vm:View.Model&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 5&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;app:SearchViewModel&lt;/span&gt; /&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 6&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;/&lt;span style="color: maroon"&gt;vm:View.Model&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 7&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 8&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;Grid&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 9&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;TextBox&lt;/span&gt; &lt;span style="color: red"&gt;x:Name&lt;/span&gt;=&amp;quot;&lt;span style="color: blue"&gt;searchTextBox&lt;/span&gt;&amp;quot;
/&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 10&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;Button&lt;/span&gt; &lt;span style="color: red"&gt;Content&lt;/span&gt;=&amp;quot;&lt;span style="color: blue"&gt;Search&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;IsEnabled&lt;/span&gt;=&amp;quot;&lt;span style="color: blue"&gt;{Binding
CanSearch}&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 11&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;vm:ButtonEvents.Click&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 12&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;vm:InvokeMethod&lt;/span&gt; &lt;span style="color: red"&gt;MethodName&lt;/span&gt;=&amp;quot;&lt;span style="color: blue"&gt;Search&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 13&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;vm:ElementParameter&lt;/span&gt; &lt;span style="color: red"&gt;ElementName&lt;/span&gt;=&amp;quot;&lt;span style="color: blue"&gt;searchTextBox&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;ElementProperty&lt;/span&gt;=&amp;quot;&lt;span style="color: blue"&gt;Text&lt;/span&gt;&amp;quot;
/&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 14&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;/&lt;span style="color: maroon"&gt;vm:InvokeMethod&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 15&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;/&lt;span style="color: maroon"&gt;vm:ButtonEvents.Click&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 16&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;/&lt;span style="color: maroon"&gt;Button&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 17&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 18&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;ItemsControl&lt;/span&gt; &lt;span style="color: red"&gt;ItemsSource&lt;/span&gt;=&amp;quot;&lt;span style="color: blue"&gt;{Binding
Products}&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 19&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;ItemsControl.ItemTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 20&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;DataTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;app:ProductView&lt;/span&gt; /&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;/&lt;span style="color: maroon"&gt;DataTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 21&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;/&lt;span style="color: maroon"&gt;ItemsControl.ItemTemplate&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 22&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;/&lt;span style="color: maroon"&gt;ItemsControl&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 23&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;/&lt;span style="color: maroon"&gt;Grid&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 24&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;/&lt;span style="color: maroon"&gt;vm:View&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;span style="color: teal"&gt; 25&lt;/span&gt; &lt;/pre&gt;
&lt;p&gt;
The thing to note is in lines 10 to 15. There he invokes a method straight on the
ViewModel.
&lt;/p&gt;
&lt;p&gt;
The concept is quite the same as the Caliburn project from Rob and the idea is very
powerful! 
&lt;br /&gt;
It enables you to have no code-behind and go straight to the viewmodel. Very nice!
&lt;/p&gt;
&lt;p&gt;
Thinking about this a bit though, does make me wonder if the added Xaml is worth the
ability to go straight to the viewmodel. Wouldn't it be just as simple to define a
Search method on the codebehind and invoke the correct method in the viewmodel? 
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
My point being: is it worth to incorporate such a framework (albeit very small and
succinct). What do you think?
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.sitechno.com/Blog/aggbug.ashx?id=aafd0c70-dcf3-4ed9-a46e-c867c26ec35c" /&gt;</description>
      <comments>http://www.sitechno.com/Blog/CommentView,guid,aafd0c70-dcf3-4ed9-a46e-c867c26ec35c.aspx</comments>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.sitechno.com/Blog/Trackback.aspx?guid=c36a4f6e-6de7-4ff6-b985-ba5348260091</trackback:ping>
      <pingback:server>http://www.sitechno.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.sitechno.com/Blog/PermaLink,guid,c36a4f6e-6de7-4ff6-b985-ba5348260091.aspx</pingback:target>
      <dc:creator>Ruurd Boeke</dc:creator>
      <wfw:comment>http://www.sitechno.com/Blog/CommentView,guid,c36a4f6e-6de7-4ff6-b985-ba5348260091.aspx</wfw:comment>
      <wfw:commentRss>http://www.sitechno.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=c36a4f6e-6de7-4ff6-b985-ba5348260091</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I’ve been busy sharpening my Silverlight skills and created my very own button, complete
with VSM.
</p>
        <p>
        </p>
        <p>
The button (‘rjButton’) inherits from contentControl and in the project there is a
generic.xaml which defines a default look for the button, including VSM definitions
and state transitions. 
<br />
When loading up my solution in Blend, I can happily get the rjButton in my page. It
looks correct. However, when I ‘Edit a copy’ of the template, nothing shows up!! Funnily
enough, when I use ‘Create empty’, the correct states do show up.
</p>
        <p>
I was unable to google-fix the problem. I would guess that when you use ‘create empty’,
Blend just looks at the attributes on your class and shows the correct states. When
you ‘Edit a copy’, Blend looks for the template and can not find any. Somehow it is
unaware of the link to the style in generic.xaml, and it creates an empty style.
</p>
        <p>
I’ve double checked the behavior with the TabControl, which is also a control that
is defined in an external control, and it works the same. 
<br />
I'm not sure why controls included in the framework do work correctly. I've taken
a look with reflector and I've seen nothing out of the ordinary.
</p>
        <p>
You can work around this by naming the style and explicitly tell the control to use
the style. But then again, it might be easier to just copy the style (use David's
excellent style browser <a href="http://blogs.msdn.com/delay/archive/2008/06/06/continuing-access-to-silverlight-2-s-generic-xaml-resources-silverlightdefaultstylebrowser-updated-for-silverlight-2-beta-2.aspx" target="_blank">here</a>).
</p>
        <p>
If you know what is going on, leave a comment!
</p>
        <p>
[<strong>update</strong>: jasonxz knows: I was informed, today, that Blend does not,
yet, support the "edit a copy" functionality of a Template that is not defined in
System.Windows.dll. Thnx! ]
</p>
        <img width="0" height="0" src="http://www.sitechno.com/Blog/aggbug.ashx?id=c36a4f6e-6de7-4ff6-b985-ba5348260091" />
      </body>
      <title>VisualStateManager states do not show up in blend</title>
      <guid isPermaLink="false">http://www.sitechno.com/Blog/PermaLink,guid,c36a4f6e-6de7-4ff6-b985-ba5348260091.aspx</guid>
      <link>http://www.sitechno.com/Blog/VisualStateManagerStatesDoNotShowUpInBlend.aspx</link>
      <pubDate>Fri, 13 Jun 2008 16:45:21 GMT</pubDate>
      <description>&lt;p&gt;
I’ve been busy sharpening my Silverlight skills and created my very own button, complete
with VSM.
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
The button (‘rjButton’) inherits from contentControl and in the project there is a
generic.xaml which defines a default look for the button, including VSM definitions
and state transitions. 
&lt;br&gt;
When loading up my solution in Blend, I can happily get the rjButton in my page. It
looks correct. However, when I ‘Edit a copy’ of the template, nothing shows up!! Funnily
enough, when I use ‘Create empty’, the correct states do show up.
&lt;/p&gt;
&lt;p&gt;
I was unable to google-fix the problem. I would guess that when you use ‘create empty’,
Blend just looks at the attributes on your class and shows the correct states. When
you ‘Edit a copy’, Blend looks for the template and can not find any. Somehow it is
unaware of the link to the style in generic.xaml, and it creates an empty style.
&lt;/p&gt;
&lt;p&gt;
I’ve double checked the behavior with the TabControl, which is also a control that
is defined in an external control, and it works the same. 
&lt;br&gt;
I'm not sure why controls included in the framework do work correctly. I've taken
a look with reflector and I've seen nothing out of the ordinary.
&lt;/p&gt;
&lt;p&gt;
You can work around this by naming the style and explicitly tell the control to use
the style. But then again, it might be easier to just copy the style (use David's
excellent style browser &lt;a href="http://blogs.msdn.com/delay/archive/2008/06/06/continuing-access-to-silverlight-2-s-generic-xaml-resources-silverlightdefaultstylebrowser-updated-for-silverlight-2-beta-2.aspx" target=_blank&gt;here&lt;/a&gt;).
&lt;/p&gt;
&lt;p&gt;
If you know what is going on, leave a comment!
&lt;/p&gt;
&lt;p&gt;
[&lt;strong&gt;update&lt;/strong&gt;: jasonxz knows: I was informed, today, that Blend does not,
yet, support the "edit a copy" functionality of a Template that is not defined in
System.Windows.dll. Thnx! ]
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.sitechno.com/Blog/aggbug.ashx?id=c36a4f6e-6de7-4ff6-b985-ba5348260091" /&gt;</description>
      <comments>http://www.sitechno.com/Blog/CommentView,guid,c36a4f6e-6de7-4ff6-b985-ba5348260091.aspx</comments>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.sitechno.com/Blog/Trackback.aspx?guid=af9a42f2-3733-4575-9755-06bc0d1a93f8</trackback:ping>
      <pingback:server>http://www.sitechno.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.sitechno.com/Blog/PermaLink,guid,af9a42f2-3733-4575-9755-06bc0d1a93f8.aspx</pingback:target>
      <dc:creator>Ruurd Boeke</dc:creator>
      <wfw:comment>http://www.sitechno.com/Blog/CommentView,guid,af9a42f2-3733-4575-9755-06bc0d1a93f8.aspx</wfw:comment>
      <wfw:commentRss>http://www.sitechno.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=af9a42f2-3733-4575-9755-06bc0d1a93f8</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I just spent way too much time figuring out why my VisualStateManager suddenly started
giving errors. Without ‘break on all exceptions’ I got a ‘Catastrophic error’. With
breaking on all exceptions I could finally see that the layout system was trying to
layout the visualstatemanager.
</p>
        <p>
I basically had specified my vsm directly under the controltemplate, instead of defining
it inside the grid. Whoops!
</p>
        <img width="0" height="0" src="http://www.sitechno.com/Blog/aggbug.ashx?id=af9a42f2-3733-4575-9755-06bc0d1a93f8" />
      </body>
      <title>Do not make the VSM a child of you controltemplate (duh)</title>
      <guid isPermaLink="false">http://www.sitechno.com/Blog/PermaLink,guid,af9a42f2-3733-4575-9755-06bc0d1a93f8.aspx</guid>
      <link>http://www.sitechno.com/Blog/DoNotMakeTheVSMAChildOfYouControltemplateDuh.aspx</link>
      <pubDate>Fri, 13 Jun 2008 14:01:00 GMT</pubDate>
      <description>&lt;p&gt;
I just spent way too much time figuring out why my VisualStateManager suddenly started
giving errors. Without ‘break on all exceptions’ I got a ‘Catastrophic error’. With
breaking on all exceptions I could finally see that the layout system was trying to
layout the visualstatemanager.
&lt;/p&gt;
&lt;p&gt;
I basically had specified my vsm directly under the controltemplate, instead of defining
it inside the grid. Whoops!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.sitechno.com/Blog/aggbug.ashx?id=af9a42f2-3733-4575-9755-06bc0d1a93f8" /&gt;</description>
      <comments>http://www.sitechno.com/Blog/CommentView,guid,af9a42f2-3733-4575-9755-06bc0d1a93f8.aspx</comments>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.sitechno.com/Blog/Trackback.aspx?guid=a49020cd-bdec-4dfd-a2d4-1e22cda32a28</trackback:ping>
      <pingback:server>http://www.sitechno.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.sitechno.com/Blog/PermaLink,guid,a49020cd-bdec-4dfd-a2d4-1e22cda32a28.aspx</pingback:target>
      <dc:creator>Ruurd Boeke</dc:creator>
      <wfw:comment>http://www.sitechno.com/Blog/CommentView,guid,a49020cd-bdec-4dfd-a2d4-1e22cda32a28.aspx</wfw:comment>
      <wfw:commentRss>http://www.sitechno.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=a49020cd-bdec-4dfd-a2d4-1e22cda32a28</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I was triggered to spend some time on thinking about deeplinking, when I was listening
to a podcast with Neal Ford, <a href="http://feeds.sparklingclient.com/~r/SparklingClient/~3/290284532/" target="_blank">here</a>. 
<br />
In it, he has quite a few arguments why something like Silverlight (and Flex for that
matter) will never amount to anything. I disagree with almost all of his points, but
one stuck with me more: the inability to do deeplinking.
</p>
        <p>
Let me start off by saying that I think the ‘normal’ html world has reached maturity
and should soon begin to disappear. As almost everything in the world, technology
adoption follows a wave pattern. Html has had some great advantages which made it
easy to adopt. However, as computing power increases and humans become more accustomed
to great applications, html as a platform does not deliver anymore. It was rejuvenated
by the Ajax revolution, but in the end, you are always fighting against the restrictions
that it imposes.
</p>
        <p>
Those restrictions are no longer necessary. Flash did not deliver as a RIA platform,
but Flex seems very capable, as does Silverlight. It will take a few years, but the
demand for rich clients will drive the adoption of said technologies.
</p>
        <p>
Being able to do deeplinking, is an important part of the experience and usability.
The more I thought about it, the more I agreed on this. Although I think that browsers
(as we know them) will cease to exist pretty soon or more likely: change to meet new
needs, for the next few years we will have to deal with the restrictions they impose. 
<br />
So, I started to think about how we can solve the deeplinking issue for Silverlight.
</p>
        <p>
I had a flash of brilliance when I thought of the achor (#) sign in url’s. They can
be navigated to, but the page is not reloaded. Exactly what was needed for deeplinking. 
<br />
After doing some fast research, I discovered half the world had already thought of
this trick and it is heavily used by the Flex world. 
<br />
That discovery ruined my chances to score some ‘smart'-points with my girlfriend,
but it won't keep me from implementing my idea ;-)
</p>
        <h3>The basic idea
</h3>
        <p>
The idea is to get to the url at the beginning of the application and treat everything
after the # sign as 'state'. This state is used by the components in our application
to initialize themselves to the correct state. For instance, show the help page, or
the products page. 
<br />
When a component is changed and it is important enough to reflect this change in the
url, we use javascript to navigate to the new url. The browser will recognize that
only the anchor has changed, and will not really browse there. However, the user can
now confidently copy the url.
</p>
        <p>
It's pretty easy.
</p>
        <h3>Two approaches
</h3>
        <p>
Using a <strong>navigationcontroller</strong>. 
<br />
Your application could instantiate one navigationcontroller. This controller would
be used inside your application to show different usercontrols etcetera. I think such
an approach is well suited for a MVC-style of application architecture. 
<br />
Obviously, since all your navigation is taken care of by a central component, it would
be very easy to take care of 'serializing' its state to the url.
</p>
        <p>
Using <strong>per component</strong> approach. 
<br />
If you're just not that kind of person, you could also just make the components you
care about do the (de)serializing. So, possibly react to the Loaded event of a component
and reading the url to see how to initialize it. 
<br />
I've taken this a step further and created a class that serializes the vertical offset
of a Scrollviewer. It can be used like so: 
<br /></p>
        <pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <span style="color: teal"> 1</span>
            <span style="color: blue">&lt;</span>
            <span style="color: maroon">ScrollViewer</span>
            <span style="color: red">x:Name</span>="<span style="color: blue">sv1</span>" <span style="color: red">VerticalScrollBarVisibility</span>="<span style="color: blue">Auto</span>" <span style="color: red">Margin</span>="<span style="color: blue">10</span>"<span style="color: blue">&gt;</span></pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
            <span style="color: teal"> 2</span>
            <span style="color: blue">&lt;</span>
            <span style="color: maroon">nav:ScrollviewerOffsetStateAttacher.Register</span>
            <span style="color: blue">&gt;</span>
          </pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <span style="color: teal"> 3</span>
            <span style="color: blue">&lt;</span>
            <span style="color: maroon">nav:ScrollviewerOffsetState</span>
            <span style="color: red">TemplateName</span>="<span style="color: blue">HelpTemplate</span>" <span style="color: red">PartName</span>="<span style="color: blue">pos1</span>"
/<span style="color: blue">&gt;</span></pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
            <span style="color: teal"> 4</span>
            <span style="color: blue">&lt;</span>/<span style="color: maroon">nav:ScrollviewerOffsetStateAttacher.Register</span><span style="color: blue">&gt;</span></pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <span style="color: teal"> 5</span>
            <span style="color: blue">&lt;</span>
            <span style="color: maroon">TextBlock</span>
            <span style="color: red">TextWrapping</span>="<span style="color: blue">Wrap</span>"<span style="color: blue">&gt;</span></pre>
          <span style="color: teal"> 6</span> Lorem ipsum dolor sit amet, conse</pre>
        <p>
(pretty radical, isn't it. Here I'm serializing the amount of scrolled pixels to the
url. That's something else than just which page you are viewing!)
</p>
        <h3>Some more code
</h3>
        <p>
First off, you need to think about how the url is serialized. Some kind of template
needs to be known to the system. And, different templates should be available for
different parts of your application. So, during initialization of my application I
do this:
</p>
        <div style="font-family: courier new">
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">            NavigationState.RegisterTemplate(<span style="color: maroon">"MainNavigationTemplate"</span>, <span style="color: maroon">"mainpage"</span>);</pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">            NavigationState.RegisterTemplate(<span style="color: maroon">"ProductTemplate"</span>, <span style="color: maroon">"mainpage/product/detailpos"</span>);</pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">            NavigationState.RegisterTemplate(<span style="color: maroon">"HelpTemplate"</span>, <span style="color: maroon">"mainpage/pos1/pos2"</span>);</pre>
        </div>
        <p>
A better approach might be to supply regex expressions.
</p>
        <p>
As you have figured out by now, I'm using a static class 'NavigationState' to manage
my url fiddling. It contains a SetNamedPartState and a GetNamedPartState method. So
when I navigate to the Products page, I might do this:
</p>
        <div style="font-family: courier new">
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">appController.NavigateToPage(<span style="color: blue">typeof</span>(Products));</pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">NavigationState.SetNamedPartState(<span style="color: maroon">"mainpage"</span>, <span style="color: maroon">"ProductTemplate"</span>, <span style="color: maroon">"products"</span>);</pre>
        </div>
        <p>
          <br />
I'm telling it to use the producttemplate and set the mainpage part of that template
to the state 'products'. 
<br />
During the load though, I do the opposite:
</p>
        <div style="font-family: courier new">
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">
            <span style="color: blue">string</span> state
= NavigationState.GetNamedPartState(<span style="color: maroon">"mainpage"</span>, <span style="color: maroon">"MainNavigationTemplate"</span>);</pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">
            <span style="color: blue">if</span> (!String.IsNullOrEmpty(state))</pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">{</pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: blue">if</span> (state
== <span style="color: maroon">"products"</span>)</pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">        ProductsSelected();</pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none">    <span style="color: blue">else</span> <span style="color: blue">if</span> (state
== <span style="color: maroon">"help"</span>)</pre>
          <pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, 'Courier New', courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none">        HelpSelected();</pre>
}
</div>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
        </p>
        <p>
Getting the url is easy: 
<br />
string uri = HtmlPage.Document.DocumentUri.ToString(); 
</p>
        <p>
Setting it is only slightly harder: 
<br />
HtmlPage.Window.Eval(String.Format("window.navigate('{0}#{1}');", 
<br />
    NavigationApplicationString, InternalStateString));
</p>
        <h3>Conclusion, work ahead
</h3>
        <p>
It's pretty a pretty simple idea. I like the way I attached a 'state' object to a
scrollviewer control to make a no-code, designer friendly experience possible.
</p>
        <p>
If someone would get serious about this, I guess they would take a look at the asp.net
mvc approach. They also hook the url's you are setting, to the back button(!) So,
there should be good crossbrowser javascript available.
</p>
        <p>
Also, a good and flexible url parsing engine is necessary.
</p>
        <p>
Finally, when you take the approach of one controller doing all the hard work, nothing
much has to be done. However, I can see the creation of all kinds of specific classes
that can be attached to controls to make them 'url-persistable' (think of selecting
the right listbox item).
</p>
        <h3>Try it out
</h3>
        <p>
The homepage of our sample application: 
<br /><a href="http://www.sitechno.com/silverlight/deeplinking/deeplinkingtestpage.html">http://www.sitechno.com/silverlight/deeplinking/deeplinkingtestpage.html</a></p>
        <p>
Two url's with state in them: 
<br /><a title="http://www.sitechno.com/silverlight/deeplinking/deeplinkingtestpage.html#products/SqlServer/760" href="http://www.sitechno.com/silverlight/deeplinking/deeplinkingtestpage.html#products/SqlServer/760">http://www.sitechno.com/silverlight/deeplinking/deeplinkingtestpage.html#products/SqlServer/760</a><br /><a title="http://www.sitechno.com/silverlight/deeplinking/deeplinkingtestpage.html#help/309/1166" href="http://www.sitechno.com/silverlight/deeplinking/deeplinkingtestpage.html#help/309/1166">http://www.sitechno.com/silverlight/deeplinking/deeplinkingtestpage.html#help/309/1166</a></p>
        <p>
        </p>
        <p>
I will not keep this application available forever and probably not update it to the
release version of beta2.
</p>
        <p>
 
</p>
        <p>
Who is going to make themselves useful by creating a robust solution? Leave a comment
of mail me if you want the source code!
</p>
        <img width="0" height="0" src="http://www.sitechno.com/Blog/aggbug.ashx?id=a49020cd-bdec-4dfd-a2d4-1e22cda32a28" />
      </body>
      <title>Deeplinking in Silverlight</title>
      <guid isPermaLink="false">http://www.sitechno.com/Blog/PermaLink,guid,a49020cd-bdec-4dfd-a2d4-1e22cda32a28.aspx</guid>
      <link>http://www.sitechno.com/Blog/DeeplinkingInSilverlight.aspx</link>
      <pubDate>Wed, 11 Jun 2008 19:48:01 GMT</pubDate>
      <description>&lt;p&gt;
I was triggered to spend some time on thinking about deeplinking, when I was listening
to a podcast with Neal Ford, &lt;a href="http://feeds.sparklingclient.com/~r/SparklingClient/~3/290284532/" target="_blank"&gt;here&lt;/a&gt;. 
&lt;br /&gt;
In it, he has quite a few arguments why something like Silverlight (and Flex for that
matter) will never amount to anything. I disagree with almost all of his points, but
one stuck with me more: the inability to do deeplinking.
&lt;/p&gt;
&lt;p&gt;
Let me start off by saying that I think the ‘normal’ html world has reached maturity
and should soon begin to disappear. As almost everything in the world, technology
adoption follows a wave pattern. Html has had some great advantages which made it
easy to adopt. However, as computing power increases and humans become more accustomed
to great applications, html as a platform does not deliver anymore. It was rejuvenated
by the Ajax revolution, but in the end, you are always fighting against the restrictions
that it imposes.
&lt;/p&gt;
&lt;p&gt;
Those restrictions are no longer necessary. Flash did not deliver as a RIA platform,
but Flex seems very capable, as does Silverlight. It will take a few years, but the
demand for rich clients will drive the adoption of said technologies.
&lt;/p&gt;
&lt;p&gt;
Being able to do deeplinking, is an important part of the experience and usability.
The more I thought about it, the more I agreed on this. Although I think that browsers
(as we know them) will cease to exist pretty soon or more likely: change to meet new
needs, for the next few years we will have to deal with the restrictions they impose. 
&lt;br /&gt;
So, I started to think about how we can solve the deeplinking issue for Silverlight.
&lt;/p&gt;
&lt;p&gt;
I had a flash of brilliance when I thought of the achor (#) sign in url’s. They can
be navigated to, but the page is not reloaded. Exactly what was needed for deeplinking. 
&lt;br /&gt;
After doing some fast research, I discovered half the world had already thought of
this trick and it is heavily used by the Flex world. 
&lt;br /&gt;
That discovery ruined my chances to score some ‘smart'-points with my girlfriend,
but it won't keep me from implementing my idea ;-)
&lt;/p&gt;
&lt;h3&gt;The basic idea
&lt;/h3&gt;
&lt;p&gt;
The idea is to get to the url at the beginning of the application and treat everything
after the # sign as 'state'. This state is used by the components in our application
to initialize themselves to the correct state. For instance, show the help page, or
the products page. 
&lt;br /&gt;
When a component is changed and it is important enough to reflect this change in the
url, we use javascript to navigate to the new url. The browser will recognize that
only the anchor has changed, and will not really browse there. However, the user can
now confidently copy the url.
&lt;/p&gt;
&lt;p&gt;
It's pretty easy.
&lt;/p&gt;
&lt;h3&gt;Two approaches
&lt;/h3&gt;
&lt;p&gt;
Using a &lt;strong&gt;navigationcontroller&lt;/strong&gt;. 
&lt;br /&gt;
Your application could instantiate one navigationcontroller. This controller would
be used inside your application to show different usercontrols etcetera. I think such
an approach is well suited for a MVC-style of application architecture. 
&lt;br /&gt;
Obviously, since all your navigation is taken care of by a central component, it would
be very easy to take care of 'serializing' its state to the url.
&lt;/p&gt;
&lt;p&gt;
Using &lt;strong&gt;per component&lt;/strong&gt; approach. 
&lt;br /&gt;
If you're just not that kind of person, you could also just make the components you
care about do the (de)serializing. So, possibly react to the Loaded event of a component
and reading the url to see how to initialize it. 
&lt;br /&gt;
I've taken this a step further and created a class that serializes the vertical offset
of a Scrollviewer. It can be used like so: 
&lt;br /&gt;
&lt;/p&gt;
&lt;pre&gt;&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 1&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;ScrollViewer&lt;/span&gt; &lt;span style="color: red"&gt;x:Name&lt;/span&gt;=&amp;quot;&lt;span style="color: blue"&gt;sv1&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;VerticalScrollBarVisibility&lt;/span&gt;=&amp;quot;&lt;span style="color: blue"&gt;Auto&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;Margin&lt;/span&gt;=&amp;quot;&lt;span style="color: blue"&gt;10&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 2&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;nav:ScrollviewerOffsetStateAttacher.Register&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 3&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;nav:ScrollviewerOffsetState&lt;/span&gt; &lt;span style="color: red"&gt;TemplateName&lt;/span&gt;=&amp;quot;&lt;span style="color: blue"&gt;HelpTemplate&lt;/span&gt;&amp;quot; &lt;span style="color: red"&gt;PartName&lt;/span&gt;=&amp;quot;&lt;span style="color: blue"&gt;pos1&lt;/span&gt;&amp;quot;
/&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 4&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;/&lt;span style="color: maroon"&gt;nav:ScrollviewerOffsetStateAttacher.Register&lt;/span&gt;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: teal"&gt; 5&lt;/span&gt; &lt;span style="color: blue"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: maroon"&gt;TextBlock&lt;/span&gt; &lt;span style="color: red"&gt;TextWrapping&lt;/span&gt;=&amp;quot;&lt;span style="color: blue"&gt;Wrap&lt;/span&gt;&amp;quot;&lt;span style="color: blue"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;span style="color: teal"&gt; 6&lt;/span&gt; Lorem ipsum dolor sit amet, conse&lt;/pre&gt;
&lt;p&gt;
(pretty radical, isn't it. Here I'm serializing the amount of scrolled pixels to the
url. That's something else than just which page you are viewing!)
&lt;/p&gt;
&lt;h3&gt;Some more code
&lt;/h3&gt;
&lt;p&gt;
First off, you need to think about how the url is serialized. Some kind of template
needs to be known to the system. And, different templates should be available for
different parts of your application. So, during initialization of my application I
do this:
&lt;/p&gt;
&lt;div style="font-family: courier new"&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; NavigationState.RegisterTemplate(&lt;span style="color: maroon"&gt;&amp;quot;MainNavigationTemplate&amp;quot;&lt;/span&gt;, &lt;span style="color: maroon"&gt;&amp;quot;mainpage&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; NavigationState.RegisterTemplate(&lt;span style="color: maroon"&gt;&amp;quot;ProductTemplate&amp;quot;&lt;/span&gt;, &lt;span style="color: maroon"&gt;&amp;quot;mainpage/product/detailpos&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; NavigationState.RegisterTemplate(&lt;span style="color: maroon"&gt;&amp;quot;HelpTemplate&amp;quot;&lt;/span&gt;, &lt;span style="color: maroon"&gt;&amp;quot;mainpage/pos1/pos2&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
A better approach might be to supply regex expressions.
&lt;/p&gt;
&lt;p&gt;
As you have figured out by now, I'm using a static class 'NavigationState' to manage
my url fiddling. It contains a SetNamedPartState and a GetNamedPartState method. So
when I navigate to the Products page, I might do this:
&lt;/p&gt;
&lt;div style="font-family: courier new"&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;appController.NavigateToPage(&lt;span style="color: blue"&gt;typeof&lt;/span&gt;(Products));&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;NavigationState.SetNamedPartState(&lt;span style="color: maroon"&gt;&amp;quot;mainpage&amp;quot;&lt;/span&gt;, &lt;span style="color: maroon"&gt;&amp;quot;ProductTemplate&amp;quot;&lt;/span&gt;, &lt;span style="color: maroon"&gt;&amp;quot;products&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;br /&gt;
I'm telling it to use the producttemplate and set the mainpage part of that template
to the state 'products'. 
&lt;br /&gt;
During the load though, I do the opposite:
&lt;/p&gt;
&lt;div style="font-family: courier new"&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&lt;span style="color: blue"&gt;string&lt;/span&gt; state
= NavigationState.GetNamedPartState(&lt;span style="color: maroon"&gt;&amp;quot;mainpage&amp;quot;&lt;/span&gt;, &lt;span style="color: maroon"&gt;&amp;quot;MainNavigationTemplate&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&lt;span style="color: blue"&gt;if&lt;/span&gt; (!String.IsNullOrEmpty(state))&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;{&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;if&lt;/span&gt; (state
== &lt;span style="color: maroon"&gt;&amp;quot;products&amp;quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ProductsSelected();&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; border-bottom-style: none"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color: blue"&gt;else&lt;/span&gt;&amp;#160;&lt;span style="color: blue"&gt;if&lt;/span&gt; (state
== &lt;span style="color: maroon"&gt;&amp;quot;help&amp;quot;&lt;/span&gt;)&lt;/pre&gt;
&lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: consolas, &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; border-bottom-style: none"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; HelpSelected();&lt;/pre&gt;
}
&lt;/div&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
Getting the url is easy: 
&lt;br /&gt;
string uri = HtmlPage.Document.DocumentUri.ToString(); 
&lt;/p&gt;
&lt;p&gt;
Setting it is only slightly harder: 
&lt;br /&gt;
HtmlPage.Window.Eval(String.Format(&amp;quot;window.navigate('{0}#{1}');&amp;quot;, 
&lt;br /&gt;
&amp;#160;&amp;#160;&amp;#160; NavigationApplicationString, InternalStateString));
&lt;/p&gt;
&lt;h3&gt;Conclusion, work ahead
&lt;/h3&gt;
&lt;p&gt;
It's pretty a pretty simple idea. I like the way I attached a 'state' object to a
scrollviewer control to make a no-code, designer friendly experience possible.
&lt;/p&gt;
&lt;p&gt;
If someone would get serious about this, I guess they would take a look at the asp.net
mvc approach. They also hook the url's you are setting, to the back button(!) So,
there should be good crossbrowser javascript available.
&lt;/p&gt;
&lt;p&gt;
Also, a good and flexible url parsing engine is necessary.
&lt;/p&gt;
&lt;p&gt;
Finally, when you take the approach of one controller doing all the hard work, nothing
much has to be done. However, I can see the creation of all kinds of specific classes
that can be attached to controls to make them 'url-persistable' (think of selecting
the right listbox item).
&lt;/p&gt;
&lt;h3&gt;Try it out
&lt;/h3&gt;
&lt;p&gt;
The homepage of our sample application: 
&lt;br /&gt;
&lt;a href="http://www.sitechno.com/silverlight/deeplinking/deeplinkingtestpage.html"&gt;http://www.sitechno.com/silverlight/deeplinking/deeplinkingtestpage.html&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
Two url's with state in them: 
&lt;br /&gt;
&lt;a title="http://www.sitechno.com/silverlight/deeplinking/deeplinkingtestpage.html#products/SqlServer/760" href="http://www.sitechno.com/silverlight/deeplinking/deeplinkingtestpage.html#products/SqlServer/760"&gt;http://www.sitechno.com/silverlight/deeplinking/deeplinkingtestpage.html#products/SqlServer/760&lt;/a&gt; 
&lt;br /&gt;
&lt;a title="http://www.sitechno.com/silverlight/deeplinking/deeplinkingtestpage.html#help/309/1166" href="http://www.sitechno.com/silverlight/deeplinking/deeplinkingtestpage.html#help/309/1166"&gt;http://www.sitechno.com/silverlight/deeplinking/deeplinkingtestpage.html#help/309/1166&lt;/a&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;p&gt;
I will not keep this application available forever and probably not update it to the
release version of beta2.
&lt;/p&gt;
&lt;p&gt;
&amp;#160;
&lt;/p&gt;
&lt;p&gt;
Who is going to make themselves useful by creating a robust solution? Leave a comment
of mail me if you want the source code!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.sitechno.com/Blog/aggbug.ashx?id=a49020cd-bdec-4dfd-a2d4-1e22cda32a28" /&gt;</description>
      <comments>http://www.sitechno.com/Blog/CommentView,guid,a49020cd-bdec-4dfd-a2d4-1e22cda32a28.aspx</comments>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.sitechno.com/Blog/Trackback.aspx?guid=7ad00ab3-2b92-48e3-80a0-c920b9248a2f</trackback:ping>
      <pingback:server>http://www.sitechno.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.sitechno.com/Blog/PermaLink,guid,7ad00ab3-2b92-48e3-80a0-c920b9248a2f.aspx</pingback:target>
      <dc:creator>Ruurd Boeke</dc:creator>
      <wfw:comment>http://www.sitechno.com/Blog/CommentView,guid,7ad00ab3-2b92-48e3-80a0-c920b9248a2f.aspx</wfw:comment>
      <wfw:commentRss>http://www.sitechno.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=7ad00ab3-2b92-48e3-80a0-c920b9248a2f</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Okay, I've been busy with other stuff in my life, I'll blog about soon. Suffice it
to say, I'm going to be able to focus my time more on Silverlight now ;-)
</p>
        <p>
The Silverlight team is announcing beta 2 with <a href="http://blogs.msdn.com/silverlight_sdk/archive/2008/06/04/what-s-new-in-silverlight-2-beta-2.aspx" target="_blank">this
post</a>. It's a pretty long list with changes, and it's looking very good! Here are
a few of my favorites:
</p>
        <ul>
          <li>
They included some controls into the runtime. So more goodies without added download
size.</li>
          <li>
A visual tree helper. I'm looking for more information on this. As you know, SL does
not have the same concept of a seperate visual tree and logical tree as WPF does.
They instead opted to not differentiate. Does this helper mean that the two models
come closer to each other?</li>
          <li>
Per binding level validation.</li>
          <li>
Binding to attached properties! Yay!</li>
          <li>
OnItemsChanged method</li>
          <li>
Fallback value during conversion</li>
          <li>
Duplex communication. Oh dear, they really hit the sweet spot here. This allows you
to push data to the client during a call. 
</li>
        </ul>
        <p>
The big one for me is support for <strong>UIAutomation</strong> though. I'm not sure
if it is supported fully, but this means you can test your controls with actual 'human'-like
input. I think this is important when building an application with a late-bound system
like Xaml-binding. 
</p>
        <p>
The whole blogosphere is raving about the new <strong>VisualStateManager</strong>.
It is a highlevel api to work with your states. The blend team is able to give you
a much improved templating story because of it. Read about it <a href="http://electricbeach.org/?p=98" target="_blank">here</a> or <a href="http://feeds.timheuer.com/~r/timheuer/~3/304691907/silverlight-introduces-visual-state-manager-vsm.aspx" target="_blank">here</a>.
</p>
        <img width="0" height="0" src="http://www.sitechno.com/Blog/aggbug.ashx?id=7ad00ab3-2b92-48e3-80a0-c920b9248a2f" />
      </body>
      <title>Silverlight 2.0 beta 2 comin' up! Some changes.</title>
      <guid isPermaLink="false">http://www.sitechno.com/Blog/PermaLink,guid,7ad00ab3-2b92-48e3-80a0-c920b9248a2f.aspx</guid>
      <link>http://www.sitechno.com/Blog/Silverlight20Beta2CominUpSomeChanges.aspx</link>
      <pubDate>Thu, 05 Jun 2008 10:14:48 GMT</pubDate>
      <description>&lt;p&gt;
Okay, I've been busy with other stuff in my life, I'll blog about soon. Suffice it
to say, I'm going to be able to focus my time more on Silverlight now ;-)
&lt;/p&gt;
&lt;p&gt;
The Silverlight team is announcing beta 2 with &lt;a href="http://blogs.msdn.com/silverlight_sdk/archive/2008/06/04/what-s-new-in-silverlight-2-beta-2.aspx" target="_blank"&gt;this
post&lt;/a&gt;. It's a pretty long list with changes, and it's looking very good! Here are
a few of my favorites:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
They included some controls into the runtime. So more goodies without added download
size.&lt;/li&gt;
&lt;li&gt;
A visual tree helper. I'm looking for more information on this. As you know, SL does
not have the same concept of a seperate visual tree and logical tree as WPF does.
They instead opted to not differentiate. Does this helper mean that the two models
come closer to each other?&lt;/li&gt;
&lt;li&gt;
Per binding level validation.&lt;/li&gt;
&lt;li&gt;
Binding to attached properties! Yay!&lt;/li&gt;
&lt;li&gt;
OnItemsChanged method&lt;/li&gt;
&lt;li&gt;
Fallback value during conversion&lt;/li&gt;
&lt;li&gt;
Duplex communication. Oh dear, they really hit the sweet spot here. This allows you
to push data to the client during a call. 
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
The big one for me is support for &lt;strong&gt;UIAutomation&lt;/strong&gt; though. I'm not sure
if it is supported fully, but this means you can test your controls with actual 'human'-like
input. I think this is important when building an application with a late-bound system
like Xaml-binding. 
&lt;/p&gt;
&lt;p&gt;
The whole blogosphere is raving about the new &lt;strong&gt;VisualStateManager&lt;/strong&gt;.
It is a highlevel api to work with your states. The blend team is able to give you
a much improved templating story because of it. Read about it &lt;a href="http://electricbeach.org/?p=98" target="_blank"&gt;here&lt;/a&gt; or &lt;a href="http://feeds.timheuer.com/~r/timheuer/~3/304691907/silverlight-introduces-visual-state-manager-vsm.aspx" target="_blank"&gt;here&lt;/a&gt;.
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.sitechno.com/Blog/aggbug.ashx?id=7ad00ab3-2b92-48e3-80a0-c920b9248a2f" /&gt;</description>
      <comments>http://www.sitechno.com/Blog/CommentView,guid,7ad00ab3-2b92-48e3-80a0-c920b9248a2f.aspx</comments>
      <category>Silverlight</category>
    </item>
    <item>
      <trackback:ping>http://www.sitechno.com/Blog/Trackback.aspx?guid=8f6896b5-87d7-461f-8f70-67fe36bae06d</trackback:ping>
      <pingback:server>http://www.sitechno.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.sitechno.com/Blog/PermaLink,guid,8f6896b5-87d7-461f-8f70-67fe36bae06d.aspx</pingback:target>
      <dc:creator>Ruurd Boeke</dc:creator>
      <wfw:comment>http://www.sitechno.com/Blog/CommentView,guid,8f6896b5-87d7-461f-8f70-67fe36bae06d.aspx</wfw:comment>
      <wfw:commentRss>http://www.sitechno.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=8f6896b5-87d7-461f-8f70-67fe36bae06d</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I've recently moved this blog to another host. Everything seems to work, except for
access denied errors on the comments. 
</p>
        <p>
I'm using DasBlog which writes to the filesystem. I'm able to post new posts without
problems, but comments don't work.
</p>
        <p>
If you have any comments, feel free to email me. I've already received a few, and
will be answering them.
</p>
        <p>
[<strong>update:</strong> not sure why, but I removed the allcomments.xml, and there
is no longer an error. However, no new 'allcomments.xml' file is created, so don't
know what's up with that!]
</p>
        <img width="0" height="0" src="http://www.sitechno.com/Blog/aggbug.ashx?id=8f6896b5-87d7-461f-8f70-67fe36bae06d" />
      </body>
      <title>Comments broken, feel free to use email</title>
      <guid isPermaLink="false">http://www.sitechno.com/Blog/PermaLink,guid,8f6896b5-87d7-461f-8f70-67fe36bae06d.aspx</guid>
      <link>http://www.sitechno.com/Blog/CommentsBrokenFeelFreeToUseEmail.aspx</link>
      <pubDate>Tue, 29 Apr 2008 13:33:19 GMT</pubDate>
      <description>&lt;p&gt;
I've recently moved this blog to another host. Everything seems to work, except for
access denied errors on the comments. 
&lt;/p&gt;
&lt;p&gt;
I'm using DasBlog which writes to the filesystem. I'm able to post new posts without
problems, but comments don't work.
&lt;/p&gt;
&lt;p&gt;
If you have any comments, feel free to email me. I've already received a few, and
will be answering them.
&lt;/p&gt;
&lt;p&gt;
[&lt;strong&gt;update:&lt;/strong&gt; not sure why, but I removed the allcomments.xml, and there
is no longer an error. However, no new 'allcomments.xml' file is created, so don't
know what's up with that!]
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.sitechno.com/Blog/aggbug.ashx?id=8f6896b5-87d7-461f-8f70-67fe36bae06d" /&gt;</description>
      <comments>http://www.sitechno.com/Blog/CommentView,guid,8f6896b5-87d7-461f-8f70-67fe36bae06d.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.sitechno.com/Blog/Trackback.aspx?guid=b3f65a57-3309-4493-b632-de77bc3bc967</trackback:ping>
      <pingback:server>http://www.sitechno.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.sitechno.com/Blog/PermaLink,guid,b3f65a57-3309-4493-b632-de77bc3bc967.aspx</pingback:target>
      <dc:creator>Ruurd Boeke</dc:creator>
      <wfw:comment>http://www.sitechno.com/Blog/CommentView,guid,b3f65a57-3309-4493-b632-de77bc3bc967.aspx</wfw:comment>
      <wfw:commentRss>http://www.sitechno.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=b3f65a57-3309-4493-b632-de77bc3bc967</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Daniel Simmons commented on the next beta of EF where the team has worked with the
WCF team to allow for better serialization (in an interoperable way) of complete graphs
and relations. I'm very excited to hear that, but as Julie Lerman <a href="http://www.thedatafarm.com/blog/2008/04/16/RuurdBoekeHasSucceededInImplementingIPOCOAcrossTiers.aspx" target="_blank">pointed
out</a>: it's also kind of frustrating for me. ;-)
</p>
        <p>
As you know, I have 3 different pieces of technology that help make the possibility
of n-tier disconnected scenario easy.
</p>
        <p>
One of those pieces is the circular serializer, that was created to change the way
WCF serializes circular references. However, it has grown to also support 'original'
values.
</p>
        <p>
My current plan is as follows: 
<br />
I will wait to see how WCF serializes entity graphs in the next beta. I expect to
see that my circular serializer is no longer necessary. Hopefully I will be able to
remove it all together. 
<br />
What will still be necessary though is getting the original values across the wire.
So, I'll probably generate those properties inside of the classes themselves, negating
the use of a surrogate serializer. Then, on the client, you will just be able to use
your objects like before, and on the server you would notify the objectgraph of the
need to fill the original values just before you return them. This might work out
very well.
</p>
        <p>
The use of a surrogate is actually what is stopping me from targeting Silverlight,
so with a little luck, the changes in the next version will enable the use of Silverlight
as well. I'm looking forward to it!
</p>
        <img width="0" height="0" src="http://www.sitechno.com/Blog/aggbug.ashx?id=b3f65a57-3309-4493-b632-de77bc3bc967" />
      </body>
      <title>Future of EFContrib</title>
      <guid isPermaLink="false">http://www.sitechno.com/Blog/PermaLink,guid,b3f65a57-3309-4493-b632-de77bc3bc967.aspx</guid>
      <link>http://www.sitechno.com/Blog/FutureOfEFContrib.aspx</link>
      <pubDate>Wed, 23 Apr 2008 10:12:39 GMT</pubDate>
      <description>&lt;p&gt;
Daniel Simmons commented on the next beta of EF where the team has worked with the
WCF team to allow for better serialization (in an interoperable way) of complete graphs
and relations. I'm very excited to hear that, but as Julie Lerman &lt;a href="http://www.thedatafarm.com/blog/2008/04/16/RuurdBoekeHasSucceededInImplementingIPOCOAcrossTiers.aspx" target="_blank"&gt;pointed
out&lt;/a&gt;: it's also kind of frustrating for me. ;-)
&lt;/p&gt;
&lt;p&gt;
As you know, I have 3 different pieces of technology that help make the possibility
of n-tier disconnected scenario easy.
&lt;/p&gt;
&lt;p&gt;
One of those pieces is the circular serializer, that was created to change the way
WCF serializes circular references. However, it has grown to also support 'original'
values.
&lt;/p&gt;
&lt;p&gt;
My current plan is as follows: 
&lt;br /&gt;
I will wait to see how WCF serializes entity graphs in the next beta. I expect to
see that my circular serializer is no longer necessary. Hopefully I will be able to
remove it all together. 
&lt;br /&gt;
What will still be necessary though is getting the original values across the wire.
So, I'll probably generate those properties inside of the classes themselves, negating
the use of a surrogate serializer. Then, on the client, you will just be able to use
your objects like before, and on the server you would notify the objectgraph of the
need to fill the original values just before you return them. This might work out
very well.
&lt;/p&gt;
&lt;p&gt;
The use of a surrogate is actually what is stopping me from targeting Silverlight,
so with a little luck, the changes in the next version will enable the use of Silverlight
as well. I'm looking forward to it!
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.sitechno.com/Blog/aggbug.ashx?id=b3f65a57-3309-4493-b632-de77bc3bc967" /&gt;</description>
      <comments>http://www.sitechno.com/Blog/CommentView,guid,b3f65a57-3309-4493-b632-de77bc3bc967.aspx</comments>
    </item>
    <item>
      <trackback:ping>http://www.sitechno.com/Blog/Trackback.aspx?guid=eb673ee6-bcbe-4b4a-b76d-9235ef7df79d</trackback:ping>
      <pingback:server>http://www.sitechno.com/Blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.sitechno.com/Blog/PermaLink,guid,eb673ee6-bcbe-4b4a-b76d-9235ef7df79d.aspx</pingback:target>
      <dc:creator>Ruurd Boeke</dc:creator>
      <wfw:comment>http://www.sitechno.com/Blog/CommentView,guid,eb673ee6-bcbe-4b4a-b76d-9235ef7df79d.aspx</wfw:comment>
      <wfw:commentRss>http://www.sitechno.com/Blog/SyndicationService.asmx/GetEntryCommentsRss?guid=eb673ee6-bcbe-4b4a-b76d-9235ef7df79d</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
I just finished a small sample application that illustrates a client/server application
using Entity Framework on the server and just regular objects on the client. The client
has custom changetracking and the server is able to attach the graph to a context
again. Source can be found at the <a href="http://www.codeplex.com/efcontrib" target="_blank">efcontrib</a> page,
and I guess I'm almost ready to do a proper release!
</p>
        <p>
[I used <a href="http://www.codeplex.com/prism" target="_blank">Prism</a> to build
the client in a Model View Controller approach. It was a fun exercise and I'm looking
forward to seeing that project released.]
</p>
        <p>
The application manages employees and allows for setting a 'teamleader' on an employee:
think of 'is managed by'. I thought it would be cool to send that over the wire.
</p>
        <p>
Here is a screenshot of the main view of the application:
</p>
        <p>
          <a href="http://www.sitechno.com/Blog/content/binary/WindowsLiveWriter/Newsampleapplicationfordisconnectedntier_D20E/image_2.png">
            <img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="214" alt="image" src="http://www.sitechno.com/Blog/content/binary/WindowsLiveWriter/Newsampleapplicationfordisconnectedntier_D20E/image_thumb.png" width="240" border="0" />
          </a>
        </p>
        <p>
As you can see, you can 'choose' an employee. When you press that button, you will
see another screen where you can enter a lastname. It will fill a grid with employees
matching that criteria and allows you to choose from that list. 
<br />
It is also allowed to 'add an employee'. There are actually 3 types of employees you
can add: Mort, Elvis and Einstein. 
</p>
        <p>
On the row of teamleader, you can again press the 'choose' button, which will allow
you to set a relation between the employee you are editing and another employee.
</p>
        <p>
On the server, there are a few methods like this:
</p>
        <p>
        </p>
        <div style="background: #000000; color: #f2f0df; font-family: monospace">
          <span style="color: teal"> 
0 </span>
          <span style="color: #eeeeee">  </span>
          <span style="color: #90ee90">public</span>
          <span style="color: #eeeeee"> </span>
          <span style="color: #ff0080">List</span>
          <span style="color: #c0c0c0">&lt;</span>
          <span style="color: #ff0080">Employee</span>
          <span style="color: #c0c0c0">&gt;</span>
          <span style="color: #eeeeee"> GetEmployees(</span>
          <span style="color: #90ee90">string</span>
          <span style="color: #eeeeee"> lastNameBeginsWith)</span>
          <br />
          <div style="background: #222222">
            <span style="color: teal">  1 </span>
            <span style="color: #eeeeee"> 
{</span>
          </div>
          <span style="color: teal">  2 </span>
          <span style="color: #eeeeee">   </span>
          <span style="color: #90ee90">using</span>
          <span style="color: #eeeeee"> (</span>
          <span style="color: #ff0080">InheritanceTypeContext</span>
          <span style="color: #eeeeee"> context </span>
          <span style="color: #c0c0c0">=</span>
          <span style="color: #eeeeee"> </span>
          <span style="color: #90ee90">new</span>
          <span style="color: #eeeeee"> </span>
          <span style="color: #ff0080">InheritanceTypeContext</span>
          <span style="color: #eeeeee">())</span>
          <br />
          <div style="background: #222222">
            <span style="color: teal">  3 </span>
            <span style="color: #eeeeee">  
{</span>
          </div>
          <span style="color: teal">  4 </span>
          <br />
          <div style="background: #222222">
            <span style="color: teal">  5 </span>
            <span style="color: #eeeeee">    </span>
            <span style="color: #ff0080">List</span>
            <span style="color: #c0c0c0">&lt;</span>
            <span style="color: #ff0080">Employee</span>
            <span style="color: #c0c0c0">&gt;</span>
            <span style="color: #eeeeee"> employees </span>
            <span style="color: #c0c0c0">=</span>
            <span style="color: #eeeeee"> (</span>
            <span style="color: #90ee90">from</span>
            <span style="color: #eeeeee"> e </span>
            <span style="color: #90ee90">in</span>
            <span style="color: #eeeeee"> context</span>
            <span style="color: #c0c0c0">.</span>
            <span style="color: #eeeeee">Person</span>
            <span style="color: #c0c0c0">.</span>
            <span style="color: #eeeeee">OfType</span>
            <span style="color: #c0c0c0">&lt;</span>
            <span style="color: #ff0080">Employee</span>
            <span style="color: #c0c0c0">&gt;</span>
            <span style="color: #eeeeee">()</span>
            <span style="color: #c0c0c0">.</span>
            <span style="color: #eeeeee">Include(</span>
            <span style="color: #00ffff">"TeamLeader"</span>
            <span style="color: #eeeeee">)</span>
            <span style="color: #c0c0c0">.</span>
            <span style="color: #eeeeee">Include(</span>
            <span style="color: #00ffff">"TeamMembers"</span>
            <span style="color: #eeeeee">)</span>
          </div>
          <span style="color: teal">  6 </span>
          <span style="color: #eeeeee">      </span>
          <span style="color: #90ee90">where</span>
          <span style="color: #eeeeee"> e</span>
          <span style="color: #c0c0c0">.</span>
          <span style="color: #eeeeee">Lastname</span>
          <span style="color: #c0c0c0">.</span>
          <span style="color: #eeeeee">StartsWith(lastNameBeginsWith)</span>
          <br />
          <div style="background: #222222">
            <span style="color: teal">  7 </span>
            <span style="color: #eeeeee">      </span>
            <span style="color: #90ee90">select</span>
            <span style="color: #eeeeee"> e)</span>
            <span style="color: #c0c0c0">.</span>
            <span style="color: #eeeeee">ToList();</span>
          </div>
          <span style="color: teal">  8 </span>
          <br />
          <div style="background: #222222">
            <span style="color: teal">  9 </span>
            <span style="color: #eeeeee">    </span>
          </div>
          <span style="color: teal">  10 </span>
          <span style="color: #eeeeee">   
employees</span>
          <span style="color: #c0c0c0">.</span>
          <span style="color: #eeeeee">ForEach(p </span>
          <span style="color: #c0c0c0">=&gt;</span>
          <span style="color: #eeeeee"> context</span>
          <span style="color: #c0c0c0">.</span>
          <span style="color: #eeeeee">PrepareForSerialization(p))
;</span>
          <br />
          <div style="background: #222222">
            <span style="color: teal">  11 </span>
            <span style="color: #eeeeee">    </span>
            <span style="color: #90ee90">return</span>
            <span style="color: #eeeeee"> employees;</span>
          </div>
          <span style="color: teal">  12 </span>
          <span style="color: #eeeeee">  
}</span>
          <br />
          <div style="background: #222222">
            <span style="color: teal">  13 </span>
            <span style="color: #eeeeee"> 
}</span>
          </div>
          <span style="color: teal">  14 </span>
          <span style="color: #000000">
          </span>
          <br />
        </div>
        <p>
        </p>
        <p>
 
</p>
        <p>
You can see me taking care to call the 'prepareForSerialization' on each graph that
I'm returning on line 10.
</p>
        <p>
The client can just use these objects like normal.
</p>
        <p>
 
</p>
        <p>
I'll look into delving into it a bit with a screencast soon.
</p>
        <img width="0" height="0" src="http://www.sitechno.com/Blog/aggbug.ashx?id=eb673ee6-bcbe-4b4a-b76d-9235ef7df79d" />
      </body>
      <title>New sample application for disconnected n-tier EntityFramework objects</title>
      <guid isPermaLink="false">http://www.sitechno.com/Blog/PermaLink,guid,eb673ee6-bcbe-4b4a-b76d-9235ef7df79d.aspx</guid>
      <link>http://www.sitechno.com/Blog/NewSampleApplicationForDisconnectedNtierEntityFrameworkObjects.aspx</link>
      <pubDate>Wed, 16 Apr 2008 13:55:10 GMT</pubDate>
      <description>&lt;p&gt;
I just finished a small sample application that illustrates a client/server application
using Entity Framework on the server and just regular objects on the client. The client
has custom changetracking and the server is able to attach the graph to a context
again. Source can be found at the &lt;a href="http://www.codeplex.com/efcontrib" target="_blank"&gt;efcontrib&lt;/a&gt; page,
and I guess I'm almost ready to do a proper release!
&lt;/p&gt;
&lt;p&gt;
[I used &lt;a href="http://www.codeplex.com/prism" target="_blank"&gt;Prism&lt;/a&gt; to build
the client in a Model View Controller approach. It was a fun exercise and I'm looking
forward to seeing that project released.]
&lt;/p&gt;
&lt;p&gt;
The application manages employees and allows for setting a 'teamleader' on an employee:
think of 'is managed by'. I thought it would be cool to send that over the wire.
&lt;/p&gt;
&lt;p&gt;
Here is a screenshot of the main view of the application:
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.sitechno.com/Blog/content/binary/WindowsLiveWriter/Newsampleapplicationfordisconnectedntier_D20E/image_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="214" alt="image" src="http://www.sitechno.com/Blog/content/binary/WindowsLiveWriter/Newsampleapplicationfordisconnectedntier_D20E/image_thumb.png" width="240" border="0" /&gt;&lt;/a&gt; 
&lt;/p&gt;
&lt;p&gt;
As you can see, you can 'choose' an employee. When you press that button, you will
see another screen where you can enter a lastname. It will fill a grid with employees
matching that criteria and allows you to choose from that list. 
&lt;br /&gt;
It is also allowed to 'add an employee'. There are actually 3 types of employees you
can add: Mort, Elvis and Einstein. 
&lt;/p&gt;
&lt;p&gt;
On the row of teamleader, you can again press the 'choose' button, which will allow
you to set a relation between the employee you are editing and another employee.
&lt;/p&gt;
&lt;p&gt;
On the server, there are a few methods like this:
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;div style="background: #000000; color: #f2f0df; font-family: monospace"&gt;&lt;span style="color: teal"&gt;&amp;#160;
0 &lt;/span&gt;&lt;span style="color: #eeeeee"&gt;&amp;#160; &lt;/span&gt;&lt;span style="color: #90ee90"&gt;public&lt;/span&gt;&lt;span style="color: #eeeeee"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff0080"&gt;List&lt;/span&gt;&lt;span style="color: #c0c0c0"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #ff0080"&gt;Employee&lt;/span&gt;&lt;span style="color: #c0c0c0"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #eeeeee"&gt; GetEmployees(&lt;/span&gt;&lt;span style="color: #90ee90"&gt;string&lt;/span&gt;&lt;span style="color: #eeeeee"&gt; lastNameBeginsWith)&lt;/span&gt; 
&lt;br /&gt;
&lt;div style="background: #222222"&gt;&lt;span style="color: teal"&gt;&amp;#160; 1 &lt;/span&gt;&lt;span style="color: #eeeeee"&gt;&amp;#160;
{&lt;/span&gt;
&lt;/div&gt;
&lt;span style="color: teal"&gt;&amp;#160; 2 &lt;/span&gt;&lt;span style="color: #eeeeee"&gt;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #90ee90"&gt;using&lt;/span&gt;&lt;span style="color: #eeeeee"&gt; (&lt;/span&gt;&lt;span style="color: #ff0080"&gt;InheritanceTypeContext&lt;/span&gt;&lt;span style="color: #eeeeee"&gt; context &lt;/span&gt;&lt;span style="color: #c0c0c0"&gt;=&lt;/span&gt;&lt;span style="color: #eeeeee"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #90ee90"&gt;new&lt;/span&gt;&lt;span style="color: #eeeeee"&gt;&amp;#160;&lt;/span&gt;&lt;span style="color: #ff0080"&gt;InheritanceTypeContext&lt;/span&gt;&lt;span style="color: #eeeeee"&gt;())&lt;/span&gt; 
&lt;br /&gt;
&lt;div style="background: #222222"&gt;&lt;span style="color: teal"&gt;&amp;#160; 3 &lt;/span&gt;&lt;span style="color: #eeeeee"&gt;&amp;#160;&amp;#160;
{&lt;/span&gt;
&lt;/div&gt;
&lt;span style="color: teal"&gt;&amp;#160; 4 &lt;/span&gt; 
&lt;br /&gt;
&lt;div style="background: #222222"&gt;&lt;span style="color: teal"&gt;&amp;#160; 5 &lt;/span&gt;&lt;span style="color: #eeeeee"&gt;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #ff0080"&gt;List&lt;/span&gt;&lt;span style="color: #c0c0c0"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #ff0080"&gt;Employee&lt;/span&gt;&lt;span style="color: #c0c0c0"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #eeeeee"&gt; employees &lt;/span&gt;&lt;span style="color: #c0c0c0"&gt;=&lt;/span&gt;&lt;span style="color: #eeeeee"&gt; (&lt;/span&gt;&lt;span style="color: #90ee90"&gt;from&lt;/span&gt;&lt;span style="color: #eeeeee"&gt; e &lt;/span&gt;&lt;span style="color: #90ee90"&gt;in&lt;/span&gt;&lt;span style="color: #eeeeee"&gt; context&lt;/span&gt;&lt;span style="color: #c0c0c0"&gt;.&lt;/span&gt;&lt;span style="color: #eeeeee"&gt;Person&lt;/span&gt;&lt;span style="color: #c0c0c0"&gt;.&lt;/span&gt;&lt;span style="color: #eeeeee"&gt;OfType&lt;/span&gt;&lt;span style="color: #c0c0c0"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #ff0080"&gt;Employee&lt;/span&gt;&lt;span style="color: #c0c0c0"&gt;&amp;gt;&lt;/span&gt;&lt;span style="color: #eeeeee"&gt;()&lt;/span&gt;&lt;span style="color: #c0c0c0"&gt;.&lt;/span&gt;&lt;span style="color: #eeeeee"&gt;Include(&lt;/span&gt;&lt;span style="color: #00ffff"&gt;&amp;quot;TeamLeader&amp;quot;&lt;/span&gt;&lt;span style="color: #eeeeee"&gt;)&lt;/span&gt;&lt;span style="color: #c0c0c0"&gt;.&lt;/span&gt;&lt;span style="color: #eeeeee"&gt;Include(&lt;/span&gt;&lt;span style="color: #00ffff"&gt;&amp;quot;TeamMembers&amp;quot;&lt;/span&gt;&lt;span style="color: #eeeeee"&gt;)&lt;/span&gt;
&lt;/div&gt;
&lt;span style="color: teal"&gt;&amp;#160; 6 &lt;/span&gt;&lt;span style="color: #eeeeee"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #90ee90"&gt;where&lt;/span&gt;&lt;span style="color: #eeeeee"&gt; e&lt;/span&gt;&lt;span style="color: #c0c0c0"&gt;.&lt;/span&gt;&lt;span style="color: #eeeeee"&gt;Lastname&lt;/span&gt;&lt;span style="color: #c0c0c0"&gt;.&lt;/span&gt;&lt;span style="color: #eeeeee"&gt;StartsWith(lastNameBeginsWith)&lt;/span&gt; 
&lt;br /&gt;
&lt;div style="background: #222222"&gt;&lt;span style="color: teal"&gt;&amp;#160; 7 &lt;/span&gt;&lt;span style="color: #eeeeee"&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;/span&gt;&lt;span style="color: #90ee90"&gt;select&lt;/span&gt;&lt;span style="color: #eeeeee"&gt; e)&lt;/span&gt;&lt;span style="color: #c0c0c0"