<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.jeffhandley.com/~d/styles/itemcontent.css"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" 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:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:image="http://purl.org/rss/1.0/modules/image/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
    <channel>
        <title>Jeff Handley</title>
        <link>http://jeffhandley.com/Default.aspx</link>
        <description />
        <language>en-US</language>
        <copyright>Jeff Handley</copyright>
        <generator>Subtext Version 2.1.0.5</generator>
        <creativeCommons:license>http://creativecommons.org/licenses/by/2.0/</creativeCommons:license>
        <image>
            <title>Jeff Handley</title>
            <url>http://jeffhandley.com/images/RSS2Image.gif</url>
            <link>http://jeffhandley.com/Default.aspx</link>
            <width>77</width>
            <height>60</height>
        </image>
        <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.jeffhandley.com/JeffHandley" /><feedburner:info uri="jeffhandley" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
            <title>My Stretch Goal: To Ship RIA Services Source Code</title>
            <link>http://feeds.jeffhandley.com/~r/JeffHandley/~3/SVjgnuJk5UA/shipriaservicessourcecode.aspx</link>
            <description>&lt;p&gt;When I laid out my commitments for the current fiscal year, I included “Ship RIA Services Source Code” as a stretch goal.  Pulling this off will require a ton of effort.  I’ll have to work with management up several levels, with our legal department, and with dozens of others to pull it off.  There will also be a very significant amount of engineering required to make it happen too.  So I’m trying to figure out how valuable this would be to our customers.&lt;/p&gt;  &lt;p&gt;Please go rate the value here: &lt;a href="http://twtpoll.com/zfln78" target="_blank"&gt;http://twtpoll.com/zfln78&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I’d also like to hear comments backing up your ratings, so please fire away on this post.  I’d love to see discussion break out on this, so don’t hold back – let me have it.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Why is it or is it not valuable to put effort into getting the source code shipped?&lt;/li&gt;    &lt;li&gt;What kind of licensing would you expect if the source code was released?&lt;/li&gt;    &lt;li&gt;How would you use the source code?&lt;/li&gt;    &lt;li&gt;Do you consider shipping source code to be a significant feature for a product?&lt;/li&gt;    &lt;li&gt;Would you sacrifice other features to allow this to happen?&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Even if I get 50,000 votes begging to make this happen, I can’t make any promises.  If I pursue this, it’s quite possible that I won’t succeed.  That’s why it’s called a “stretch goal.”  But before I dive into it, I thought I’d make sure it’s worth my (over)time and others’.&lt;/p&gt;  &lt;p&gt;Thanks as always for the feedback!&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:1b225f03-fe5a-4f44-adb0-48996fa61f19" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/RIAServices" rel="tag"&gt;RIAServices&lt;/a&gt;&lt;/div&gt;&lt;img src="http://jeffhandley.com/aggbug/220.aspx" width="1" height="1" /&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/X-JifPILM9HCTifOE8QtApSLsdo/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/X-JifPILM9HCTifOE8QtApSLsdo/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/X-JifPILM9HCTifOE8QtApSLsdo/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/X-JifPILM9HCTifOE8QtApSLsdo/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/JeffHandley/~4/SVjgnuJk5UA" height="1" width="1"/&gt;</description>
            <dc:creator>Jeff Handley</dc:creator>
            <guid isPermaLink="false">http://jeffhandley.com/archive/2010/01/21/shipriaservicessourcecode.aspx</guid>
            <pubDate>Thu, 21 Jan 2010 08:14:35 GMT</pubDate>
            <wfw:comment>http://jeffhandley.com/comments/220.aspx</wfw:comment>
            <comments>http://jeffhandley.com/archive/2010/01/21/shipriaservicessourcecode.aspx#feedback</comments>
            <slash:comments>9</slash:comments>
            <wfw:commentRss>http://jeffhandley.com/comments/commentRss/220.aspx</wfw:commentRss>
        <feedburner:origLink>http://jeffhandley.com/archive/2010/01/21/shipriaservicessourcecode.aspx</feedburner:origLink></item>
        <item>
            <title>Pictures from PDC09</title>
            <link>http://feeds.jeffhandley.com/~r/JeffHandley/~3/Dx2z8fJfEyI/pictures-pdc09.aspx</link>
            <description>&lt;p&gt;Here are some of the pictures I took while in LA for PDC09.  I had a great time and I hope that I get the chance to attend more conferences.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://3.bp.blogspot.com/_W4DGgTuAByY/SwiPRWZXe_I/AAAAAAAAAHQ/M0C-z9YOyZo/s1600/IMG_0051.JPG"&gt;&lt;img border="0" alt="" src="http://3.bp.blogspot.com/_W4DGgTuAByY/SwiPRWZXe_I/AAAAAAAAAHQ/M0C-z9YOyZo/s320/IMG_0051.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The Standard has its name upside down for the logo.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://3.bp.blogspot.com/_W4DGgTuAByY/SwiPR05drSI/AAAAAAAAAHY/cn1z1004NaA/s1600/IMG_0053.JPG"&gt;&lt;img border="0" alt="" src="http://3.bp.blogspot.com/_W4DGgTuAByY/SwiPR05drSI/AAAAAAAAAHY/cn1z1004NaA/s320/IMG_0053.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I tried to take a picture of the desk at night, but it was pitch-black dark, with only small lights under the counter top in the back. When I entered, there was live jazz music playing (loudly) and it felt much more like a nightclub than a hotel.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://2.bp.blogspot.com/_W4DGgTuAByY/SwiPSV0e_SI/AAAAAAAAAHg/1qzRc5v-G_0/s1600/IMG_0054.JPG"&gt;&lt;img border="0" alt="" src="http://2.bp.blogspot.com/_W4DGgTuAByY/SwiPSV0e_SI/AAAAAAAAAHg/1qzRc5v-G_0/s320/IMG_0054.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The lobby is very pretty.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://1.bp.blogspot.com/_W4DGgTuAByY/SwiPSg0oMsI/AAAAAAAAAHo/pU_SvIwtmJg/s1600/IMG_0032.JPG"&gt;&lt;img border="0" alt="" src="http://1.bp.blogspot.com/_W4DGgTuAByY/SwiPSg0oMsI/AAAAAAAAAHo/pU_SvIwtmJg/s320/IMG_0032.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Red and white are quite prominent throughout the hotel.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://3.bp.blogspot.com/_W4DGgTuAByY/SwiPTZ371yI/AAAAAAAAAHw/rVSjAyYNrHw/s1600/IMG_0003.JPG"&gt;&lt;img border="0" alt="" src="http://3.bp.blogspot.com/_W4DGgTuAByY/SwiPTZ371yI/AAAAAAAAAHw/rVSjAyYNrHw/s320/IMG_0003.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Here's the main part of the hotel room. Very minimalistic.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://3.bp.blogspot.com/_W4DGgTuAByY/SwiQaCsEH0I/AAAAAAAAAH4/-R369iPQoWk/s1600/IMG_0008.JPG"&gt;&lt;img border="0" alt="" src="http://3.bp.blogspot.com/_W4DGgTuAByY/SwiQaCsEH0I/AAAAAAAAAH4/-R369iPQoWk/s320/IMG_0008.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The platform bed was pretty comfy.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://1.bp.blogspot.com/_W4DGgTuAByY/SwiQvPDmn8I/AAAAAAAAAIA/tqTI5o14oxE/s1600/IMG_0002.JPG"&gt;&lt;img border="0" alt="" src="http://1.bp.blogspot.com/_W4DGgTuAByY/SwiQvPDmn8I/AAAAAAAAAIA/tqTI5o14oxE/s320/IMG_0002.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Notice the glass wall that connects the bedroom to the bathroom.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://1.bp.blogspot.com/_W4DGgTuAByY/SwiRF9d7yFI/AAAAAAAAAII/-1SLDVhcWFw/s1600/IMG_0005.JPG"&gt;&lt;img border="0" alt="" src="http://1.bp.blogspot.com/_W4DGgTuAByY/SwiRF9d7yFI/AAAAAAAAAII/-1SLDVhcWFw/s320/IMG_0005.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Here it is from the other side. Wanna watch TV from the shower?&lt;/p&gt;  &lt;p&gt;&lt;a href="http://1.bp.blogspot.com/_W4DGgTuAByY/SwiRT9B3XvI/AAAAAAAAAIQ/YT-ZYx7_vvE/s1600/IMG_0007.JPG"&gt;&lt;img border="0" alt="" src="http://1.bp.blogspot.com/_W4DGgTuAByY/SwiRT9B3XvI/AAAAAAAAAIQ/YT-ZYx7_vvE/s320/IMG_0007.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;But it certainly wouldn't be a good room if you wanted privacy in the shower.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://4.bp.blogspot.com/_W4DGgTuAByY/SwiSI2G-9_I/AAAAAAAAAIo/kVlHCsLdvDY/s1600/IMG_0009.JPG"&gt;&lt;img border="0" alt="" src="http://4.bp.blogspot.com/_W4DGgTuAByY/SwiSI2G-9_I/AAAAAAAAAIo/kVlHCsLdvDY/s320/IMG_0009.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I loved the effect of the stripes: Curtains, Wall, and Lamp all lined up so nicely.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://1.bp.blogspot.com/_W4DGgTuAByY/SwiRklA4xHI/AAAAAAAAAIY/g4NCTjKxDMs/s1600/IMG_0012.JPG"&gt;&lt;img border="0" alt="" src="http://1.bp.blogspot.com/_W4DGgTuAByY/SwiRklA4xHI/AAAAAAAAAIY/g4NCTjKxDMs/s320/IMG_0012.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Here's the diner in the hotel where I had breakfast the first morning.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://2.bp.blogspot.com/_W4DGgTuAByY/SwiRwyTQycI/AAAAAAAAAIg/yui3NOIAfhw/s1600/IMG_0013.JPG"&gt;&lt;img border="0" alt="" src="http://2.bp.blogspot.com/_W4DGgTuAByY/SwiRwyTQycI/AAAAAAAAAIg/yui3NOIAfhw/s320/IMG_0013.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The diner was pretty well stocked.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://1.bp.blogspot.com/_W4DGgTuAByY/SwiTPOQeCnI/AAAAAAAAAIw/KXZSvpBo74s/s1600/IMG_0019.JPG"&gt;&lt;img border="0" alt="" src="http://1.bp.blogspot.com/_W4DGgTuAByY/SwiTPOQeCnI/AAAAAAAAAIw/KXZSvpBo74s/s320/IMG_0019.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;LA Convention Center&lt;/p&gt;  &lt;p&gt;&lt;a href="http://3.bp.blogspot.com/_W4DGgTuAByY/SwiTnHUIa1I/AAAAAAAAAI4/9Sx_dUyR218/s1600/IMG_0022.JPG"&gt;&lt;img border="0" alt="" src="http://3.bp.blogspot.com/_W4DGgTuAByY/SwiTnHUIa1I/AAAAAAAAAI4/9Sx_dUyR218/s320/IMG_0022.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Welcome to PDC09&lt;/p&gt;  &lt;p&gt;&lt;a href="http://4.bp.blogspot.com/_W4DGgTuAByY/SwiT2G0BrzI/AAAAAAAAAJA/cg8-1U9IoLA/s1600/IMG_0023.JPG"&gt;&lt;img border="0" alt="" src="http://4.bp.blogspot.com/_W4DGgTuAByY/SwiT2G0BrzI/AAAAAAAAAJA/cg8-1U9IoLA/s320/IMG_0023.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;It was pretty crowded, even on Monday.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://4.bp.blogspot.com/_W4DGgTuAByY/Swicj_9CczI/AAAAAAAAAJo/w6cO6tjX4Gk/s1600/IMG_0025.JPG"&gt;&lt;img border="0" alt="" src="http://4.bp.blogspot.com/_W4DGgTuAByY/Swicj_9CczI/AAAAAAAAAJo/w6cO6tjX4Gk/s320/IMG_0025.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Walking through downtown Monday night.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://2.bp.blogspot.com/_W4DGgTuAByY/SwidW-tQwTI/AAAAAAAAAJw/gwvx5z7eUcY/s1600/IMG_0026.JPG"&gt;&lt;img border="0" alt="" src="http://2.bp.blogspot.com/_W4DGgTuAByY/SwidW-tQwTI/AAAAAAAAAJw/gwvx5z7eUcY/s320/IMG_0026.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/BradA/" target="_blank"&gt;Brad Abrams&lt;/a&gt; (&lt;a href="http://twitter.com/brada" target="_blank"&gt;@brada&lt;/a&gt;) walking with us up toward a Tweet-Up at Hotel Figueroa.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://3.bp.blogspot.com/_W4DGgTuAByY/Swiduj6GL5I/AAAAAAAAAJ4/ZjU_ppDfTio/s1600/IMG_0029.JPG"&gt;&lt;img border="0" alt="" src="http://3.bp.blogspot.com/_W4DGgTuAByY/Swiduj6GL5I/AAAAAAAAAJ4/ZjU_ppDfTio/s320/IMG_0029.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Hotel Figueroa.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://4.bp.blogspot.com/_W4DGgTuAByY/SwiegMY5HPI/AAAAAAAAAKA/_u-TjsXlJKM/s1600/IMG_0033.JPG"&gt;&lt;img border="0" alt="" src="http://4.bp.blogspot.com/_W4DGgTuAByY/SwiegMY5HPI/AAAAAAAAAKA/_u-TjsXlJKM/s320/IMG_0033.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;After the party at Figueroa, I went back to my hotel where I learned the the rooftop serves as a nightclub, and there were a bunch of PDC attendees there.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://1.bp.blogspot.com/_W4DGgTuAByY/SwifA_MfpnI/AAAAAAAAAKI/8sQ7aOx_IsA/s1600/IMG_0034.JPG"&gt;&lt;img border="0" alt="" src="http://1.bp.blogspot.com/_W4DGgTuAByY/SwifA_MfpnI/AAAAAAAAAKI/8sQ7aOx_IsA/s320/IMG_0034.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;There were heat torches and a fireplace behind the crowd.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/PicturesfromPDC09_113A3/IMG_0035.jpg" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="IMG_0035" border="0" alt="IMG_0035" src="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/PicturesfromPDC09_113A3/IMG_0035_thumb.jpg" width="330" height="248" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.davidpoll.com/" target="_blank"&gt;David Poll&lt;/a&gt; (&lt;a href="http://twitter.com/depoll" target="_blank"&gt;@depoll&lt;/a&gt;) enjoying the party.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://1.bp.blogspot.com/_W4DGgTuAByY/SwiVvtH0ofI/AAAAAAAAAJY/gRSeyVNxBNY/s1600/IMG_0038.JPG"&gt;&lt;img border="0" alt="" src="http://1.bp.blogspot.com/_W4DGgTuAByY/SwiVvtH0ofI/AAAAAAAAAJY/gRSeyVNxBNY/s320/IMG_0038.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;A full keynote room.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://1.bp.blogspot.com/_W4DGgTuAByY/SwiWpG3i_5I/AAAAAAAAAJg/sbV-IXzOD8c/s1600/IMG_0039.JPG"&gt;&lt;img border="0" alt="" src="http://1.bp.blogspot.com/_W4DGgTuAByY/SwiWpG3i_5I/AAAAAAAAAJg/sbV-IXzOD8c/s320/IMG_0039.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Another shot with a little better lighting. This is when I realized how large the crowd was going to be for our keynote demo.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://1.bp.blogspot.com/_W4DGgTuAByY/Swifgy-jKbI/AAAAAAAAAKQ/lJNl8SaNqu4/s1600/IMG_0040.JPG"&gt;&lt;img border="0" alt="" src="http://1.bp.blogspot.com/_W4DGgTuAByY/Swifgy-jKbI/AAAAAAAAAKQ/lJNl8SaNqu4/s320/IMG_0040.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The Big Room where all of the booths are set up. I was on my way to work our booth after Tuesday's keynote.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://3.bp.blogspot.com/_W4DGgTuAByY/Swif25AFrDI/AAAAAAAAAKY/F99HlnZ1SMU/s1600/IMG_0041.JPG"&gt;&lt;img border="0" alt="" src="http://3.bp.blogspot.com/_W4DGgTuAByY/Swif25AFrDI/AAAAAAAAAKY/F99HlnZ1SMU/s320/IMG_0041.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Getting ready for the swarm of attendees to come in after the doors are opened to the Big Room.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://2.bp.blogspot.com/_W4DGgTuAByY/SwigQlhh44I/AAAAAAAAAKg/emaqAof5bIA/s1600/IMG_0042.JPG"&gt;&lt;img border="0" alt="" src="http://2.bp.blogspot.com/_W4DGgTuAByY/SwigQlhh44I/AAAAAAAAAKg/emaqAof5bIA/s320/IMG_0042.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Our Web Platform includes a bunch of products, including Silverlight (lower-left corner). That's where I would be.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://2.bp.blogspot.com/_W4DGgTuAByY/SwigoKgPd0I/AAAAAAAAAKo/RgraCY98DFM/s1600/IMG_0043.JPG"&gt;&lt;img border="0" alt="" src="http://2.bp.blogspot.com/_W4DGgTuAByY/SwigoKgPd0I/AAAAAAAAAKo/RgraCY98DFM/s320/IMG_0043.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This is where I answered countless questions from scores of attendees. I was shocked how many of them knew who I was before I introduced myself. Some knew me from Twitter and some knew me from my blog. It was lots of fun hearing about so many different ways people were using my team's product.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://2.bp.blogspot.com/_W4DGgTuAByY/Swii3sudO2I/AAAAAAAAALA/zkHgRzJ1aO4/s1600/IMG_0058.JPG"&gt;&lt;img border="0" alt="" src="http://2.bp.blogspot.com/_W4DGgTuAByY/Swii3sudO2I/AAAAAAAAALA/zkHgRzJ1aO4/s320/IMG_0058.JPG" /&gt;&lt;/a&gt;&lt;a href="http://2.bp.blogspot.com/_W4DGgTuAByY/SwiihoP9luI/AAAAAAAAAK4/cRcb4UkgPnc/s1600/IMG_0057.JPG"&gt;&lt;img border="0" alt="" src="http://2.bp.blogspot.com/_W4DGgTuAByY/SwiihoP9luI/AAAAAAAAAK4/cRcb4UkgPnc/s320/IMG_0057.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The convention center Wednesday morning at 7:00am.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://1.bp.blogspot.com/_W4DGgTuAByY/SwijKXflaZI/AAAAAAAAALI/HXs6ExJ9Rro/s1600/IMG_0059.JPG"&gt;&lt;img border="0" alt="" src="http://1.bp.blogspot.com/_W4DGgTuAByY/SwijKXflaZI/AAAAAAAAALI/HXs6ExJ9Rro/s320/IMG_0059.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;People are starting to fill the seats Wednesday morning.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://3.bp.blogspot.com/_W4DGgTuAByY/SwijcXhzOLI/AAAAAAAAALQ/MnDN4K-lymA/s1600/IMG_0050.JPG"&gt;&lt;img border="0" alt="" src="http://3.bp.blogspot.com/_W4DGgTuAByY/SwijcXhzOLI/AAAAAAAAALQ/MnDN4K-lymA/s320/IMG_0050.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;But don't worry, there are plenty of seats in the back.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://2.bp.blogspot.com/_W4DGgTuAByY/SwijuwfQGPI/AAAAAAAAALY/YQ-fmO8CbHM/s1600/IMG_0060.JPG"&gt;&lt;img border="0" alt="" src="http://2.bp.blogspot.com/_W4DGgTuAByY/SwijuwfQGPI/AAAAAAAAALY/YQ-fmO8CbHM/s320/IMG_0060.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://hanselman.com" target="_blank"&gt;Scott Hanselman&lt;/a&gt; (&lt;a href="http://twitter.com/shanselman" target="_blank"&gt;@shanselman&lt;/a&gt;) and I were walking around going through talking points in preparation for the keynote demo.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://2.bp.blogspot.com/_W4DGgTuAByY/SwikZ5HAELI/AAAAAAAAALg/RiIW7JRKoas/s1600/IMG_0061.JPG"&gt;&lt;img border="0" alt="" src="http://2.bp.blogspot.com/_W4DGgTuAByY/SwikZ5HAELI/AAAAAAAAALg/RiIW7JRKoas/s320/IMG_0061.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I made sure to grab this photo op before the keynote, so that even if our demo failed miserably, I had Scott Hanselman and &lt;a href="http://weblogs.asp.net/ScottGu/" target="_blank"&gt;Scott Guthrie&lt;/a&gt; (&lt;a href="http://twitter.com/scottgu" target="_blank"&gt;@scottgu&lt;/a&gt;) smiling. :-)&lt;/p&gt;  &lt;p&gt;&lt;a href="http://3.bp.blogspot.com/_W4DGgTuAByY/SwikwOioXaI/AAAAAAAAALo/TYbzGdlKg8M/s1600/IMG_0062.JPG"&gt;&lt;img border="0" alt="" src="http://3.bp.blogspot.com/_W4DGgTuAByY/SwikwOioXaI/AAAAAAAAALo/TYbzGdlKg8M/s320/IMG_0062.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Just a tiny, tiny part of the back stage operation. It's nothing short of a major TV production.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://3.bp.blogspot.com/_W4DGgTuAByY/SwilSFkwIHI/AAAAAAAAALw/9TozNLnVRGg/s1600/IMG_0024.JPG"&gt;&lt;img border="0" alt="" src="http://3.bp.blogspot.com/_W4DGgTuAByY/SwilSFkwIHI/AAAAAAAAALw/9TozNLnVRGg/s320/IMG_0024.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Another small part of the back stage operation.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://3.bp.blogspot.com/_W4DGgTuAByY/SwilpXKTy0I/AAAAAAAAAL4/qib71kvENY4/s1600/IMG_0069.JPG"&gt;&lt;img border="0" alt="" src="http://3.bp.blogspot.com/_W4DGgTuAByY/SwilpXKTy0I/AAAAAAAAAL4/qib71kvENY4/s320/IMG_0069.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;The rooftop pool at The Standard Wednesday night. If the place wasn't also a nightclub, I would have taken a dip to release the tension from an insanely hectic day. But alas, there were a few hundred people around that had a different purpose for the area. Notice the movie that is playing across the street. In this picture, behind the 3rd chair from the left is a projector, displaying the movie on the other building.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://3.bp.blogspot.com/_W4DGgTuAByY/SwimrODciaI/AAAAAAAAAMA/8_fC9BpHa88/s1600/IMG_0070.JPG"&gt;&lt;img border="0" alt="" src="http://3.bp.blogspot.com/_W4DGgTuAByY/SwimrODciaI/AAAAAAAAAMA/8_fC9BpHa88/s320/IMG_0070.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Just a few of the people that are way cooler than me, having a good time paying $10-$15 per drink.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://3.bp.blogspot.com/_W4DGgTuAByY/SwinJG2wWVI/AAAAAAAAAMI/L5l-w6NWFPU/s1600/IMG_0076.JPG"&gt;&lt;img border="0" alt="" src="http://3.bp.blogspot.com/_W4DGgTuAByY/SwinJG2wWVI/AAAAAAAAAMI/L5l-w6NWFPU/s320/IMG_0076.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;A full-size model of a Mars Rover. We learned that NASA uses Windows Azure for the images gathered from Mars.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://3.bp.blogspot.com/_W4DGgTuAByY/SwineCwc1cI/AAAAAAAAAMQ/AI9RRKsjtlc/s1600/IMG_0077.JPG"&gt;&lt;img border="0" alt="" src="http://3.bp.blogspot.com/_W4DGgTuAByY/SwineCwc1cI/AAAAAAAAAMQ/AI9RRKsjtlc/s320/IMG_0077.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Another view of the rover.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://1.bp.blogspot.com/_W4DGgTuAByY/Swio0rOACuI/AAAAAAAAAMw/piUdvZ8Czmw/s1600/IMG_0084.JPG"&gt;&lt;img border="0" alt="" src="http://1.bp.blogspot.com/_W4DGgTuAByY/Swio0rOACuI/AAAAAAAAAMw/piUdvZ8Czmw/s320/IMG_0084.JPG" /&gt;&lt;/a&gt;&lt;a href="http://2.bp.blogspot.com/_W4DGgTuAByY/Swio_lk1UUI/AAAAAAAAAM4/GYmf4cj7XtQ/s1600/IMG_0086.JPG"&gt;&lt;img border="0" alt="" src="http://2.bp.blogspot.com/_W4DGgTuAByY/Swio_lk1UUI/AAAAAAAAAM4/GYmf4cj7XtQ/s320/IMG_0086.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Impressive piece of machinery.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://4.bp.blogspot.com/_W4DGgTuAByY/SwiqyZUoa7I/AAAAAAAAANY/3I3estGAayk/s1600/IMG_0097.JPG"&gt;&lt;img border="0" alt="" src="http://4.bp.blogspot.com/_W4DGgTuAByY/SwiqyZUoa7I/AAAAAAAAANY/3I3estGAayk/s320/IMG_0097.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;I was quite relaxed on the last day of the conference.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://3.bp.blogspot.com/_W4DGgTuAByY/SwinyuHe06I/AAAAAAAAAMY/u6gfGlJka2g/s1600/IMG_0078.JPG"&gt;&lt;img border="0" alt="" src="http://3.bp.blogspot.com/_W4DGgTuAByY/SwinyuHe06I/AAAAAAAAAMY/u6gfGlJka2g/s320/IMG_0078.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;A couple of smaller rovers. The small one was designed in the I-DEAS software that I worked on at SDRC. I remember seeing the designs for it when I worked there.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://1.bp.blogspot.com/_W4DGgTuAByY/SwioDHWuDGI/AAAAAAAAAMg/iL0jfr711-A/s1600/IMG_0081.JPG"&gt;&lt;img border="0" alt="" src="http://1.bp.blogspot.com/_W4DGgTuAByY/SwioDHWuDGI/AAAAAAAAAMg/iL0jfr711-A/s320/IMG_0081.JPG" /&gt;&lt;/a&gt;&lt;a href="http://3.bp.blogspot.com/_W4DGgTuAByY/SwioSHDM_yI/AAAAAAAAAMo/JvWotlRxFEk/s1600/IMG_0083.JPG"&gt;&lt;img border="0" alt="" src="http://3.bp.blogspot.com/_W4DGgTuAByY/SwioSHDM_yI/AAAAAAAAAMo/JvWotlRxFEk/s320/IMG_0083.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://1.bp.blogspot.com/_W4DGgTuAByY/SwipdB1myNI/AAAAAAAAANA/QorDT3HwYp4/s1600/IMG_0087.JPG"&gt;&lt;img border="0" alt="" src="http://1.bp.blogspot.com/_W4DGgTuAByY/SwipdB1myNI/AAAAAAAAANA/QorDT3HwYp4/s320/IMG_0087.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Scott Hanselman broadcasting live for Channel 9.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://4.bp.blogspot.com/_W4DGgTuAByY/Swip6CvFVuI/AAAAAAAAANI/QUJiMVOMHYo/s1600/IMG_0088.JPG"&gt;&lt;img border="0" alt="" src="http://4.bp.blogspot.com/_W4DGgTuAByY/Swip6CvFVuI/AAAAAAAAANI/QUJiMVOMHYo/s320/IMG_0088.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;This device can be used as a "joystick." Just by looking at your target, and then concentrating, you can shoot the bad guys in the game. Controlled only by concentration/relaxation, and head movement, and built from components that you can buy at electronics stores.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://4.bp.blogspot.com/_W4DGgTuAByY/SwiqfgsrTHI/AAAAAAAAANQ/Cl_ZQywm6no/s1600/IMG_0090.JPG"&gt;&lt;img border="0" alt="" src="http://4.bp.blogspot.com/_W4DGgTuAByY/SwiqfgsrTHI/AAAAAAAAANQ/Cl_ZQywm6no/s320/IMG_0090.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Brad Abrams presenting on &lt;a href="http://silverlight.net/riaservices" target="_blank"&gt;RIA Services&lt;/a&gt;. I was sitting about half-way back in the room.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://3.bp.blogspot.com/_W4DGgTuAByY/SwircbJrfuI/AAAAAAAAANg/DtZfMZh1NRQ/s1600/IMG_0098.JPG"&gt;&lt;img border="0" alt="" src="http://3.bp.blogspot.com/_W4DGgTuAByY/SwircbJrfuI/AAAAAAAAANg/DtZfMZh1NRQ/s320/IMG_0098.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/dinesh.kulkarni/" target="_blank"&gt;Dinesh Kulkarni&lt;/a&gt; giving another presentation on RIA Services. We were glad to see so much interest.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://3.bp.blogspot.com/_W4DGgTuAByY/Swir0wVx10I/AAAAAAAAANo/ccX9X_khsIQ/s1600/IMG_0101.JPG"&gt;&lt;img border="0" alt="" src="http://3.bp.blogspot.com/_W4DGgTuAByY/Swir0wVx10I/AAAAAAAAANo/ccX9X_khsIQ/s320/IMG_0101.JPG" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/dinesh.kulkarni/" target="_blank"&gt;Dinesh Kulkarni&lt;/a&gt;, &lt;a href="http://blogs.msdn.com/digital_ruminations/" target="_blank"&gt;Mathew Charles&lt;/a&gt; (&lt;a href="http://twitter.com/mathew_charles" target="_blank"&gt;@mathew_charles&lt;/a&gt;), &lt;a href="http://blogs.msdn.com/BradA/" target="_blank"&gt;Brad Abrams&lt;/a&gt;, &lt;a href="http://nikhilk.net" target="_blank"&gt;Nikhil Kothari&lt;/a&gt; (&lt;a href="http://twitter.com/nikhilk" target="_blank"&gt;@nikhilk&lt;/a&gt;), Jeff Handley. The conference is over!  And thanks to &lt;a href="http://www.davidmakogon.com/" target="_blank"&gt;David Makogon&lt;/a&gt; (&lt;a href="http://twitter.com/dmakogon" target="_blank"&gt;@dmakogon&lt;/a&gt;) for taking the picture!&lt;/p&gt;  &lt;p /&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:c598e54b-32b1-4603-95b4-2d8f4e16f69e" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/PDC09" rel="tag"&gt;PDC09&lt;/a&gt;&lt;/div&gt;&lt;img src="http://jeffhandley.com/aggbug/219.aspx" width="1" height="1" /&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/5WtAlb2pVnULm7uLpbmTQTIkE48/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5WtAlb2pVnULm7uLpbmTQTIkE48/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/5WtAlb2pVnULm7uLpbmTQTIkE48/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/5WtAlb2pVnULm7uLpbmTQTIkE48/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/JeffHandley/~4/Dx2z8fJfEyI" height="1" width="1"/&gt;</description>
            <dc:creator>Jeff Handley</dc:creator>
            <guid isPermaLink="false">http://jeffhandley.com/archive/2009/11/21/pictures-pdc09.aspx</guid>
            <pubDate>Sun, 22 Nov 2009 03:35:58 GMT</pubDate>
            <wfw:comment>http://jeffhandley.com/comments/219.aspx</wfw:comment>
            <comments>http://jeffhandley.com/archive/2009/11/21/pictures-pdc09.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://jeffhandley.com/comments/commentRss/219.aspx</wfw:commentRss>
        <feedburner:origLink>http://jeffhandley.com/archive/2009/11/21/pictures-pdc09.aspx</feedburner:origLink></item>
        <item>
            <title>(Not) Doing Back Flips with DomainDataSource [SubmitChanges sends user to first page]</title>
            <link>http://feeds.jeffhandley.com/~r/JeffHandley/~3/VrlL14iwsQ0/domaindatasource-backflips.aspx</link>
            <description>&lt;p&gt;When changes are successfully submitted and you have paging enabled, it’s quite possible that some of the entities that have been edited now belong to a different page.  Say for instance you are viewing employees ordered by last name, and you edit one of the employees to change their last name, moving them from Jones to Adams.  After submitting changes, what should happen?  Should Adams continue to show up on the 6th page, or should the data be refreshed to place everyone where they belong?&lt;/p&gt;  &lt;p&gt;A few months ago, we made the decision to invoke a fresh load after SubmitChanges() completes successfully.  This will refresh your client view to reflect what has changed on the server, putting people on the right page.  But here we are at PDC, releasing a new build of RIA Services with this in place, and I’m somewhat regretting that design decision.  I was chatting with my manager about this, and as he said, “That’s a very heavy-handed solution to an uncommon problem.”  He’s right.  We are filing a bug to try to remove this automatic load after submitting changes.  The solution is so aggressive in fact, that the load occurs regardless of whether or not you’re using paging—we always do the load after every SubmitChanges() call succeeds.&lt;/p&gt;  &lt;h4&gt;Why is this Behavior so Annoying?&lt;/h4&gt;  &lt;p&gt;Aside from the fact that DomainDataSource is performing a load when you might not want it to, this behavior gets especially annoying when paging is enabled.  Ironic, I know.  The problem is that the load that is invoked will actually return the view to the first page.  So if the end user was editing records on the 5th page, and hits the button to submit changes, they will find themselves performing a “back flip” to page 1.&lt;/p&gt;  &lt;h4&gt;Disabling the Behavior&lt;/h4&gt;  &lt;p&gt;Here’s a quick and easy way to prevent this post-submit load from happening:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;In the SubmittedChanges event handler, check to see if the the submission was successful (!e.Cancelled &amp;amp;&amp;amp; !e.HasError).  If it was successful, set a private field for _justSubmitted = true. &lt;/li&gt;    &lt;li&gt;In the LoadingData event handler, check to see if _justSubmitted is true, and if so, set e.Cancel = true, and _justSubmitted to false. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Of course, you can also derive from DomainDataSource and add this logic, but this is Silverlight, and we have &lt;a href="http://www.nikhilk.net/Silverlight-Behaviors.aspx" target="_blank"&gt;Attached Behaviors&lt;/a&gt;!&lt;/p&gt;  &lt;p&gt;So here we have DomainDataSourceBehaviors.LoadAfterSubmit:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Windows;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Windows.Controls;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; QuickSilverlight.Behaviors&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; DomainDataSourceBehaviors&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;readonly&lt;/span&gt; DependencyProperty LoadAfterSubmitProperty =&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            DependencyProperty.RegisterAttached(&lt;span style="color: #006080"&gt;"LoadAfterSubmit"&lt;/span&gt;, &lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(&lt;span style="color: #0000ff"&gt;bool&lt;/span&gt;),&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                &lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(DomainDataSourceBehaviors), &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; PropertyMetadata(&lt;span style="color: #0000ff"&gt;false&lt;/span&gt;));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; HashSet&amp;lt;DomainDataSource&amp;gt; _submitted = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; HashSet&amp;lt;DomainDataSource&amp;gt;();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; GetLoadAfterSubmit(DomainDataSource dds)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;bool&lt;/span&gt;)dds.GetValue(LoadAfterSubmitProperty);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; SetLoadAfterSubmit(DomainDataSource dds, &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            dds.SetValue(LoadAfterSubmitProperty, &lt;span style="color: #0000ff"&gt;value&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (dds != &lt;span style="color: #0000ff"&gt;null&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!&lt;span style="color: #0000ff"&gt;value&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                    dds.SubmittedChanges += SubmittedChanges;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                    dds.LoadingData += LoadingData;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                    dds.SubmittedChanges -= SubmittedChanges;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                    dds.LoadingData -= LoadingData;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; SubmittedChanges(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, SubmittedChangesEventArgs e)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!e.Cancelled &amp;amp;&amp;amp; !e.HasError)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                _submitted.Add((DomainDataSource)sender);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; LoadingData(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, LoadingDataEventArgs e)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            DomainDataSource dds = sender &lt;span style="color: #0000ff"&gt;as&lt;/span&gt; DomainDataSource;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (_submitted.Contains(dds))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                e.Cancel = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                _submitted.Remove(dds);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;Here’s how it’s used:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;riaControls:DomainDataSource&lt;/span&gt; &lt;span style="color: #ff0000"&gt;QueryName&lt;/span&gt;=”&lt;span style="color: #ff0000"&gt;GetCustomers&lt;/span&gt;”&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #ff0000"&gt;qs:DomainDataSourceBehaviors&lt;/span&gt;.&lt;span style="color: #ff0000"&gt;LoadAfterSubmit&lt;/span&gt;=”&lt;span style="color: #ff0000"&gt;false&lt;/span&gt;”&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    ...&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;riaControls:DomainDataSource&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt; &lt;/p&gt;

&lt;p&gt;By applying this attached behavior, your DomainDataSource will no longer do “back flips” to the first page when changes are submitted.  Hope this helps!&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:5a706382-b685-4df4-ba28-b57b9e60eef4" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/RIAServices" rel="tag"&gt;RIAServices&lt;/a&gt;,&lt;a href="http://technorati.com/tags/DomainDataSource" rel="tag"&gt;DomainDataSource&lt;/a&gt;&lt;/div&gt;&lt;img src="http://jeffhandley.com/aggbug/213.aspx" width="1" height="1" /&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/e01jmgbLWLvgEnt0XcGBMANjIDk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/e01jmgbLWLvgEnt0XcGBMANjIDk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/e01jmgbLWLvgEnt0XcGBMANjIDk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/e01jmgbLWLvgEnt0XcGBMANjIDk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/JeffHandley/~4/VrlL14iwsQ0" height="1" width="1"/&gt;</description>
            <dc:creator>Jeff Handley</dc:creator>
            <guid isPermaLink="false">http://jeffhandley.com/archive/2009/11/21/domaindatasource-backflips.aspx</guid>
            <pubDate>Sat, 21 Nov 2009 17:40:51 GMT</pubDate>
            <wfw:comment>http://jeffhandley.com/comments/213.aspx</wfw:comment>
            <comments>http://jeffhandley.com/archive/2009/11/21/domaindatasource-backflips.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://jeffhandley.com/comments/commentRss/213.aspx</wfw:commentRss>
        <feedburner:origLink>http://jeffhandley.com/archive/2009/11/21/domaindatasource-backflips.aspx</feedburner:origLink></item>
        <item>
            <title>DomainDataSource Error Handling</title>
            <link>http://feeds.jeffhandley.com/~r/JeffHandley/~3/gXewGKyOe7s/domaindatasource-error-handling-again.aspx</link>
            <description>&lt;p&gt;With the RIA Services July 2009 Preview release, we heard significant feedback about the DomainDataSource error handling story.  The biggest problem was when errors occurred during Load() or SubmitChanges(), server-side errors would be silently swallowed unless you opted into the LoadError, LoadedData, and SubmittedChanges events, and explicitly checked for errors.  With the PDC release, we've change this behavior, among others related to error handling.&lt;/p&gt;  &lt;h4&gt;Different Error Conditions&lt;/h4&gt;  &lt;p&gt;The DomainDataSource can encounter errors in several different ways:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Load() is called when its prerequisites are not yet met.  For instance, there is no DomainContext specified, the QueryName provided is invalid, or the QueryParameters aren't all supplied.  We'll refer to this condition as "Load Prerequisites." &lt;/li&gt;    &lt;li&gt;Load() is called when another load is presently working, or when CanLoad is otherwise false.  We'll refer to this condition as "Cannot Load." &lt;/li&gt;    &lt;li&gt;Load() is called and the query expression fails to build, perhaps because of an invalid cast when getting parameter values from controls.  We'll refer to this condition as "Query Exception." &lt;/li&gt;    &lt;li&gt;Load() is called, the query is composed and invoked, but something fails on the server.  This could be authentication or authorization failures, or server-side exceptions. Let's call this a "Load Failure." &lt;/li&gt;    &lt;li&gt;SubmitChanges() is called, but some of the entities being submitted have validation errors.  This is a "Validation Failure." &lt;/li&gt;    &lt;li&gt;SubmitChanges() is called and the request is sent to the server, but something fails on the server.  Causes would be server-side validation failures, concurrency conflicts, authentication or authorization failures, or exceptions that occur on the server.  This is called a "Submit Error." &lt;/li&gt; &lt;/ol&gt;  &lt;h4&gt;Load Prerequisites and Cannot Load&lt;/h4&gt;  &lt;p&gt;In these conditions, an exception will occur when you call Load().  The exception message will explain what prerequisite wasn't met or why Load could not be otherwise called.  When you're using AutoLoad="True" these conditions will not occur.&lt;/p&gt;  &lt;h4&gt;Query Exception and Load Failure&lt;/h4&gt;  &lt;p&gt;The Query Exception condition occurs purely client-side, without even hitting the server.  The Load Failure occurs when invoking the load method on the server.  Regardless of this difference, both conditions will result in a LoadedData event, with the LoadedDataEventArgs.HasError property set to true, and the Error property set to the exception that occurred .  &lt;em&gt;Breaking Change Alert: In the July release, Query Exceptions resulted in a LoadError event; that event has been removed.&lt;/em&gt;  This greatly simplifies things because there are only two possibilities:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Failure: LoadingData event followed by a LoadedData event with HasError = true and Error set to the exception that occurred.&lt;/li&gt;    &lt;li&gt;Success: LoadingData event followed by a LoadedData event with HasError =.false. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;Again, the LoadError event has been removed with the PDC release.&lt;/p&gt;  &lt;h4&gt;Validation Failure and Submit Error&lt;/h4&gt;  &lt;p&gt;The SubmitChanges() error handling mimics what we see above with Query Exception and Load Failure.  Even though one scenario is client-side and the other is server-side, we surface them in the same manner.  Both will result in a SubmittedChanges event, with the SubmittedChangesEventArgs.HasError property set to true, and the Error property set to the exception that occurred.  Similar to load errors, there are only two possibilities with submitting changes:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Failure: SubmittingChanges event followed by a SubmittedChanges event with HasError = true and Error set to the exception that occurred.&lt;/li&gt;    &lt;li&gt;Success: SubmittingChanges event followed by a SubmittedChanges event with HasError = false.&lt;/li&gt; &lt;/ol&gt;  &lt;h4&gt;No More Silent Failures&lt;/h4&gt;  &lt;p&gt;&lt;em&gt;Breaking Change Alert: DomainDataSource and RIA Services in general both aggressively report exceptions now.  If an error occurs in load or submit and you don't mark it as handled, an exception will be thrown, likely bringing down your application.&lt;/em&gt;  This will accomplish three things:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Put the errors in your face during development so that you don't beat your head against your desk because you have no idea why things aren't working.&lt;/li&gt;    &lt;li&gt;Encourage you to handle errors in your applications, doing something explicit with them and marking them as handled.&lt;/li&gt;    &lt;li&gt;If you don't handle errors, your frustrated end users will see the exception messages with useful information to pass on to your support team.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;In both LoadedData and SubmittedChanges, you should have code to mark your errors as handled.  For example:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; MyDomainDataSource_LoadedData(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, LoadedDataEventArgs e)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (e.HasError)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        MessageBox.Show(e.Error.ToString(), &lt;span style="color: #006080"&gt;"Load Error"&lt;/span&gt;, MessageBoxButton.OK);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        e.MarkErrorAsHandled();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;private&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; MyDomainDataSource_SubmittedChanges(&lt;span style="color: #0000ff"&gt;object&lt;/span&gt; sender, SubmittedChangesEventArgs e)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (e.HasError)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        MessageBox.Show(e.Error.ToString(), &lt;span style="color: #006080"&gt;"Submit Error"&lt;/span&gt;, MessageBoxButton.OK);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        e.MarkErrorAsHandled();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p /&gt;

&lt;p&gt;When you use the Data Sources window, the LoadedData event handler is generated automatically.  But you should do more than just show the stock message box, perhaps log the error to a server and show your users a customized message.  In both LoadedData and SubmittedChanges events, calling e.MarkErrorAsHandled() will prevent the exception from being thrown from the DomainDataSource after the event is raised.&lt;/p&gt;

&lt;h4&gt;You, Less Frustrated&lt;/h4&gt;

&lt;p&gt;As I mentioned, we heard a lot of feedback about error handling with the DomainDataSource, resulting in the changes made as described herein.  I'd love to hear your feedback on these changes.  I do hope that this makes DomainDataSource usage a lot less frustrating when things go wrong.&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:24f887ef-2017-4552-8be3-255bcba13d4a" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/RIAServices" rel="tag"&gt;RIAServices&lt;/a&gt;,&lt;a href="http://technorati.com/tags/DomainDataSource" rel="tag"&gt;DomainDataSource&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Error+Handling" rel="tag"&gt;Error Handling&lt;/a&gt;&lt;/div&gt;&lt;img src="http://jeffhandley.com/aggbug/217.aspx" width="1" height="1" /&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/gOCfHuxDi-ZYS-lRAJ6yVUzlM1w/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gOCfHuxDi-ZYS-lRAJ6yVUzlM1w/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/gOCfHuxDi-ZYS-lRAJ6yVUzlM1w/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/gOCfHuxDi-ZYS-lRAJ6yVUzlM1w/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/JeffHandley/~4/gXewGKyOe7s" height="1" width="1"/&gt;</description>
            <dc:creator>Jeff Handley</dc:creator>
            <guid isPermaLink="false">http://jeffhandley.com/archive/2009/11/19/domaindatasource-error-handling-again.aspx</guid>
            <pubDate>Fri, 20 Nov 2009 04:29:53 GMT</pubDate>
            <wfw:comment>http://jeffhandley.com/comments/217.aspx</wfw:comment>
            <comments>http://jeffhandley.com/archive/2009/11/19/domaindatasource-error-handling-again.aspx#feedback</comments>
            <slash:comments>15</slash:comments>
            <wfw:commentRss>http://jeffhandley.com/comments/commentRss/217.aspx</wfw:commentRss>
        <feedburner:origLink>http://jeffhandley.com/archive/2009/11/19/domaindatasource-error-handling-again.aspx</feedburner:origLink></item>
        <item>
            <title>Building ContosoSales - The RIA Services Keynote Demo</title>
            <link>http://feeds.jeffhandley.com/~r/JeffHandley/~3/k-bCRht8F1I/contososales.aspx</link>
            <description>&lt;p&gt;During &lt;a href="http://weblogs.asp.net/scottgu/" target="_blank"&gt;Scott Guthrie&lt;/a&gt;’s &lt;a href="http://microsoftpdc.com/Sessions/KEY02" target="_blank"&gt;keynote at PDC09&lt;/a&gt; &lt;font size="1"&gt;(starting around 1:28:00)&lt;/font&gt;, &lt;a href="http://www.hanselman.com" target="_blank"&gt;Scott Hanselman&lt;/a&gt; presented a demo that highlighted Visual Studio 2010, Silverlight 4, RIA Services, and lots of great new tooling that ties all of these products together.  I wanted to show you how you can build the same application using installations that are available today.&lt;/p&gt;  &lt;h4&gt;Machine Setup&lt;/h4&gt;  &lt;p&gt;You’ll need to &lt;a href="http://go.microsoft.com/fwlink/?LinkID=151797" target="_blank"&gt;install Visual Studio 2010 Beta 2&lt;/a&gt; if you haven't already.  If you have a previous release of RIA Services already installed, you’ll need to uninstall it before proceeding.  Please note that you want to keep the Silverlight 3 SDK installed though.  While you can only have one Silverlight runtime installed, Visual Studio 2010 Beta 2 installs the Silverlight 3 SDK for you and it should remain installed side-by-side with the Silverlight 4 SDK.&lt;/p&gt;  &lt;p&gt;When you go to &lt;a href="http://silverlight.net/riaservices"&gt;http://silverlight.net/riaservices&lt;/a&gt;, you’ll be able to &lt;a href="http://go.microsoft.com/fwlink/?LinkID=177508" target="_blank"&gt;install the Silverlight 4 Tools for Visual Studio 2010&lt;/a&gt;.  With one installer, you get everything you need to build Silverlight 4 and RIA Services applications with Visual Studio 2010 Beta 2!&lt;/p&gt;  &lt;h4&gt;Building the Solution&lt;/h4&gt;  &lt;p&gt;&lt;em&gt;&lt;a href="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image_2.png" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 0px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="New Silverlight Applicatoin" border="0" alt="New Silverlight Applicatoin" align="right" src="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image_thumb.png" width="404" height="372" /&gt;&lt;/a&gt;From here, I’m going to assume that you have SQL 2008 Express installed on your machine.  If you’re using SQL Standard or whatnot, please make the appropriate tweaks to the instructions.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Create a new solution using the “Silverlight Navigation Application” template.  Call it ContosoSales and be sure to create a directory for the solution.&lt;/p&gt;  &lt;p&gt;When prompted, choose to host the Silverlight application in a new web application project (the default settings),  keep Silverlight 4 selected, and enable RIA Services.&lt;/p&gt;  &lt;br clear="all" /&gt;  &lt;p&gt;&lt;a href="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image4.png" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 0px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Add App_Data ASP.NET Folder" border="0" alt="Add App_Data ASP.NET Folder" align="right" src="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image4_thumb.png" width="404" height="162" /&gt;&lt;/a&gt;We’re going to add an existing database file, so we need to add the App_Data folder to the Web project.  Once that folder is added, right-click on it and choose to add an existing item.  You’ll want to grab ContosoSales_Data.mdf from the &lt;a href="/Files/ContosoSales_Data.mdf.zip" target="_blank"&gt;zip file posted here&lt;/a&gt;, and that’s what you will add into the App_Data folder.&lt;/p&gt;  &lt;br clear="all" /&gt;  &lt;p&gt;&lt;a href="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image11.png" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 0px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Entity Data Model Wizard" border="0" alt="Entity Data Model Wizard" align="right" src="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image11_thumb.png" width="404" height="413" /&gt;&lt;/a&gt;We can now create the Entity Framework model on top of our database.  Add a new ADO.NET Entity Data Model (found under the Data tab), called ContactModel.edmx.  Use the default settings to generate the model from the ContosoSales.mdf file.  Then select the 3 tables from the database (Store, StoreContact, Contact).  Change the model namespace to ContactModel.&lt;/p&gt;  &lt;br clear="all" /&gt;  &lt;p&gt;At this point, you’ll need to build your solution. &lt;/p&gt;  &lt;br clear="all" /&gt;  &lt;p&gt;&lt;a href="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image23.png" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 0px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Add New Domain Service Class" border="0" alt="Add New Domain Service Class" align="right" src="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image23_thumb.png" width="404" height="414" /&gt;&lt;/a&gt; Now, we can add our Domain Service Class using the RIA Services Domain Service wizard (found under the Web tab).  Name the class ContactService.cs.&lt;/p&gt;  &lt;p&gt;In the wizard, you’ll need to select all three of the entities and enable editing for Contact.  We also want to turn on ‘Generate associated classes for metadata.’&lt;/p&gt;  &lt;p&gt;&lt;em&gt;Note: During the keynote demo, we already had the metadata class in place so that we could have the attributes applied to it ahead of time, which is why we did this a little bit differently during the demo.  Using this wizard, RIA Services will add the necessary references to your project and add some entries in your web.config to configure the service.  You don’t have to use the wizard to create your Domain Service, but it helps get you going very quickly.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;We now want to edit the metadata for our entities.  To keep things simple, we’ll use the single metadata file that was created from the wizard.  Edit ContactService.metadata.cs to have the following:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.ComponentModel.DataAnnotations;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Web.DomainServices;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; ContosoSales.Web&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    [MetadataTypeAttribute(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(Contact.ContactMetadata))]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;partial&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Contact&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;internal&lt;/span&gt; &lt;span style="color: #0000ff"&gt;sealed&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; ContactMetadata&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; ContactID { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; ContactPhoto { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; IEnumerable&amp;lt;StoreContact&amp;gt; StoreContacts { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            [Required]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            [StringLength(30, MinimumLength = 2)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            [Display(Name = &lt;span style="color: #006080"&gt;"First Name"&lt;/span&gt;)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; FirstName { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            [Required]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            [StringLength(30, MinimumLength = 2)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            [Display(Name = &lt;span style="color: #006080"&gt;"Last Name"&lt;/span&gt;)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; LastName { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            [Required]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            [Range(10, 1000000, ErrorMessage = &lt;span style="color: #006080"&gt;"{0} must be between $10 and $1,000,000"&lt;/span&gt;)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            [Display(Name = &lt;span style="color: #006080"&gt;"Sales Target"&lt;/span&gt;)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;decimal&lt;/span&gt; SalesTarget { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            [Required]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            [Display(Name = &lt;span style="color: #006080"&gt;"Work Phone"&lt;/span&gt;)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; WorkPhone { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    [MetadataTypeAttribute(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(Store.StoreMetadata))]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;partial&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; Store&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;internal&lt;/span&gt; &lt;span style="color: #0000ff"&gt;sealed&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; StoreMetadata&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; StoreID { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            [Required]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; City { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            [Required]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            [Display(Name = &lt;span style="color: #006080"&gt;"State/Province"&lt;/span&gt;)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; StateProvince { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            [Display(Name = &lt;span style="color: #006080"&gt;"Store Image"&lt;/span&gt;)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; StoreImage { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            [Required]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            [Display(Name = &lt;span style="color: #006080"&gt;"Store Name"&lt;/span&gt;)]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; StoreName { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            [Include]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; IEnumerable&amp;lt;StoreContact&amp;gt; StoreContacts { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    [MetadataTypeAttribute(&lt;span style="color: #0000ff"&gt;typeof&lt;/span&gt;(StoreContact.StoreContactMetadata))]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;partial&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; StoreContact&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;internal&lt;/span&gt; &lt;span style="color: #0000ff"&gt;sealed&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; StoreContactMetadata&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; StoreID { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; ContactID { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            [Required]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; Position { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Store Store { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            [Include]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; Contact Contact { get; set; }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;br /&gt;

&lt;p&gt;In this application, we actually only need to provide a single query for getting Stores, and a single update method for updating Contacts.  The DomainService class can be trimmed down to the following:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Data;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Web.DomainServices.Providers;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Web.Ria;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; ContosoSales.Web&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    [EnableClientAccess]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; ContactService : LinqToEntitiesDomainService&amp;lt;ContosoSales_DataEntities&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; IQueryable&amp;lt;Store&amp;gt; GetStores()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; from store &lt;span style="color: #0000ff"&gt;in&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ObjectContext.Stores.Include(&lt;span style="color: #006080"&gt;"StoreContacts"&lt;/span&gt;).Include(&lt;span style="color: #006080"&gt;"StoreContacts.Store"&lt;/span&gt;)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                   &lt;span style="color: #0000ff"&gt;where&lt;/span&gt; store.StateProvince == &lt;span style="color: #006080"&gt;"CA"&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                   orderby store.StoreName&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                   select store;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;void&lt;/span&gt; UpdateContact(Contact currentContact)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; ((currentContact.EntityState == EntityState.Detached))&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ObjectContext.AttachAsModified(currentContact, &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.ChangeSet.GetOriginal(currentContact));&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;
  &lt;br /&gt;&lt;/p&gt;

&lt;p /&gt;

&lt;p /&gt;

&lt;p&gt;We’re finished creating the Domain Service now, so we can go ahead and build the solution.  This will trigger the RIA Services code generation, ultimately allowing the Data Sources window to pick up our model.&lt;/p&gt;

&lt;p&gt;We’re going to build the Silverlight application like most developers would, without the awesome styles provided by a designer.  But at the end of this post, I’ll give you a link to get the fully styled version of the application.&lt;/p&gt;

&lt;p&gt;Open up Home.xaml; we’ll create our controls in there.  During the demo, we used a Blank.xaml and a Contacts.xaml, but we’ll just stick with Home.xaml here to keep things simple.  We want to resize the page, drop a few grids into place and get something that looks like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image28.png" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Grid layout - 3 columns, with 2-row grids in the left and right columns" border="0" alt="Grid layout - 3 columns, with 2-row grids in the left and right columns" src="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image28_thumb.png" width="644" height="275" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;We now need to get to the Data Sources window.  If it’s not already open, you can open it using Data-&amp;gt;Show Data Sources menu option.  It might take a few moments for your model to show up in the window, but you will end up seeing ContactContext with Store under it.&lt;/p&gt;

&lt;br clear="all" /&gt;

&lt;p&gt;&lt;a href="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image37.png" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 0px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Customize Control Binding from Data Sources window" border="0" alt="Customize Control Binding from Data Sources window" align="right" src="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image37_thumb.png" width="404" height="291" /&gt;&lt;/a&gt; By default, ListBox doesn’t show up as an option for the Store list, but we can easily add it.  Click the dropdown next to Store and choose “Customize…”  Then turn on the checkbox for ListBox and click OK.&lt;/p&gt;

&lt;p /&gt;

&lt;p&gt;Now you can click the dropdown next to Store again and choose ListBox.  This tells the Data Sources window that when you drag Store onto the design surface, it should create a new ListBox control.  Go ahead and do this, dropping the ListBox into the upper-left cell in our grid.  Once you have the ListBox positioned entirely within the appropriate grid cell, you’ll want to use the same right-click, Reset Layout-&amp;gt;All gesture you saw during the keynote.  This will size the ListBox to fill its container.&lt;/p&gt;

&lt;br clear="all" /&gt;

&lt;p&gt;&lt;a href="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image42.png" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 0px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Choose Toolbox Items to add DataPager" border="0" alt="Choose Toolbox Items to add DataPager" align="right" src="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image42_thumb.png" width="404" height="257" /&gt;&lt;/a&gt; During the keynote, we had a DataPager already in place in the page, but of course we don’t have that in place ourselves.  Before we’ll be able to add the DataPager to the view, we need to add DataPager into the Toolbox by right-clicking on the toolbox and selecting Choose Items.&lt;/p&gt;

&lt;p&gt;Once you have DataPager in your Toolbox, you can drag one out of your Toolbox and into the lower-left cell in our grid.  Use the Reset Layout-&amp;gt;All gesture on this control as well.&lt;/p&gt;

&lt;p&gt;Using the Properties window, set the DataPager’s DisplayMode to PreviousNext and also set the PageSize property to 5.  Then drag the Store entity out of the Data Sources window and drop it onto the DataPager.  This will bind the existing DataPager control to the same collection of Stores as the ListBox we created a minute ago, thus applying server-side paging to the ListBox.  You should see something like this:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image60.png" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ListBox and DataPager are added to the Grid" border="0" alt="ListBox and DataPager are added to the Grid" src="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image60_thumb.png" width="644" height="319" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Let’s now set up the next part of the master-details scenario.  Expand Store in the Data Sources window and select StoreContacts.  Use the dropdown to select ListBox and drag StoreContacts onto the middle cell in our grid layout.  Be sure to use Reset Layout-&amp;gt;All to have it fill its container.&lt;/p&gt;

&lt;br clear="all" /&gt;

&lt;p&gt;We also want to expand StoreContacts, select Contact, and &lt;a href="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image51.png" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; margin: 10px 0px 0px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Data Sources window shows our model - Customize the Contact Details" border="0" alt="Data Sources window shows our model - Customize the Contact Details" align="right" src="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image51_thumb.png" width="234" height="244" /&gt;&lt;/a&gt;choose to have it generate Details.  Before we drag this Details view onto the page though, we want to make a few adjustments to what will be generated.&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;For ContactID, select [None]; &lt;/li&gt;

  &lt;li&gt;For ContactPhoto, select Customize… and then check Image and click OK; &lt;/li&gt;

  &lt;li&gt;Then for ContactPhoto, select the Image control. &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;We can now drag Contact into the upper-right cell of our grid layout and reset the layout.&lt;/p&gt;

&lt;p /&gt;

&lt;br clear="all" /&gt;

&lt;p&gt;&lt;em&gt;&lt;a href="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image55.png" rel="lightbox"&gt;&lt;img style="border-right-width: 0px; margin: 0px 0px 0px 10px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="Use the Data Binding picker to select the String Format for currency" border="0" alt="Use the Data Binding picker to select the String Format for currency" align="right" src="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image55_thumb.png" width="404" height="291" /&gt;&lt;/a&gt;In the keynote, Scott deleted the Contact Photo label and resized the Image control to fill the width of the details.  If you do this too, you might encounter a bug where the image placeholder isn’t rendered correctly.  This is a known bug that occurs in some scenarios.  Often, zooming the view to 100% will alleviate this issue.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Let’s edit the Sales Target textbox using the binding picker to set the String Format for the binding, setting it to {0:c}.&lt;/p&gt;

&lt;p&gt;We now just need to create a Save button and wire it up to submit changes.  Drag a button out of the Toolbox, dropping it into the lower-right cell of the grid; change its Content to “Save” and then double-click on it to set its click handler.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;There’s a known bug with the preview release that prevents IntelliSense from working at this point, until you perform a build.  So just hit F6 and IntelliSense will come back.&lt;/em&gt;&lt;/p&gt;

&lt;p /&gt;

&lt;p&gt;In the click event handler, add the single line of code:&lt;/p&gt;

&lt;div id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.storeDomainDataSource.SubmitChanges();&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;
  &lt;br /&gt;You can now run the application and it’s fully functional.  You should be able to page through the records, click through the stores, store contacts, and edit the contact details, with validation wired up, and the ability to save changes.  Of course, it’s not yet styled, and we don’t have any of the images in place in the web project.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image64.png" target="_blank"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ContosoSales - Working Application" border="0" alt="ContosoSales - Working Application" src="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image64_thumb.png" width="644" height="341" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h4&gt;Styling the Application&lt;/h4&gt;

&lt;p&gt;Okay, what we just build doesn’t look quite like what we saw during the keynote.  That’s where having some designer-supplied XAML comes in handy!  Our designer, &lt;a href="http://blogs.msdn.com/corrinab/" target="_blank"&gt;Corrina&lt;/a&gt;, created the design of the application using Expression Blend and provided a customized MainPage.xaml, Styles.xaml, and she had Contacts.xaml set up with the grids arranged the way that fits into the design.  Here is the finished result with the styles and everything in place:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image68.png" target="_blank"&gt;&lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="ContosoSales with styles applied" border="0" alt="ContosoSales with styles applied" src="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/BuildingContosoSalesTheRIAServicesKeynot_12431/image68_thumb.png" width="644" height="427" /&gt;&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;You can &lt;a href="/Files/ContosoSales.Styled.zip" target="_blank"&gt;download the styled version of the application here&lt;/a&gt;.  I’ll work on follow-up posts that break down how the styles transform what we built into this end result.&lt;/p&gt;

&lt;p&gt;When you download the styled application, be sure to:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;Right-click on the Zip file and hit Properties to Unblock it if necessary; &lt;/li&gt;

  &lt;li&gt;Extract the zip; &lt;/li&gt;

  &lt;li&gt;Open the solution; &lt;/li&gt;

  &lt;li&gt;Set the Web project as your Startup Project; and &lt;/li&gt;

  &lt;li&gt;Rebuild the solution. &lt;/li&gt;
&lt;/ol&gt;

&lt;h4&gt;Run-Down&lt;/h4&gt;

&lt;p&gt;You can see how the new tooling in Visual Studio 2010 jumpstarts application development using RIA Services and Silverlight 4.&lt;/p&gt;

&lt;p&gt;Here’s a quick reference to the links throughout this post:&lt;/p&gt;

&lt;ul&gt;
  &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=151797" target="_blank"&gt;Install Visual Studio 2010 Beta 2&lt;/a&gt; &lt;/li&gt;

  &lt;li&gt;&lt;a href="http://go.microsoft.com/fwlink/?LinkID=177508" target="_blank"&gt;Install the Silverlight 4 Tools for Visual Studio 2010&lt;/a&gt;, which includes: 

    &lt;ul&gt;
      &lt;li&gt;Silverlight 4 Developer Runtime &lt;/li&gt;

      &lt;li&gt;Silverlight 4 Beta SDK &lt;/li&gt;

      &lt;li&gt;Microsoft &lt;/li&gt;

      &lt;li&gt;WCF RIA Services &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/li&gt;

  &lt;li&gt;Download the Database from &lt;a href="/Files/ContosoSales_Data.mdf.zip" target="_blank"&gt;ContosoSales.mdf.zip&lt;/a&gt; &lt;/li&gt;

  &lt;li&gt;Download the styled application from &lt;a href="/Files/ContosoSales.Styled.zip" target="_blank"&gt;ContosoSales.Styled.zip&lt;/a&gt; &lt;/li&gt;

  &lt;li&gt;Be sure to visit &lt;a href="http://silverlight.net/riaservices"&gt;http://silverlight.net/riaservices&lt;/a&gt; &lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This week has been extremely exciting for me and I hope that you enjoy building the application that you saw presented during the keynote.&lt;/p&gt;

&lt;p /&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:82ddcfa6-730f-4ced-8228-fe447e18a42a" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/RIAServices" rel="tag"&gt;RIAServices&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Visual+Studio+2010" rel="tag"&gt;Visual Studio 2010&lt;/a&gt;&lt;/div&gt;&lt;img src="http://jeffhandley.com/aggbug/216.aspx" width="1" height="1" /&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/ytoQ-Ea1bWXh0xcWDP63mcQoQUs/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ytoQ-Ea1bWXh0xcWDP63mcQoQUs/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/ytoQ-Ea1bWXh0xcWDP63mcQoQUs/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/ytoQ-Ea1bWXh0xcWDP63mcQoQUs/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/JeffHandley/~4/k-bCRht8F1I" height="1" width="1"/&gt;</description>
            <dc:creator>Jeff Handley</dc:creator>
            <guid isPermaLink="false">http://jeffhandley.com/archive/2009/11/18/contososales.aspx</guid>
            <pubDate>Wed, 18 Nov 2009 18:04:00 GMT</pubDate>
            <wfw:comment>http://jeffhandley.com/comments/216.aspx</wfw:comment>
            <comments>http://jeffhandley.com/archive/2009/11/18/contososales.aspx#feedback</comments>
            <slash:comments>16</slash:comments>
            <wfw:commentRss>http://jeffhandley.com/comments/commentRss/216.aspx</wfw:commentRss>
        <feedburner:origLink>http://jeffhandley.com/archive/2009/11/18/contososales.aspx</feedburner:origLink></item>
        <item>
            <title>DomainDataSourceView API (DomainDataSource.DataView)</title>
            <link>http://feeds.jeffhandley.com/~r/JeffHandley/~3/UMyI8UeQkYE/domaindatasourceview-again.aspx</link>
            <description>&lt;p&gt;DomainDataSource has two properties for getting the data out of it: Data and DataView.  The Data property is what’s intended for exposure in Binding scenarios, for instance binding a DataGrid to the DomainDataSource.  This property is typed very simply as an IEnumerable.  The DataView property however is intended to be used for programmatic access to the entities exposed by the DomainDataSource.  While the two properties currently return the same collection instance, this might not always be true, so it’s good to properly set the expectations of these two properties.  If you need to work with the collection from the DomainDataSource, you should use the DataView property; but for Binding, you should use the Data property.&lt;/p&gt;  &lt;p&gt;Awhile back, I &lt;a href="http://jeffhandley.com/archive/2009/07/21/domaindatasource-dataview.aspx" target="_blank"&gt;asked for input&lt;/a&gt; on the DataView property and what API you would like to have for it.  We were designing a new class that would be created expressly for the purpose of the DomainDataSource.DataView property.  We wanted the API to do two thing for you: 1) Give you easy access to the properties and methods you will frequently use on the collection; and 2) Hide the properties and methods that are required to be implemented for interfaces but that you would not need to access programmatically often.  The result of this effort was a class named DomainDataSourceView.  You will see this with the PDC release of RIA Services.&lt;/p&gt;  &lt;h4&gt;Frequently Used Members&lt;/h4&gt;  &lt;p&gt;The following members are exposed as public properties and methods on the DomainDataSourceView class (DomainDataSource.DataView property):&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;General Collection Members      &lt;ul&gt;       &lt;li&gt;int Count &lt;/li&gt;        &lt;li&gt;object CurrentItem &lt;/li&gt;        &lt;li&gt;int CurrentPosition &lt;/li&gt;        &lt;li&gt;bool IsEmpty &lt;/li&gt;        &lt;li&gt;int TotalItemCount &lt;/li&gt;        &lt;li&gt;object this[int index] &lt;/li&gt;        &lt;li&gt;EventHandler CurrentChanged &lt;/li&gt;        &lt;li&gt;CurrentChangingEventHandler CurrentChanging &lt;/li&gt;        &lt;li&gt;bool Contains(object item) &lt;/li&gt;        &lt;li&gt;object GetItemAt(int index) &lt;/li&gt;        &lt;li&gt;int IndexOf(object item) &lt;/li&gt;        &lt;li&gt;bool MoveCurrentTo(object item) &lt;/li&gt;        &lt;li&gt;bool MoveCurrentToFirst() &lt;/li&gt;        &lt;li&gt;bool MoveCurrentToLast() &lt;/li&gt;        &lt;li&gt;bool MoveCurrentToNext() &lt;/li&gt;        &lt;li&gt;bool MoveCurrentToPosition(int position) &lt;/li&gt;        &lt;li&gt;bool MoveCurrentToPrevious() &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Collection Editing Members      &lt;ul&gt;       &lt;li&gt;bool CanAdd &lt;/li&gt;        &lt;li&gt;bool CanRemove &lt;/li&gt;        &lt;li&gt;void Add(object item) &lt;/li&gt;        &lt;li&gt;void Remove(object item) &lt;/li&gt;        &lt;li&gt;void RemoteAt(int index) &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;Paging Members      &lt;ul&gt;       &lt;li&gt;bool CanChangePage &lt;/li&gt;        &lt;li&gt;int PageCount &lt;/li&gt;        &lt;li&gt;int PageIndex &lt;/li&gt;        &lt;li&gt;int PageSize &lt;/li&gt;        &lt;li&gt;EventHandler&amp;lt;EventArgs&amp;gt; PageChanged &lt;/li&gt;        &lt;li&gt;EventHandler&amp;lt;PageChangingEventArgs&amp;gt; PageChanging &lt;/li&gt;        &lt;li&gt;bool MoveToFirstPage() &lt;/li&gt;        &lt;li&gt;bool MoveToLastPage() &lt;/li&gt;        &lt;li&gt;bool MoveToNextPage() &lt;/li&gt;        &lt;li&gt;bool MoveToPage(int pageIndex) &lt;/li&gt;        &lt;li&gt;bool MoveToPreviousPage() &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;h4&gt;Interface Implementations&lt;/h4&gt;  &lt;p&gt;The following members are implemented on the DomainDataSourceView class, but they are explicitly implemented against the interfaces.  This means that you won’t get intellisense for the members, and you can’t use them directly, but if you (or Silverlight/SDK controls) cast an DomainDataSourceView instance to the interface, you can access the members.  This is done for members we don’t expect you to need frequently yourself, but they are needed for the interfaces.&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;ICollectionView      &lt;ul&gt;       &lt;li&gt;bool CanFilter          &lt;ul&gt;           &lt;li&gt;This property will always return false since DomainDataSource doesn’t use Predicate-based filtering. &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;        &lt;li&gt;bool CanGroup &lt;/li&gt;        &lt;li&gt;bool CanSort &lt;/li&gt;        &lt;li&gt;CultureInfo Culture &lt;/li&gt;        &lt;li&gt;Predicate&amp;lt;object&amp;gt; Filter          &lt;ul&gt;           &lt;li&gt;This property will throw an exception, as CanFilter is always false since DomainDataSource doesn’t use Predicate-based filtering. &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;        &lt;li&gt;ObservableCollection&amp;lt;GroupDescription&amp;gt; GroupDescriptions &lt;/li&gt;        &lt;li&gt;ReadOnlyObservableCollection&amp;lt;object&amp;gt; Groups &lt;/li&gt;        &lt;li&gt;bool IsCurrentAfterLast &lt;/li&gt;        &lt;li&gt;bool IsCurrentBeforeFirst &lt;/li&gt;        &lt;li&gt;SortDescriptionCollection SortDescriptions &lt;/li&gt;        &lt;li&gt;IEnumerable SourceCollection &lt;/li&gt;        &lt;li&gt;EventHandler CurrentChanged &lt;/li&gt;        &lt;li&gt;CurrentChangingEventHandler CurrentChanging &lt;/li&gt;        &lt;li&gt;IDisposable DeferRefresh() &lt;/li&gt;        &lt;li&gt;void Refresh() &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;IEnumerable      &lt;ul&gt;       &lt;li&gt;IEnumerator GetEnumerator() &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;INotifyCollectionChanged      &lt;ul&gt;       &lt;li&gt;NotifyCollectionChangedEventHandler CollectionChanged &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;IEditableCollectionView      &lt;ul&gt;       &lt;li&gt;bool CanAddNew &lt;/li&gt;        &lt;li&gt;bool CanCancelEdit &lt;/li&gt;        &lt;li&gt;object CurrentAddItem &lt;/li&gt;        &lt;li&gt;object CurrentEditItem &lt;/li&gt;        &lt;li&gt;bool IsAddingNew &lt;/li&gt;        &lt;li&gt;bool IsEditingItem &lt;/li&gt;        &lt;li&gt;NewItemPlaceholderPosition NewItemPlaceholderPosition &lt;/li&gt;        &lt;li&gt;object AddNew() &lt;/li&gt;        &lt;li&gt;void CancelEdit() &lt;/li&gt;        &lt;li&gt;void CancelNew() &lt;/li&gt;        &lt;li&gt;void CommitEdit() &lt;/li&gt;        &lt;li&gt;void CommitNew() &lt;/li&gt;        &lt;li&gt;void EditItem(object item) &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt;    &lt;li&gt;INotifyCollectionChanged      &lt;ul&gt;       &lt;li&gt;PropertyChangedEventHandler PropertyChanged          &lt;ul&gt;           &lt;li&gt;Only raises events for public properties, and not those are are only explicitly implemented on the interfaces &lt;/li&gt;         &lt;/ul&gt;       &lt;/li&gt;     &lt;/ul&gt;   &lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;I do hope that this API provides the members you’ll need to access directly, while keeping the API as trim as possible too.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:75ccf6f9-c0f3-451f-9a5d-d38461b05a96" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/RIAServices" rel="tag"&gt;RIAServices&lt;/a&gt;,&lt;a href="http://technorati.com/tags/DomainDataSource" rel="tag"&gt;DomainDataSource&lt;/a&gt;,&lt;a href="http://technorati.com/tags/DomainDataSourceView" rel="tag"&gt;DomainDataSourceView&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;&lt;/div&gt;&lt;img src="http://jeffhandley.com/aggbug/214.aspx" width="1" height="1" /&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/mbHuWdShC73Qi8iW6GJKCmAMgBc/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mbHuWdShC73Qi8iW6GJKCmAMgBc/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/mbHuWdShC73Qi8iW6GJKCmAMgBc/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/mbHuWdShC73Qi8iW6GJKCmAMgBc/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/JeffHandley/~4/UMyI8UeQkYE" height="1" width="1"/&gt;</description>
            <dc:creator>Jeff Handley</dc:creator>
            <guid isPermaLink="false">http://jeffhandley.com/archive/2009/11/16/domaindatasourceview-again.aspx</guid>
            <pubDate>Mon, 16 Nov 2009 23:58:29 GMT</pubDate>
            <wfw:comment>http://jeffhandley.com/comments/214.aspx</wfw:comment>
            <comments>http://jeffhandley.com/archive/2009/11/16/domaindatasourceview-again.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://jeffhandley.com/comments/commentRss/214.aspx</wfw:commentRss>
        <feedburner:origLink>http://jeffhandley.com/archive/2009/11/16/domaindatasourceview-again.aspx</feedburner:origLink></item>
        <item>
            <title>DomainDataSource DataPager PageSize Pitfall</title>
            <link>http://feeds.jeffhandley.com/~r/JeffHandley/~3/2rSM6O5oyKo/domaindatasource-datapager-pagesize-pitfall.aspx</link>
            <description>&lt;p&gt;During the PDC release milestone of RIA Services, we discovered an error from DomainDataSource when using AutoLoad="True" and when using a DataPager bound to the DomainDataSource’s Data property.  We found that when the PageSize property is specified on the DataPager and not on the the DomainDataSource itself, an exception would often (but not always) be thrown from DomainDataSource, indicating that a load could not be invoked while another load was in progress.  The reason for this will actually interest you most if you use AutoLoad set to False.&lt;/p&gt;  &lt;p&gt;The issue is easiest to explain with a series of events that occurs when auto-loading.  Consider the following XAML:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;dds:DomainDataSource&lt;/span&gt; &lt;span style="color: #ff0000"&gt;x:Name&lt;/span&gt;=”&lt;span style="color: #ff0000"&gt;myDDS&lt;/span&gt;” &lt;span style="color: #ff0000"&gt;QueryName&lt;/span&gt;=”&lt;span style="color: #ff0000"&gt;GetCustomers&lt;/span&gt;”&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;dds.DomainDataSource.DomainContext&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;my:CustomerContext&lt;/span&gt; &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;dds:DomainDataSource.DomainContext&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: #800000"&gt;dds:DomainDataSource&lt;/span&gt;&lt;span style="color: #0000ff"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: #800000"&gt;data:DataPager&lt;/span&gt; &lt;span style="color: #ff0000"&gt;x:Name&lt;/span&gt;=”&lt;span style="color: #ff0000"&gt;myPager&lt;/span&gt;” &lt;span style="color: #ff0000"&gt;Source&lt;/span&gt;=”{&lt;span style="color: #ff0000"&gt;Binding&lt;/span&gt; &lt;span style="color: #ff0000"&gt;Data&lt;/span&gt;, &lt;span style="color: #ff0000"&gt;ElementName&lt;/span&gt;=&lt;span style="color: #ff0000"&gt;myDDS&lt;/span&gt;}” &lt;span style="color: #ff0000"&gt;PageSize&lt;/span&gt;=”&lt;span style="color: #ff0000"&gt;10&lt;/span&gt;” &lt;span style="color: #0000ff"&gt;/&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;
  &lt;br /&gt;With this XAML, here’s what was happening before we fixed this bug:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;myDDS gets instantiated and its properties get set &lt;/li&gt;

  &lt;li&gt;myPager gets instantiated and its properties get set (except for its Dependency Properties) &lt;/li&gt;

  &lt;li&gt;myDDS gets Loaded, during which it sees that it’s in AutoLoad mode, and it begins loading data &lt;/li&gt;

  &lt;li&gt;myPager gets loaded, at which time its Source gets bound, which causes the PageSize property to get applied to myDDS.Data.PageSize &lt;/li&gt;

  &lt;li&gt;The DomainDataSource.PageSize property gets set, and with AutoLoad set to True, this invokes a new load &lt;/li&gt;

  &lt;li&gt;Exception is thrown because a load cannot be invoked while through the DomainDataSource while another load is being performed (unless the original load has already completed, in which case a second load is successfully invoked) &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;In addition to the intermittent exception that this causes, an ostensibly worse problem also hides here.  The first load gets invoked &lt;em&gt;without a PageSize&lt;/em&gt;.  That means that no paging is applied and &lt;em&gt;all &lt;/em&gt;records are requested from the server.  Needless to say, that could be extremely expensive for both the client and the server.&lt;/p&gt;

&lt;h4&gt;Mitigation&lt;/h4&gt;

&lt;p&gt;We needed to prevent the first load from beginning until after the DataPager has been loaded and the element-to-element bindings have been applied.  But there’s no clean and safe way to know (from the DomainDataSource’s perspective) that the DataPager even exists, let alone when it has loaded.&lt;/p&gt;

&lt;p&gt;From within an event handler for the DomainDataSource’s Control.Loaded event, we use Dispatcher.BeginInvoke to initiate the first auto load.  The dispatched call allows the control loading to finish and the PageSize property to be reflected on the DomainDataSource before our load is invoked.  To be honest, I’m not thrilled with this solution, but it does the trick.  We have been unable to recreate the double-load scenario since applying this fix.  And the alternative was to always advise everyone to specify the PageSize property on the DomainDataSource rather than on the DataPager, and that would have been very unfortunate.&lt;/p&gt;

&lt;h4&gt;When AutoLoad is False&lt;/h4&gt;

&lt;p&gt;I mentioned above that the explanation of this issue would interest you most when you have AutoLoad set to false.  With AutoLoad set to true, we address the issue for you.  But when you are calling DomainDataSource.Load() yourself, you must be aware of this PageSize pitfall.  Here are three ways it can bite you if you have PageSize set on a DataPager:&lt;/p&gt;

&lt;ol&gt;
  &lt;li&gt;In your page’s constructor, you call InitializeComponent, and then call DomainDataSource.Load(); &lt;/li&gt;

  &lt;li&gt;In the DomainDataSource.Loaded event (not LoadedData), you call DomainDataSource.Load(); &lt;/li&gt;

  &lt;li&gt;In your page’s Loaded handler, you call DomainDataSource.Load(). &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;With any of these three approaches, you will see probably see the double-load.  You will quite possibly get an exception when the DataPager is loaded and the PageSize property gets applied.  Even if you don’t see the exception though, you’ll be hitting your server twice, with the first hit requesting all records.  Not good.&lt;/p&gt;

&lt;p&gt;When using AutoLoad set to false, you should utilize the same mechanism I have used for AutoLoad="True" and call Dispatcher.BeginInvoke(() =&amp;gt; myDDS.Load()).  This will defer the load until the UI thread has completed the control loading and your PageSize has been set.  If you are stubborn and pushy and want to invoke the load without dispatching it, then you can always set the PageSize on the DomainDataSource instead.&lt;/p&gt;

&lt;p&gt;I hope this information helps you avoid the DomainDataSource DataPager PageSize Pitfall.  And as always, please feel free to ping me with questions, comments, or concerns.  I love gathering your feedback!&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:2ce30b98-f0c4-4392-82c5-5c0ab2b99fe2" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/RIAServices" rel="tag"&gt;RIAServices&lt;/a&gt;,&lt;a href="http://technorati.com/tags/DomainDataSource" rel="tag"&gt;DomainDataSource&lt;/a&gt;,&lt;a href="http://technorati.com/tags/DataPager" rel="tag"&gt;DataPager&lt;/a&gt;,&lt;a href="http://technorati.com/tags/PageSize" rel="tag"&gt;PageSize&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;&lt;/div&gt;&lt;img src="http://jeffhandley.com/aggbug/215.aspx" width="1" height="1" /&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/RLGbRGqR9nfDQPPwVh0Slw7z1WI/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RLGbRGqR9nfDQPPwVh0Slw7z1WI/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/RLGbRGqR9nfDQPPwVh0Slw7z1WI/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/RLGbRGqR9nfDQPPwVh0Slw7z1WI/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/JeffHandley/~4/2rSM6O5oyKo" height="1" width="1"/&gt;</description>
            <dc:creator>Jeff Handley</dc:creator>
            <guid isPermaLink="false">http://jeffhandley.com/archive/2009/11/16/domaindatasource-datapager-pagesize-pitfall.aspx</guid>
            <pubDate>Mon, 16 Nov 2009 11:12:34 GMT</pubDate>
            <wfw:comment>http://jeffhandley.com/comments/215.aspx</wfw:comment>
            <comments>http://jeffhandley.com/archive/2009/11/16/domaindatasource-datapager-pagesize-pitfall.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://jeffhandley.com/comments/commentRss/215.aspx</wfw:commentRss>
        <feedburner:origLink>http://jeffhandley.com/archive/2009/11/16/domaindatasource-datapager-pagesize-pitfall.aspx</feedburner:origLink></item>
        <item>
            <title>DomainDataSource &amp;ndash; Single Record Results</title>
            <link>http://feeds.jeffhandley.com/~r/JeffHandley/~3/VufWYKnX4fc/domaindatasource-single-record.aspx</link>
            <description>&lt;p&gt;While the DomainDataSource is most often used for loading entire sets of records, it can also be used for loading a single record result.  This is a topic I’ve seen a few people talk about, assuming it’s a difficult thing to do, and even creating solutions for a problem that doesn’t exist.  I want to dispel the myth here: DomainDataSource can in fact be used to easily bind to a single record result.&lt;/p&gt;  &lt;p&gt;Let’s create a DomainService that has a method to get the most recent error from the AdventureWorks database:&lt;/p&gt;  &lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 2000px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;   &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;     &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&lt;span style="color: #0000ff"&gt;namespace&lt;/span&gt; SingleResult.Web&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Web.DomainServices.LinqToEntities;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Web.Ria;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    [EnableClientAccess()]&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;class&lt;/span&gt; ErrorLogService : LinqToEntitiesDomainService&amp;lt;AdventureWorksEntities&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;span style="color: #0000ff"&gt;public&lt;/span&gt; ErrorLog GetLastError()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;this&lt;/span&gt;.Context.ErrorLog.OrderByDescending(e =&amp;gt; e.ErrorTime).FirstOrDefault();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p /&gt;

&lt;p&gt;Now let’s create a XAML page that shows the details of the most recent error, using DomainDataSource:&lt;/p&gt;

&lt;div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: 'Courier New', courier, monospace; direction: ltr; max-height: 2000px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper"&gt;
  &lt;div style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"&gt;
    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;lt;UserControl x:Class=&lt;span style="color: #006080"&gt;"SingleResult.MainPage"&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;             xmlns=&lt;span style="color: #006080"&gt;"http://schemas.microsoft.com/winfx/2006/xaml/presentation"&lt;/span&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;             xmlns:x=&lt;span style="color: #006080"&gt;"http://schemas.microsoft.com/winfx/2006/xaml"&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;             xmlns:my=&lt;span style="color: #006080"&gt;"clr-namespace:SingleResult.Web"&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;             xmlns:dds=&lt;span style="color: #006080"&gt;"clr-namespace:System.Windows.Controls;assembly=System.Windows.Ria.Controls"&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &amp;lt;StackPanel x:Name=&lt;span style="color: #006080"&gt;"LayoutRoot"&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &amp;lt;dds:DomainDataSource x:Name=&lt;span style="color: #006080"&gt;"errorSource"&lt;/span&gt; QueryName=&lt;span style="color: #006080"&gt;"GetLastError"&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &amp;lt;dds:DomainDataSource.DomainContext&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;                &amp;lt;my:ErrorLogContext /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;            &amp;lt;/dds:DomainDataSource.DomainContext&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &amp;lt;/dds:DomainDataSource&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &amp;lt;TextBox Width=&lt;span style="color: #006080"&gt;"150"&lt;/span&gt; Text=&lt;span style="color: #006080"&gt;"{Binding Path=Data.ErrorNumber, ElementName=errorSource}"&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &amp;lt;TextBox Width=&lt;span style="color: #006080"&gt;"150"&lt;/span&gt; Text=&lt;span style="color: #006080"&gt;"{Binding Path=Data.ErrorSeverity, ElementName=errorSource}"&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &amp;lt;TextBox Width=&lt;span style="color: #006080"&gt;"150"&lt;/span&gt; Text=&lt;span style="color: #006080"&gt;"{Binding Path=Data.UserName, ElementName=errorSource}"&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &amp;lt;TextBox Width=&lt;span style="color: #006080"&gt;"150"&lt;/span&gt; Text=&lt;span style="color: #006080"&gt;"{Binding Path=Data.ErrorState, ElementName=errorSource}"&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &amp;lt;TextBox Width=&lt;span style="color: #006080"&gt;"150"&lt;/span&gt; Text=&lt;span style="color: #006080"&gt;"{Binding Path=Data.ErrorProcedure, ElementName=errorSource}"&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &amp;lt;TextBox Width=&lt;span style="color: #006080"&gt;"150"&lt;/span&gt; Text=&lt;span style="color: #006080"&gt;"{Binding Path=Data.ErrorLine, ElementName=errorSource}"&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;        &amp;lt;TextBox Width=&lt;span style="color: #006080"&gt;"150"&lt;/span&gt; Text=&lt;span style="color: #006080"&gt;"{Binding Path=Data.ErrorMessage, ElementName=errorSource}"&lt;/span&gt; /&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;    &amp;lt;/StackPanel&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: white; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: 'Courier New', courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px"&gt;&amp;lt;/UserControl&amp;gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p /&gt;

&lt;p&gt;Bam, Bob’s your Uncle!  In other words, that’s it; it works.&lt;/p&gt;

&lt;p&gt;The reason this works so easily is that the Silverlight Binding identifies that the Data property from the binding implements ICollectionView.  When it can’t find the nested property on Data, it then infers Data.CurrentItem, and finds the child properties from that.&lt;/p&gt;

&lt;p&gt;Strangely enough, with the RIA Services July 2009 Preview, if you tried to put Data.CurrentItem in yourself, it would fail.  This was a joint bug between Silverlight and RIA Services, and it will be fixed in the next release of each.&lt;/p&gt;

&lt;p&gt;Happy binding!&lt;/p&gt;

&lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:25478dac-82a0-4fef-9060-6ca41c7caab6" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/RIAServices" rel="tag"&gt;RIAServices&lt;/a&gt;,&lt;a href="http://technorati.com/tags/DomainDataSource" rel="tag"&gt;DomainDataSource&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Binding" rel="tag"&gt;Binding&lt;/a&gt;&lt;/div&gt;&lt;img src="http://jeffhandley.com/aggbug/211.aspx" width="1" height="1" /&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/Ys6dK4yaTInw4FM41B_ebN9wZNk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ys6dK4yaTInw4FM41B_ebN9wZNk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/Ys6dK4yaTInw4FM41B_ebN9wZNk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/Ys6dK4yaTInw4FM41B_ebN9wZNk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/JeffHandley/~4/VufWYKnX4fc" height="1" width="1"/&gt;</description>
            <dc:creator>Jeff Handley</dc:creator>
            <guid isPermaLink="false">http://jeffhandley.com/archive/2009/11/10/domaindatasource-single-record.aspx</guid>
            <pubDate>Tue, 10 Nov 2009 18:33:07 GMT</pubDate>
            <wfw:comment>http://jeffhandley.com/comments/211.aspx</wfw:comment>
            <comments>http://jeffhandley.com/archive/2009/11/10/domaindatasource-single-record.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://jeffhandley.com/comments/commentRss/211.aspx</wfw:commentRss>
        <feedburner:origLink>http://jeffhandley.com/archive/2009/11/10/domaindatasource-single-record.aspx</feedburner:origLink></item>
        <item>
            <title>Validating Objects and Properties with Validator</title>
            <link>http://feeds.jeffhandley.com/~r/JeffHandley/~3/kVDk-z-hF7Y/validator.aspx</link>
            <description>&lt;p&gt;ASP.NET Dynamic Data introduced the System.ComponentModel.DataAnnotations namespace in .NET 3.5 SP1.  The namespace contained a bunch of attributes for applying validation rules to objects and their properties.  With the “Alexandria” project (which morphed into .NET RIA Services plus some Silverlight/SDK/Toolkit additions), we were exposing your server-side entities up to your Silverlight client.  In doing this, we wanted to preserve your DataAnnotations attributes on the client, which of course meant that we needed a Silverlight version of this assembly.   &lt;br /&gt;&lt;em&gt;(See Also: &lt;/em&gt;&lt;a href="http://jeffhandley.com/archive/2009/08/12/sharingsourcewithsilverlight.aspx" target="_blank"&gt;&lt;em&gt;Sharing Source with Silverlight&lt;/em&gt;&lt;/a&gt;&lt;em&gt;).&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;As our team was creating this Silverlight assembly, we found that we needed a utility to easily validate an object and/or its properties.  This utility would be used by the Silverlight DataGrid and DataForm controls when objects are edited or added.  We also hit some scenarios that led to new requirements for the validation attributes.  The result was some fairly significant additions and changes that ended up being included in the Silverlight 3 SDK.  Here are some of the crucial differences between the .NET 3.5 SP1 version of DataAnnotations, and the Silverlight 3 version:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;strong&gt;Validator&lt;/strong&gt; is a static class providing utility methods for validating properties and objects.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;bool ValidationAttribute.IsValid(object)&lt;/strong&gt; is internal in Silverlight, but public and virtual in .NET 3.5 SP1 (Desktop framework).&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;ValidationResult ValidationAttribute.IsValid(object, ValidationContext)&lt;/strong&gt; was added to replace IsValid(object) as the method attributes will override.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;ValidationAttribute.GetValidationResult&lt;/strong&gt; serves as the public entry point instead of IsValid(object).&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;ValidationResult&lt;/strong&gt; represents an error produced as a result of validation (note that the static &lt;strong&gt;ValidationResult.Success&lt;/strong&gt; is used to represent successful validation).&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;ValidationContext&lt;/strong&gt; represents the context under which validation is being performed, providing access to the object instance, its type, and other state/context.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;In .NET 3.5 SP1, the only way to ask a validation attribute if it was valid for a given value was through the IsValid(object) API.  When performing validation for a property attribute, the value of the property is supplied as the value to validate, giving no contextual information about the rest of the object’s properties.  This severely limits what can be done with the validation attributes.  With .NET RIA Services, we wanted to ensure that more context is always provided to the attributes, so we created the ValidationContext class to represent provide this information. ValidationContext has some useful properties:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;strong&gt;ObjectInstance&lt;/strong&gt; is the object being validated, so that property-level validators can access the containing object.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;ObjectType&lt;/strong&gt; is the type of the object being validated.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;DisplayName&lt;/strong&gt; is the display name of the property or object being validated, respecting the [Display] attribute if utilized.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;MemberName&lt;/strong&gt; is the property name or type name of the property or object being validated.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;Items&lt;/strong&gt; is a property bag that can be used to provide additional state/context for the validation.&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;ValidationContext also implements IServiceProvider, so that services (such as a repository) can be provided to the attributes being validated.&lt;/p&gt;  &lt;p&gt;&lt;em&gt;It’s important to note that for cross-field validation, relying on the ObjectInstance comes with a caveat.  It’s possible that the end user has entered a value for a property that could not be set—for instance specifying “ABC” for a numeric field.  In cases like that, asking the instance for that numeric property will of course not give you the “ABC” value that the user has entered, thus the object’s other properties are in an indeterminate state.  But even so, we’ve found that it’s extremely valuable to provide this object instance to the validation attributes.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;The new Validator class relies heavily on this ValidationContext when calling its validation methods.  These methods are meant to be the interface that frameworks and applications use to perform validation, rather than forcing everyone to iterate over the attributes and validate them.  Validator actually comes with some low-level building blocks as well as higher-level methods.  For each of the following, the Try method is a bool that indicates whether or not validation was successful, with a collection of ValidationResults being populated along the way.  The method without the Try prefix is a void, throwing a ValidationException upon the first validation failure (or completing without exception when successful).&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;strong&gt;[Try]ValidateValue&lt;/strong&gt; takes any value and a list of validation attributes, and validates each attribute using the value and the supplied ValidationContext.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;[Try]ValidateProperty&lt;/strong&gt; takes a value and a ValidationContext that specifies the ObjectInstance and MemberName to validate.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;[Try]ValidateObject&lt;/strong&gt; takes an object instance and a ValidationContext where the ObjectInstance matches the instance provided, and validates all property-level and object-level validation attributes.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;You’ll notice that each of these methods requires that you provide a ValidationContext, and this often trips people up because constructing a ValidationContext requires a few parameters.&lt;/p&gt;  &lt;p&gt;Here are the constructor parameters for ValidationContext:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;&lt;strong&gt;object instance&lt;/strong&gt; – The object instance being validated – such as your Customer entity.  Note that this is &lt;em&gt;not&lt;/em&gt; the property value when you are validating a property.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;IServiceProvider serviceProvider&lt;/strong&gt; – This is an optional source to use for the ValidationContext IServiceProvider implementation.  If you have services that you need to expose to your validation attributes, you can provide a service provider to the validation context, and then the attributes can retrieve the services through the ValidationContext’s implementation of IServiceProvider.  Essentially, ValidationContext just serves as a wrapper around your provider.&lt;/li&gt;    &lt;li&gt;&lt;strong&gt;IDictionary&amp;lt;object, object&amp;gt; items&lt;/strong&gt; – This is just a state bag that you can optionally provide to give your validation attributes any other state information that you so desire.  The dictionary is available through the Items property on ValidationContext.  Note that the dictionary is immutable during validation, so your validation attributes cannot change the dictionary values such that they would be available to subsequent validation attributes, as validation order is indeterminate.&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;If you don’t have a service provider or state bag that you are using, you can just use null for both of those parameters.  We explicitly did not provide an overloaded constructor to omit these parameters, because we want to encourage the use of the parameters.  We expect that application developers will create static CreateValidationContext methods, simplifying the construction of the ValidationContext.  (In fact, that’s what RIA Services does).&lt;/p&gt;  &lt;p&gt;The great thing about all of this plumbing that we’ve done is that it actually makes your job for validating properties and objects very straight-forward.  Once you create a validation context and call into the Validator, here’s what happens:&lt;/p&gt;  &lt;p&gt; &lt;a href="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/ValidatingObjectsandPropertieswithValida_D2DA/image_7.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: block; float: none; margin-left: auto; border-top: 0px; margin-right: auto; border-right: 0px" title="image" border="0" alt="image" src="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/ValidatingObjectsandPropertieswithValida_D2DA/image_thumb_2.png" width="504" height="289" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p /&gt;  &lt;p&gt;You’ll notice that GetValidationResult is public but not virtual.  That’s because it does work that wraps around the IsValid method to ensure that there’s an error message produced from invalid validation results.  So when you’re creating a ValidationAttribute class, you will override the IsValid method, giving you access to the ValidationContext every time your attribute is validated.&lt;/p&gt;  &lt;p&gt;Now, there’s one major topic missing from this longwinded story.  All of this new stuff was created and released with Silverlight 3, but what about the desktop framework?  The good news is that all of this is provided for the desktop framework in 3 different ways:&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=75cbcbcd-b0e8-40ea-adae-85714e8984e3&amp;amp;displaylang=en" target="_blank"&gt;Visual Studio/.NET 4.0 Beta 1&lt;/a&gt;&lt;/li&gt;    &lt;li&gt;&lt;a href="http://aspnet.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=27026" target="_blank"&gt;ASP.NET Dynamic Data Preview 4&lt;/a&gt;      &lt;br /&gt;Found as version 99.0.0.0 of System.ComponentModel.DataAnnotations.dll in the Common Files folders&lt;/li&gt;    &lt;li&gt;&lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=76bb3a07-3846-4564-b0c3-27972bcaabce&amp;amp;displaylang=en" target="_blank"&gt;.NET RIA Services July 2009 Preview&lt;/a&gt;      &lt;br /&gt;Also found as version 99.0.0.0 of System.ComponentModel.DataAnnotations.dll&lt;/li&gt; &lt;/ul&gt;  &lt;p&gt;Between the two frameworks, there are still some casual differences, where we couldn’t make breaking changes to the desktop framework, but we wanted Silverlight to adopt the newer API more aggressively.  But regardless of which framework you’re working against, the flow will be the same.  This ensures that you can create your validation attribute classes as shared code that compiles against both the desktop framework and Silverlight.&lt;/p&gt;  &lt;p&gt;There was also one very noteworthy addition made only to the desktop version of DataAnnotations.  We introduced an interface for &lt;strong&gt;IValidatableObject&lt;/strong&gt;.  This interface has a single method for Validate that accepts the ValidationContext (with the ObjectInstance set) and returns an IEnumerable&amp;lt;ValidationResult&amp;gt;.  This method allows you to have very dynamic validation on your entities.  This approach could also be useful for entities have lots of cross-field validation that cannot easily be represented with attributes.&lt;/p&gt;  &lt;p&gt;When validating an object, the following process is applied in Validator.ValidateObject:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;Validate property-level attributes&lt;/li&gt;    &lt;li&gt;&lt;em&gt;If any validators are invalid, abort validation returning the failure(s)&lt;/em&gt;&lt;/li&gt;    &lt;li&gt;Validate the object-level attributes&lt;/li&gt;    &lt;li&gt;&lt;em&gt;If any validators are invalid, abort validation returning the failure(s)&lt;/em&gt;&lt;/li&gt;    &lt;li&gt;If on the desktop framework and the object implements IValidatableObject, then call its Validate method and return any failure(s)&lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;If you are developing a framework or application that needs to validate business objects and their properties, using the Validator class is strongly recommended, as it does a lot of the grunt work for you.  If you have any questions or problems regarding how you can best implement your validation, please drop me a line.&lt;/p&gt;  &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:9ec41f70-a8e2-4e2f-a0a0-9d04dcf50c4b" class="wlWriterEditableSmartContent"&gt;Technorati Tags: &lt;a href="http://technorati.com/tags/Silverlight" rel="tag"&gt;Silverlight&lt;/a&gt;,&lt;a href="http://technorati.com/tags/ASP.NET" rel="tag"&gt;ASP.NET&lt;/a&gt;,&lt;a href="http://technorati.com/tags/DataAnnotations" rel="tag"&gt;DataAnnotations&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Validation" rel="tag"&gt;Validation&lt;/a&gt;,&lt;a href="http://technorati.com/tags/Validator" rel="tag"&gt;Validator&lt;/a&gt;&lt;/div&gt;&lt;img src="http://jeffhandley.com/aggbug/200.aspx" width="1" height="1" /&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/i0xY7aiAo5aCjJ2kH9XXAuXNMec/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/i0xY7aiAo5aCjJ2kH9XXAuXNMec/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/i0xY7aiAo5aCjJ2kH9XXAuXNMec/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/i0xY7aiAo5aCjJ2kH9XXAuXNMec/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/JeffHandley/~4/kVDk-z-hF7Y" height="1" width="1"/&gt;</description>
            <dc:creator>Jeff Handley</dc:creator>
            <guid isPermaLink="false">http://jeffhandley.com/archive/2009/10/16/validator.aspx</guid>
            <pubDate>Sat, 17 Oct 2009 00:40:34 GMT</pubDate>
            <wfw:comment>http://jeffhandley.com/comments/200.aspx</wfw:comment>
            <comments>http://jeffhandley.com/archive/2009/10/16/validator.aspx#feedback</comments>
            <slash:comments>7</slash:comments>
            <wfw:commentRss>http://jeffhandley.com/comments/commentRss/200.aspx</wfw:commentRss>
        <feedburner:origLink>http://jeffhandley.com/archive/2009/10/16/validator.aspx</feedburner:origLink></item>
        <item>
            <title>Sorry Anthony, but Facebook says you&amp;rsquo;re a Redneck</title>
            <link>http://feeds.jeffhandley.com/~r/JeffHandley/~3/ag8oHw3MSCo/facebook-calls-anthony-a-redneck.aspx</link>
            <description>&lt;p&gt;I laughed my ass off at the Redneck email that Jeremy Miller &lt;a href="http://codebetter.com/blogs/jeremy.miller/archive/2009/09/08/bad-humor-way-off-topic-and-you-know-you-re-going-to-read-it.aspx" target="_blank"&gt;posted&lt;/a&gt; today.  Here is the content of the email (a series of redneck jokes).  But the best part is what happened when I went to post this to Facebook as a Note.  Look below for a screen shot.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;font size="1"&gt;Dearest Redneck Son,&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;I'm writing this slow because I know you can't read fast. We don't live where we did when you left home. Your dad read in the newspaper that most accidents happen within 20 miles of your home, so we moved. I won't be able to send you the address because the last Southwest Missouri family that lived here took the house numbers when they moved so they wouldn't have to change their address.&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;This place is really nice.. It even has a washing machine. I'm not sure about it. I put a load of clothes in and pulled the chain. We haven't seen them since.&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;The weather isn't bad here. It only rained twice last week; the first time for three days and the second time for four days..&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;About that coat you wanted me to send; your Uncle Billy Bob said it would be too heavy to send in the mail with the buttons on, so we cut them off and put them in the pockets.&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;Bubba locked his keys in the car yesterday. We were really worried because it took him two hours to get me and your father out.&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;Your sister had a baby this morning, but I haven't found out what it is yet so I don't know if you are an aunt or uncle.&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;Uncle Bobby Ray fell into a whiskey vat last week. Some men tried to pull him out but he fought them off and drowned. We had him cremated, he burned for three days.&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;Three of your friends went off a bridge in a pickup truck. Butch was driving. He rolled down the window and swam to safety. Your other two friends were in the back. They drowned because they couldn't get the tailgate down!&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;There isn't much more news at this time. Nothing much out of the normal has happened.&lt;/font&gt;&lt;/p&gt;    &lt;p&gt;&lt;font size="1"&gt;Your Favorite Aunt,       &lt;br /&gt;Mom&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&lt;a href="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/SorryAnthonybutFacebooksaysyoureaRedneck_C081/AnthonyRedneck_2.png" rel="lightbox"&gt;&lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="AnthonyRedneck" border="0" alt="AnthonyRedneck" src="http://jeffhandley.com/images/jeffhandley_com/WindowsLiveWriter/SorryAnthonybutFacebooksaysyoureaRedneck_C081/AnthonyRedneck_thumb.png" width="574" height="259" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;Apparently, Anthony is a redneck.  Sorry Anthony.&lt;/p&gt;&lt;img src="http://jeffhandley.com/aggbug/199.aspx" width="1" height="1" /&gt;
&lt;p&gt;&lt;a href="http://feedads.g.doubleclick.net/~a/t6ubPqFpgrusUpNRKHvLlREEIXk/0/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/t6ubPqFpgrusUpNRKHvLlREEIXk/0/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;br/&gt;
&lt;a href="http://feedads.g.doubleclick.net/~a/t6ubPqFpgrusUpNRKHvLlREEIXk/1/da"&gt;&lt;img src="http://feedads.g.doubleclick.net/~a/t6ubPqFpgrusUpNRKHvLlREEIXk/1/di" border="0" ismap="true"&gt;&lt;/img&gt;&lt;/a&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/JeffHandley/~4/ag8oHw3MSCo" height="1" width="1"/&gt;</description>
            <dc:creator>Jeff Handley</dc:creator>
            <guid isPermaLink="false">http://jeffhandley.com/archive/2009/09/08/facebook-calls-anthony-a-redneck.aspx</guid>
            <pubDate>Tue, 08 Sep 2009 20:41:23 GMT</pubDate>
            <wfw:comment>http://jeffhandley.com/comments/199.aspx</wfw:comment>
            <comments>http://jeffhandley.com/archive/2009/09/08/facebook-calls-anthony-a-redneck.aspx#feedback</comments>
            <slash:comments>1</slash:comments>
            <wfw:commentRss>http://jeffhandley.com/comments/commentRss/199.aspx</wfw:commentRss>
        <feedburner:origLink>http://jeffhandley.com/archive/2009/09/08/facebook-calls-anthony-a-redneck.aspx</feedburner:origLink></item>
    </channel>
</rss>
