Hi everyone! Wow – yesterday was a big day, with a lot of amazing announcements at PDC ‘09 – especially the announcement that the Silverlight 4 Beta was publicly available. I was very excited to be given an opportunity to give a talk at PDC this year, and it was a real treat. My talk – Building Line of Business Applications with Silverlight 4 (PDC09-CL19) – focused on the new features in Silverlight 4 that are particularly useful in business applications, especially those that are data-centric. (Please ignore the abstract given on that page for the talk – it wasn’t updated properly from a change we made to it early on!
)

The talk covered a wide array of features, but I broke things down into three conceptual categories around data:
- Data Interactivity (i.e. how do I drill down into my data to find what I’m looking for?)
- Data Entry (i.e. how do users add/edit data and what kind of feedback do you give them to minimize mistakes?)
- Data Presentation (i.e. how do I communicate data to a user, but also how do I communicate intent for data entry, such as “choose from this list of options” to a user?)
The Silverlight 4 features I covered generally fit into these categories:
- Data Interactivity
- Data sources window (VS2010)
- Selector support (i.e. SelectedValue/SelectedValuePath on ComboBox and related controls)
- Binding TargetNullValue
- Binding FallbackValue
- ICommand support on ButtonBase (i.e. Command and CommandParameter) and Hyperlink
- Data Entry
- Asynchronous validation
- Cross-field validation
- Data Presentation
- Binding StringFormat
- CollectionViewSource Grouping
- Printing and pagination
- DataGrid * Columns (*-based column sizing, as with the Grid control)
And all of this is just the short list of features I could cover in my 50-minute talk! There are certainly other business application-friendly features out there, but more importantly, the feature list for Silverlight 4 is just huge! The talk also used Visual Studio 2010 Beta 2, which provides an awesome development environment for Silverlight.
I won’t go into too much detail here, but I wanted to share out my powerpoint deck and sample/demo code so that those who were in attendance at the talk can look back for reference, and those that weren’t can see what they were missing. I don’t know for sure yet, but I think there will be a webcast of the talk online at some point, and I’ll be happy to link to that once it’s available.
So, without further ado, here are the links:
- PDC ‘09 PPT deck
- Issue tracker demo application (source)
Before I leave you, I’d like to just give a brief overview of the sample application. The application itself is an issue tracker – allowing you to file bugs/issues, assign them to people, resolve the bugs, etc. It has 4 functional pages:
- New Issue
- Allows users to file a new bug/issue
- All Issues
- Allows users to see a list of all bugs in the database
- My Issues
- Allows users to see un-fixed issues that are assigned to them
- Reports
- Allows users to see a report of all of the issues in the database and print them if he/she so desires
The application was built using LINQ-to-SQL and WCF RIA Services (formerly .NET RIA Services), which made getting off the ground with real data running on a real database extremely quick and easy. If you’re still around at PDC, there are a few talks later today on RIA Services by Brad Abrams and Dinesh Kulkarni you should check out.
A few things to try in the application (some of which I didn’t go over in the talk):
- Right-click and change the theme of the application
- Many thanks to my co-worker Jesse Bishop for his ContextMenu control
- This feature uses implicit styles (new in SL4) to change the entire look of the application
- Set the priority on a bug to be lower than (i.e. a larger number than) severity and see the validation UI (cross-field validation)
- Set the title of an issue to be something wholly contained in another issue’s title to see the validation UI (asynchronously querying the server for “similar” bugs)
- Drag and drop a file from your disk into the list of files on a bug (one of the tabs at the bottom)
- Print out a set of reports on the reports page (click the “Print” button)
- Set a value in the “Tags” field and then change it in the DataGrid under the Attributes tab on a bug, noticing that they stay in sync (thanks to bindings to string indexers)
- Use the mouse-wheel almost anywhere and note that it works without any code to make it happen!
- Explore the code! I know there are some bugs in the application and in our beta product, but the hope is to give you an idea of how you can use these features in a business application. I’m sure there will be lots of content out there about all of these features – but this should help introduce you to them!
Well, thanks again everyone who was able to join me for my talk, and to all those who’ve been following me on twitter through this exciting announcement. Let me know if you have questions or if there’s anything you’d like me to expand on, and I’ll be more than happy to chime in!
Links to materials repeated here for convenience:
- PDC ‘09 PPT deck
- Issue tracker demo application (source)
Update (11/19/2009): Video of the talk is now available here: http://microsoftpdc.com/Sessions/CL19
Update (11/20/2009): Video of the talk is embedded below:
P.S. Sorry for the lack of posts recently – I’ve got a bunch of new topics lined up, but it was a pity not to be able to write about Silverlight 4 before it was announced. Expect another series on Navigation coming soon!
Update (12/21/2009): I think I’ve figured out the issue people were having with the downloaded project.
If you’re receiving an error like this when you try to build my project:
This is happening because Windows protects you from downloaded files by default (VS2010 will warn you when you open the project that they come from “untrusted sources.” Fixing this is pretty straightforward.
- Download the zip.
- Right-click the downloaded zip file and choose “Properties”
- At the bottom of the “General” tab, there is a “Security” section, saying “This file came from another computer and might be blocked to help protect this computer.” Click the “Unblock” button.
- Unzip and open the solution.
- Build and run!
Sorry it took me so long to figure this one out! It had me stumped for a while.











#1 by Amit Kashman on November 20, 2009 - 8:15 am
It was great meeting you at the PDC. The talk was excellent.
#2 by Mark McPherson on November 23, 2009 - 6:37 am
I get the following error trying to compile the source code for the IssureTracker:
Error 2 The “ValidateXaml” task failed unexpectedly.
System.IO.FileLoadException: Could not load file or assembly ‘file:///C:\Users\Mark.McPherson\Documents\Visual Studio 2010\Projects\IssueTracker_Final\IssueTracker\Lib\ActivityControl.dll’ or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0×80131515)
File name: ‘file:///C:\Users\Mark.McPherson\Documents\Visual Studio 2010\Projects\IssueTracker_Final\IssueTracker\Lib\ActivityControl.dll’ —> System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.
According to 155569 I need to setup the loadFromRemoteSources element in the application configuration file. I am having trouble figuring out just where to place this element.
Any help would be greatly apprecited.
Thanks
#3 by david.poll on December 21, 2009 - 4:31 pm
I think I finally figured it out. See the bottom of my post above.
#4 by Eugen on November 23, 2009 - 11:27 am
Great post David and nice presentation, I’d say even better than Brad Adams had, your was much more comprehensive. And I’m not even talking about John Papa’s presentation, he had not enough time to discuss about Prism and SL4.
However none of you covered such topic as deleting items using RIA. I know there was a bug in previous version when you delete from local collection but the item wasn’t deleted from bound DataGrid. Can you update your sample with such a functionality, when an empowered user can delete an Issue and all its related information.
Also I noticed when you were updating an issue as solved the grid didn’t refresh automatically, can you check on this as well?
Thx and keep doing a great job.
#5 by david.poll on November 29, 2009 - 8:25 am
Hi folks! I’ve been on vacation for the last week (immediately following PDC). I’ll try to address your questions/comments in the next few days. Thanks for all the feedback!
#6 by Ned Hamilton on December 20, 2009 - 5:55 am
Great presentation, but I too can’t get past the error in sample code that requires changing CAS policy or loadFromRemoteSources switch. I’ve read the referenced MS page and added code to every config file in the solution but still get the error.
#7 by david.poll on December 21, 2009 - 4:12 pm
I think I finally figured it out. See the bottom of my post above.
#8 by Topology on January 19, 2010 - 11:19 am
Hi David, Thanx for your example. But I have some problems
1- My database is Oracle how can I connect with it.
2- I have 150 tables at my hr can you give me a method for dynamic binding Ex: one or two classes for many forms (it is better for maintenance).
3- I need a method for modal dialog that return one or more value to the parent form.
4- What about reports?
That is my problems to transfer my business application.
Thanx again
#9 by Rob Pemberton on January 22, 2010 - 7:13 am
Hi David –
Nice presentation. I’m trying to figure out how to wire up parent child relationships on a form using the ria stuff. On your bug system PDC demo, you use a collection insted of a child table. Can you point me toward some info on hoe to do this.
More detailed examples on how to get the Binding UI to work would probably do it.
Thanks Rob