Silverlight 2 missing features
I've had this rant rotting in my notes for too long, time to post. The topic is features that were in WPF but are missing from Silverlight 2. Now that Silverlight 3 is in beta, this information may not be as timely or useful, but perhaps still useful to someone. The below excludes items spelled out in the official documentation on the topic. Note that although the final feature set of Silverlight 3 hasn't been set, many of these items appear missing there too.
- DrawingVisual Brushes – this doesn’t seem like a big deal, but without this, doing something as simple as say, tiling an image, becomes very difficult.
- Relative source binding – binding from one property of one entity to a property of another has to be constructed in code. Hard to believe that this didn’t make the list, but fortunately is in Silverlight 3.
- TemplateBinding to anything other than a root dependency property.
- The DataContext is not inferred from parent to child.
- SharedSizeGroup – this subtle, but oh so useful property of the GridColumn and GridRow Grid classes.
- Popup.PlacementTarget – Popups have to be absolutely positioned, which is unfortunate given that there are no dialogs or forms, so Popups can be a pretty important element.
- LayoutTransform – RenderTransforms are useful, but certainly don’t provide for what LayoutTransforms did.
- Left mouse click – What were they thinking?! They could have had an instant advantage over flash.
- OverrideMetadata – This important aspect of dependency properties can be a pain to live without.
- AddOwner – Another pretty useful dependency property trick.
- Read-only dependency properties – Another property thing that’s been a pain to work-around.
- Property change notification – This one is a real bear. There seems to be no programmatic way to know that a DependencyObject’s property has changed (ouch).
- No custom routed events – This one has been a real pain for me, but might not come up for most apps.
- GetFlattenedPathGeometry and GetPointAtFractionLength – path functions that are possible to work around, but a pain.
- Baseline in FontFamily
- OnRender – They seem to have some good arguments for this one, however.
- Keyboard Key to character code translation - that is, knowing that say Key.D1 translates to character '1'. Once has to also check the Shift state of the keyboard, and basic keys like + are only in the PlatrofmKeyCode, which requires a series of hard-coded assumptions to deal with.
I also had a couple Silverlight 2 gotchas noted:
- If you rename a Silverlight project, watch out that the "Startup Object" property of the project is corrected too, or the app will fail to start with no explanation.
- If you have a web application to go with your Silverlight project, don’t add the Silverlight application as a reference, associated it under the Silverlight tab in the web apps configuration dialog.
- If you will be creating more than one instance of a UserControl, don’t name it or you will receive and error when instancing the 2nd. This is a royal pain because if it is unnamed it cannot be referenced by the animation objects (or by-name binding in Silverlight 3). Basically you have to programmatically create the binding for anything that binds to the root UserControl.
Links to other similar posts: