New Silverlight Juicyness

Only 3 months after the release of SL3 comes the beta for SL4.  And to be honest it just gets better and better. Following on from David Poll’s excellent PDC session (Building Line Of Business Applications with Silverlight 4) the following bits really got my juices flowing!;

“Learn about enhancements to data binding and data validation as well as new support for rich text & printing in the platform that allow you to build compelling LOB user experiences. In addition, you will see how you can incorporate webcam & microphone support into your applications using Silverlight 4.”

This was a good “hand-on” session from David Poll, Silvelight Program Manager. As always, there was a lot of cut-and-paste code, but most concepts where demonstrated well enough to get a grasp of what was required, and the MVVM pattern was talked about on many occasions.

Interactive Design Surface in VS2010

The design surface in VS2010 is interactive for XAML controls. This will allow the proofing and creation of layouts from within VS (rather than being forced to switch to Blend). Most properties (including element Binding) can be set from within VS visual design surface. This didn’t crash during the demo – hopefully this will be more stable than the early versions of Blend.

Data-binding Enhancements

Binding now supports string formatters – very useful feature for eg enabling the formatting of strings inline in the XAML using standard .NET format codes (e.g. {0:d}) rather than having to create separate format classes.


Binding to dictionaries is also added, again simplifying the development process to display controls for simple enumeration types.

Binding support has been extended to include any DependencyObject, not just objects which derive from UIElement.

New values have been introduced to binding to support a “FallbackValue” and “TargetNullValue” which will handle the displayed values in situations where a property setter exception occurs and the value is set to Null respectively.

 

Data Related Controls

Datagrid now supports “star” based columns. This allows columns to fit the available screen space – much more akin to what we are used to with HTML tables.

Datagrid supports copy and paste – good potential for copying information to Excel. I have also seen (in the Day 2 keynote) that there is support for calls directly into the Office API. Export to excel will either be possible in SL4 or available in the very near future.

Combobox will support both SelectedValue and SelectedValuePath – which have been missing to this point. This will simplify the XAML used to display simple comboboxes, which was overly onerous for such a simple control.

The CollectionViewSource type is enhanced to provide data grouping (this would be ideal for large datagrids of information (case enquiry / allocation).

Commanding has been introduced as a first-class property on appropriate controls (ButtonBase and Hyperlink). We will not need to attach the commanding properties from the Prism assemblies.

Input Validation

Validation is now supported from a service, and responses sent back to the UI via INotifyDataErrorInfo. This is a massive improvement to the validation API and will be hugely beneficial for our product. We no longer have to rely on exceptions in property setters to trigger UI validation controls. Errors raised in the service can be bubbled into the UI easily and displayed using the existing validation controls. Dependency validation can also be achieved in this way.

Printing Support

Printing support is added to native applications. This will allows relatively simple setup of printing direct from the UI.

Any UI element can be printed, and it does not need to exist in the currently displayed Visual Tree.

Paging is supported and appeared straight forward to control.

Other Features

Other interesting functionality in the SL4 beta but not included within this presentation, includes:

  • Implicit Styling – no more explicit style references J
  • Right Click and Mouse Wheel support
  • Native Drag and Drop
  • Clipboard API
  • New controls

    • Viewbox control added (for auto scaling content)
    • Rich text box

  • Hosting of HTML content
  • More advanced out of browser features

    • Notification (“Toast”) API (ideal for an Activity Manager style application!)

  • Trusted mode is enabled
  • Webcam access (e.g. barcode scanning from hand held devices)
  • Official Google Chrome Support

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

A WordPress.com Website.

Up ↑

%d bloggers like this: