Breaking Changes for Silverlight 2 Beta 2 (corrections and additions)
With Silverlight 2 Beta 2 coming out there were a number of changes that will break applications written for older builds of Silverlight. We published a document that listed these changes and how to fix them (Breaking Changes Between Beta 1 and Beta 2) but this document is now a bit out of date due to corrections/additions made after the document was locked down.
Attached is a more complete up-to-date version of this document. To get this attachment, scroll down to the bottom of this post. Note that I've attached a Word 2007 version and a Word 97-2003 version. In addition, below is a list of changes/additions that might differ between this updated document and those that shiped with the SDK. You can use the attached new version of the document to see the correct changes.
1. Controls no longer allow events to bubble up (in other words, controls eat events). Jesse Liberty's blog Who Ate my MouseDown Event? for more information. Also, the section in the breaking changes doc titled RoutedEventArgs.Handled=true Events No Longer Bubble but it is perhaps not very discoverable under that title.
2. A whole bunch DataGrid breaking changes. The changes are to numerous to list in this post. Download the attached Word file to get them. The online version of the breaking changes doc doesn't have this while the loose Word file that ships with the offline SDK does so you may or may not already have this info depending on your source...
3. Wrong URL in the sample crossdomain.xml file. It should look like this:
crossdomain.xml
<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM
"https://www.macromedia.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<allow-http-request-headers-from domain="* " headers="*" />
</cross-domain-policy>
4. Calendar/DatePicker Changes section is wrong. It should look like this:
Who Is Affected: Those using DatePicker or Calendar.
Summary
The following changes were made to the Calendar and DatePicker.
Calendar
· [Remove] Style DayStyle
· [Remove] Style MonthStyle
· [Removed] EventHandler<CalendarDateChangedEventArgs> DateSelected
· [Added] EventHandler<SelectionChangedEventArgs> SelectedDatesChanged
DatePicker
· [Remove] ToolTip ToolTip
· [Remove] EventHandler<DatePickerTextParseErrorEventArgs> TextParseError
· [Added] EventHandler<DatePickerDateValidationErrorEventArgs> DateValidationError
· [Removed] EventHandler<DatePickDateChangedEventArgs> DateSelected
· [Added] EventHandler<SelectionChangedEventArgs> SelectedDateChanged
Calendar and DatePicker
· [Remove] bool IsEnabled {get; set;}
· [Remove] DateTime? SelectableDateStart
· [Remove] DateTime? SelectableDateEnd
· [Remove] bool AreDatesInPastSelectable
5. System.ServiceModel.ClientBase Changes section is wrong. It should look like this:
Who Is Affected: Those using System.ServiceModel.ClientBase.Open() and Close() or System.ServiceModel.ClientBase.Dispose() .
Summary
System.ServiceModel.ClientBase.Open() and Close() and System.ServiceModel.ClientBase.Dispose() were removed.
Fix Required
Workarounds for code using Open() :
· [preferred] Don’t call it: on the first web service call we will automatically do Open asynchronously, so you don’t need to call it explicitly.
· [preferred] Change code to use OpenAsync and the OpenCompleted event
· [less preferred] Cast the proxy to ICommunicationObject and use BeginOpen/EndOpen
· [not recommended] Cast the proxy to ICommunicationObject and use Open()
Workarounds for code using Close() :
· [preferred] change code to use CloseAsync. The CloseCompleted event is not usually necessary as you don’t usually need notification when Close completes
· [less preferred] don’t call Close at all. Resources used by the proxy will eventually be reclaimed
· [less preferred] Cast the proxy to ICommunicationObject and use BeginClose/EndClose
· [not recommended] Cast the proxy to ICommunicationObject and use Close()
Workarounds for code using Dispose() or the ‘using’ C# pattern:
· [preferred] change code to call CloseAsync
· [less preferred] see other alternatives for Close() above
6. The following was added to the Miscellaneous API changes section:
· XmlAnyElementAttributes class no longer implements Collection<T>, ICollection<T>, IEnumerable<T>, or IList<T>
· XmlArrayItemAttributes class no longer implements Collection<T>, ICollection<T>, IEnumerable<T>, or IList<T>
· XmlElementAttributes class no longer implements Collection<T>, ICollection<T>, IEnumerable<T>, or IList<T>
· System.Runtime.Serialization.ExtensionDataObject class was removed.
· XmlAnyAttributeAttribute class was removed.
· XmlAttributes.XmlAnyAttribute member was removed.
· CodeIdentifier class was removed.
· CodeIdentifiers class was removed.
· Removed: delegate types XmlSerializationCollectionFixupCallback, XmlSerializationFixupCallback, and XmlSerializationReadCallback
· The following protected members of XmlSerializationReader were removed:
o [remove] protected void AddFixup(Fixup fixup);
o [remove] protected void AddFixup(CollectionFixup fixup);
o [remove] protected void AddReadCallback(String name, String ns, Type type, XmlSerializationReadCallback read);
o [remove] protected void AddTarget(String id, Object o);
o [remove] protected void FixupArrayRefs(Object fixup);
o [remove] protected Int32 GetArrayLength(String name, String ns);
o [remove] protected Object GetTarget(String id);
o [remove] protected Boolean ReadReference(out String fixupReference);
o [remove] protected Object ReadReferencedElement(String name, String ns);
o [remove] protected Object ReadReferencedElement();
o [remove] protected void ReadReferencedElements();
o [remove] protected Object ReadReferencingElement(String name, String ns, Boolean elementCanBeType, out String fixupReference);
o [remove] protected Object ReadReferencingElement(String name, String ns, out String fixupReference);
o [remove] protected Object ReadReferencingElement(out String fixupReference);
o [remove] protected void Referenced(Object o);
o [remove] protected void UnreferencedObject(String id, Object o);
o [remove] protected class CollectionFixup; // removed
o [remove] protected internal class Fixup; // removed
· The following protected members of XmlSerializationWriter were removed:
o [remove] protected void AddWriteCallback(Type type, String typeName, String typeNs, XmlSerializationWriteCallback callback);
o [remove] protected void WriteId(Object o);
o [remove] protected void WritePotentiallyReferencingElement(String n, String ns, Object o, Type ambientType, Boolean suppressReference);
o [remove] protected void WritePotentiallyReferencingElement(String n, String ns, Object o, Type ambientType);
o [remove] protected void WritePotentiallyReferencingElement(String n, String ns, Object o, Type ambientType, Boolean suppressReference, Boolean isNullable);
o [remove] protected void WritePotentiallyReferencingElement(String n, String ns, Object o);
o [remove] protected void WriteReferencedElements();
o [remove] protected void WriteReferencingElement(String n, String ns, Object o);
o [remove] protected void WriteReferencingElement(String n, String ns, Object o, Boolean isNullable);
o [remove] protected void WriteRpcResult(String name, String ns);
7. The Scrollviewer template elements changed.
To fix: Go to the ScrollViewer template documentation or re-generate a new default template in Blend 2.5. This will get you the correct names of the template elements.
8. Can't get UI elements by name if hosted in ContentControl (ScrollViewers etc).
9. You can find a workaround for the removal of the WatermarkedTextBox control here: WatermarkedTextBox for Silverlight 2 Beta 2.
UpdatedBreakingChangesWord97to2003.doc
Comments
Anonymous
June 06, 2008
PingBack from http://blogs.msdn.com/silverlight_sdk/archive/2008/06/04/breaking-changes-for-silverlight-2-beta-2-corrections-and-additions.aspxAnonymous
June 07, 2008
Yahoo publica una Address Book API : Ya era hora de que mas tomen la iniciativa de Microsoft (con suAnonymous
June 07, 2008
The DataGrid Beta 2 breaking change list came in a bit too late to make the official documentation .Anonymous
June 07, 2008
Silverlight 2.0 Beta 2 Released Ok, as usual let’s start with the download: For the Browser here’s theAnonymous
June 08, 2008
Silverilght 2.0 Beta 2 releasedAnonymous
June 10, 2008
You will need to do get three updates.  The plugin itself, Expression Studio 2.5 June release, andAnonymous
June 11, 2008
Migrating Comparis Silverlight Challenge App to Silverlight 2.0 Beta 2Anonymous
June 12, 2008
Silverlight 2 Beta 2 is out! I can't believe the incredible number of changes they made between versions.Anonymous
June 13, 2008
"Can't get UI elements by name if hosted in ContentControl (ScrollViewers etc)." Ummmm... why not?Anonymous
July 03, 2008
3I did a session for the SharePoint forum held July 1, 2008 and for those who are interested to try outAnonymous
December 16, 2008
3I did a session for the SharePoint forum held July 1, 2008 and for those who are interested to try outAnonymous
January 05, 2009
3I did a session for the SharePoint forum held July 1, 2008 and for those who are interested to try out