Tag Archives: data

Using RIA Services Programmatically

Many demos of WCF RIA Services show off using the DomainDataSource Class to in a declarative manner to quickly throw together a data-enabled application. And in VS2010, there is added support for using the Data Sources Window to Drag/Drop data entities onto the designer — this action also adds a DomainDataSource instance into your XAML. For many applications, using a DomainDataSource in XAML is fine and enables RAD development. But some pundits (Hi Shawn!) argue that having direct interaction with the Data Layer from the UI Layer is bad for proper Model/View separation, testability, and general karma. Luckily, there are several ways to use WCF RIA Services programmatically - without relying on the DomainDataSource controls in XAML. Let’s take a look at some of these programmatic methods: Download the Demo Code   * requires SL4/VS2010 Beta 2 , WCF RIA Services Beta Using the DomainContext The DomainContext class allows the Silverlight client to access the Domain Service Class you created on the server side. A new DomainContext class is automatically generated on the client side for you when you create a new Domain Service. In the demo , our DomainContext class is named BeerContext

Excerpt from:
Using RIA Services Programmatically

Field Level Access with RIA Services

There are lots of reason you may need to customize the access to given fields within an entity.

Bindings, the glue that connects the view to the viewmodel part 1

If you have read anything I have written in the past, you are probably familiar with the fact that I am a huge fan of MVVM. There will have to be a lot of convincing before anyone gets me to switch pattern when working with Silverlight. There are several things one must learn and understand before one can use MVVM well. There is the obvious part of learning the actual pattern and how it works. Learning how to build a good viewmodel, which is dependent on the data model and time and other cir

Originally posted here:
Bindings, the glue that connects the view to the viewmodel part 1

Control-Oriented Vs. Data-Oriented Programming in Silverlight

If you build ASP.NET applications then you’re used to working with controls a lot.  Nearly everything you do requires accessing control IDs.  If you need to retrieve data entered by an end user you need to reference the controls that contain the data.  That’s just the way we do it in ASP.NET and if you’ve been writing ASP.NET applications very long its how you’re conditioned to think. Silverlight changes the game quite a bit due to the way you can bind data to controls.  With Silverlight appl

Here is the original post: 
Control-Oriented Vs. Data-Oriented Programming in Silverlight

Survey: Ajax usage among .NET developers in 2009

A couple of years ago Simone Chiaretta did a survey of .NET Developers usage of Ajax ..

Twilight 1.1: Using a Yahoo Pipes Proxy

I just pushed a minor update to Twilight that you can now download on the codeplex site (version 1.1). I really wanted to allow the xap file to be hosted on other servers since many bloggers don’t have the ability to host their own xap files. After reading Scott Barnes’ post about replacing his header with Silverlight I decided I would take a similar approach. Instead of using a callback or trying to get the data directly, Scott followed Jonas’ post on using Yahoo Pipes to proxy data to Silverlight . I took the same approach and during the process refactored some of the code by moving all the data logic out to a separate set of classes. Now when the xap loads it checks to see if it can access the Html Bridge and makes sure it is on the same domain. If it is then it will just use the standard Twitter callback method, otherwise it uses the yahoo pipes proxy I created. The pipe I created simple takes a username and the number of tweets to return and grabs the twitter xml. I then use an HttpRequest in my code to get this xml from yahoo formatted as json which matches up to the json that I was getting from Twitter with the exception that there are a few wrapper objects I have to go through to get the tweets. I also moved all the update logic out of the page class and into the base data provider class since that made a lot more sense. I think the new code makes it much cleaner and the end result is you can now just stick the object tag up on your blog and leave the xap hosted on my server if you’d like. Here is the html you can use for the hosted version: