Paging with the Silverlight RIA services DomainDataSource

Using the declarative DomainDataSource that is part of the upcoming Silverlight 3 RIA services makes it quite easy to work with data. All you need to do is add a DomainDataSource control to the the XAML, point it to the generated DomainContext class (in this case NorthwindContext) and tell it which method to use to load the data from the web service(in this case LoadCustomers). Next add a DataGrid to display the data and you are good to go. <UserControl xmlns:dataControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data.DataForm" x:Class="LOBUsingRIAServices.CustomerListPage" xmlns:data="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Data" xmlns:riaControls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Ria.Controls" xmlns:web="clr-namespace:LOBUsingRIAServices.Web" xmlns="" xmlns:x=""> <Grid x:Name="LayoutRoot" Background="White"> <riaControls:DomainDataSource x:Name="CustomerDataSource" LoadMethodName="LoadCustomers"> <riaControls:DomainDataSource.DomainContext> <web:NorthwindContext /> </riaControls:DomainDataSource.DomainContext> </riaControls:DomainDataSource> <data:DataGrid ItemsSource="{Binding … Continue reading Paging with the Silverlight RIA services DomainDataSource

Adding a custom machineKey section to the web.config

Normal 0 21 false false false MicrosoftInternetExplorer4 <!– /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:””; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:”Times New Roman”; mso-fareast-font-family:”Times New Roman”;} a:link, span.MsoHyperlink {color:blue; text-decoration:underline; text-underline:single;} a:visited, span.MsoHyperlinkFollowed {color:purple; text-decoration:underline; text-underline:single;} @page Section1 {size:612.0pt 792.0pt; margin:70.85pt 70.85pt 70.85pt 70.85pt; mso-header-margin:35.4pt; mso-footer-margin:35.4pt; mso-paper-source:0;} div.Section1 {page:Section1;} –> /* Style Definitions */ table.MsoNormalTable {mso-style-name:”Table Normal”; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-parent:””; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin:0cm; mso-para-margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:10.0pt; font-family:”Times New Roman”; mso-ansi-language:#0400; mso-fareast-language:#0400; mso-bidi-language:#0400;} Normally you should never have to set the <machineKey> in the in the web.config. This is only needed when am ASP.NET site runs on a … Continue reading Adding a custom machineKey section to the web.config

Using Model – View – ViewModel with Silverlight

The View – Model – ViewModel design pattern, also known as MVVM, is getting more popular these days. I have found it extremely easy to use when developing very different applications and have used the design pattern recently in both ASP.NET, WPF and Silverlight applications. However easy as it might be is seems to confuse people as I have seen some terrible examples where people make a complete mess of things. Josh Smith did an excellent screen cast for Pixel8 on using MVVM with WPF, you can find it here.   Even thought the UI technology used doesn’t change the … Continue reading Using Model – View – ViewModel with Silverlight

.NET RIA Services and data communication

I was working on an article about the .NET RIA Services and decided to fire up Fiddler to take a close look at the data actually passed around. I was sort of expecting to see a WCF REST based approach with XML messages. Turns out I was wrong, though I expect this option will be added in the future. It turns out the .NET RIA Services use JSON as their serialization format. This is actually kind of nice as the DataContractJsonSerializer is part of the System.ServiceModel.Web assembly and therefore usable by all .NET clients. The good part is that a … Continue reading .NET RIA Services and data communication

Surface at the last Software Developer Event

As was to be expected the Surface machine at the last SDE was a big success and with lots of people wanting to have a go at it. Nice to see the interest. And I am grateful Martin Tirion from the Dutch Microsoft office let us borrow the machine for a day. At the end of June we will have the next big event [:)] Cu there.   BTW you can find more pictures from the event here.   [f1] [f2] And now on Twitter at