Tips and Tricks for Dealing with Data in Silverlight
Scott Davis
Ignition Point Solutions
Scott talked about why you may want to use Silverlight for line-of-business applications. He asks: Is anyone aware of any good reporting solutions written for Silverlight?
When planning your Silverlight application, a design consideration is that everything is done asyncronously. Scott has developed a technique which keeps his data updated using threaded services.
WCF full duplex communications do not work in Silverlight.
In the demonstrated WCF communication, the Silverlight client sends a request to the server that says, send me updates since the last time I came back. This is done independent of the UI and thus the UI stays updated.

Today was the Minneapolis Silverlight User Group. It was my first user group presentation, so kind of glitchy! All the GUYS (ok there were Four women this time) were very kind and attentive. No one got up and walked out - so I'm a happy camper.
We talked about Search Engine Optimization and how to enable applications that use Silverlight to keep Search Engine Rankings as high as possible. Those topics are discussed freely on the web and I pulled a lot of the content from Nathan Buggia's Mix08 talk and Nikhil Kothari's blog. So thanks you guys.
But, the sample code is mine, at least. It's a minimal Ecommerce site demo which is based off of an actual ecommerce site that is in development. So I hope it's helpful. I may pull some of the relevant pieces out of the app and write up some details - why it's there, it's operation, it's purpose.
Some of the features in the sample application are: web.Sitemap to Silverlight menu, WrapPanel for category listing, a sample of how to use the same .xap file for multiple page areas (those are the islands, look in app.xaml), registering your url (for deep linking) and turning off the html when javascript is enabled.
To see the page as a search engine would just turn off your javascript and the html formatting will be there.
Those links are at the top. Have a great day!
The third Tuesday in June, 2008 was the second Silverlight User Group at Microsoft offices in Edina. Wow. Lots of Men there! ( OK, I counted three women, 123 men inside the presentation area. But that’s a topic for another blog post.)
Doug Nelson presented to us and very skillfully demonstrated how Silverlight controls can interact with the browser. Doug’s source code for the presentation will be here, I promise. I have to corral him first, so give me a few.
Here are some notes I took while there, I apologize if my observations are not quite on topic - I’m a presenter in training , I get to give the next talk and I have a lot to learn.
Doug used a special coloring scheme for his Visual Studio environment which was nicely visible from the back of the room where I sat. I noted the colors ( I don’t know why)
SCREEN COLORS: Black background, white regular writing, neon green comments. blue keywords, pink class names.
The presentation title was “Kiss Your Javascript Goodbye”. This is catchy, but to me it was more of a great tutorial on how the browser and Silverlight applications interact with each other. It was very ugly, but that’s ok because all the functionality we needed to know about was discussed.
Here’s just a simple list of how the topics flowed:
- How Silverlight applications are structured, what they look like in Visual Studio.
- What is App.xaml and what purpose does it serve.
- The use of Window.Eval in the application error for error reporting (security - this is just a demo.)
- Page.xaml. How is it constructed. How you hook into browser events.
- Presentation Slide.
- a. Page, Window, Document
- HtmlPage
- Browser Information
- Document
- Window
- Html Document
- DEEP LINKING!
- NavigateToBookmark!
- HtmlWindow
- Alert, Confirm
- Submit
- Demo again. The bookmark is updating the url in the browser address bar. This is what I need to support deep linking.
- HttpUtility
- a. HtmlPage.Window.NavigateToBookmrk
- HtmlElementEventArgs
- Stop Propagation - Prevent bubbling
- Key State, Key Code
- Mouse Button
- Screen Offset Window Coordinate Info
- Flying Div: the use of SetStyleAttributes to change pieces of the CSS in the html.
- Sets a DispatcherTimer - EventHandler. TimeSpan(0,0,0,0,10)
- Using{} cleans out the resources when no longer used
- Delete Service Proxy.Dll - Reinstall to replace it.
- Notes: WCF Service gave some issues.
- Silverlight Enabled WCF Service - Default Binding set for What Silverlight Supports.
If you installed the Beta2 bits early on, you should check your SDK size. If your SilverLight Tools Install size is 1.14 or under, you should uninstall it and bring it down again from the download site. You want to see something the size of 1.17. This is what you want, not 1.13 or 1.14.
- When building WCF services, inside Visual Studio you’ll be able to use Tabs to build your stubs to save typing.
- Talk about how MVC fits in
- X-Domain, show clientaccessplicy.xml
- The root is clientbin folder when loading from WebClient.
- Isolated Storage Demo
- Types for creating and using Virtual File System
- Exists on Client between Browser Sessions
- Clearing Cookies and Deleting Temporary Files doesn’t delete these files.
- Mechanism for examining contents Of isolated Storage. Yes. It allows us to iterate the file system. Allows disconnected storage
- Finding the Isolated Data store on the disk. Local Storage. Appsettings / microsoft, isolated storage.
- Promotes code reuse for data validation
