Tuesday, September 29, 2009

Playing with Silverlight

Most of the time I can't do anything that is too fancy or heavy on the client side. The clients who access the websites have really slow computers so we need to all the processing on the server that we can. Finally I have an application that might be for internal use so I decided to play with Silverlight to see what it could really do for us. This is a work in progress as I create my application...

Data Access

In our existing environment most of our data access layer resides in web services. AND most of these web services return at least one DataSet. Problem #1 arose.

  1. Silverlight does not support web services that return DataSet. No problem at least for the moment I will code a shim to go between silverlight and the actual web service. I put a web service page into the web application that silverlight expects to be deployed from. Not real fond of this, but I will ponder to see if something better comes along

Creating the UI

Interesting model for the layout. At first it does not seem too bad. OK, dealt with Grids in the form of tables all my HTML career. Sometime down the line I realized that I had forgotten a field that needed to be inserted on the form. No problem, I will go back and put it in. Clumsy issue #1.

  1. When you go to insert a row, it is very easy to add the actual row to the grid definition. Just insert where you want it to be. But when I need to assign what fields are in that row, each field assignment has a row designator in it. For instance, . This means that I have to reassign all my other previously inserted elements to their new row. Again, I will look to see if someone has a better way and report back.
  2. In looking into issue #1 a little bit more, it appears (although not from any official blog) that we want to use a grid as the outer most element and then place the actual textboxes and such via stacked panels. This way we don't have to assign specific placing.



Images

Not thrilled that I can't get images to display. If you google how to do it the information seems to be very inconsistent. What types of images are supported, exactly how to reference an image in the "image" tag (relative URL, exact URL). It should not be this hard. I still can't get it to display. Interestingly I do see that it "reserves" space for it to display with some references, but it won't show in the application. Here is a really nice article for images. http://nerddawg.blogspot.com/2008/03/silverlight-2-demystifying-uri.html

Switching Pages

http://blogs.silverlight.net/blogs/jesseliberty/archive/2009/01/03/56420.aspx