A Better Way to do Silverlight Databinding
The guys at Intersoft Solutions are ahead of the curve again with their Intersoft Data Source control for Silverlight. The CTP includes the AstoriaDataSource that connects cleanly to an ADO.NET Data service.
Rather than jumping through hoop after hoop to do asychronous calls and returned results, the control lets you do CRUD operations in only a few lines of code:
AstoriaDataSource1.Delete("Customers", CustomerGrid.SelectedItem);
I haven't figured out how to do cascading deletes yet with this control, such as deleting a customer from the Northwind database. (I cover the old manual way in Episode 5: 'D' is for Delete of my Silverlight 2 Data Form series.)
With the Intersoft control, you use declarative binding by configuring the control in the markup, much the way you do with ASP.NET data controls:
<ISNet_Silverlight_DataSource:AstoriaDataSource
x:Name="AstoriaDataSource1" Grid.Row="2"
ServiceHost="http://localhost:53948" ServiceTarget="NorthwindDataService.svc"
ReferenceNamespace="NorthwindDataReference" ServiceTypeName="NorthwindEntities"
Selected="AstoriaDataSource1_Selected"
Inserted="AstoriaDataSource1_Inserted"
Updated="AstoriaDataSource1_Updated"
Deleted="AstoriaDataSource1_Deleted">
<ISNet_Silverlight_DataSource:AstoriaDataSource.Services>
<ISNet_Silverlight_DataSource:AstoriaDataService
DataObjectTypeName="Customers" ServiceName="Customers"/>
<ISNet_Silverlight_DataSource:AstoriaDataService
DataObjectTypeName="Products" ServiceName="Products"/>
<ISNet_Silverlight_DataSource:AstoriaDataService
DataObjectTypeName="Employees" ServiceName="Employees"/>
</ISNet_Silverlight_DataSource:AstoriaDataSource.Services>
</ISNet_Silverlight_DataSource:AstoriaDataSource>