(X) Hide this
    • Login
    • Join
      • Generate New Image
        By clicking 'Register' you accept the terms of use .
        Login with Facebook

What's new in Silverlight 2 RC0

(80 votes)
Denislav Savkov
>
Denislav Savkov
Joined Feb 11, 2008
Articles:   14
Comments:   6
More Articles
0 comments   /   posted on Sep 30, 2008
Categories:   General

Download Silverlight Tools for Visual Studio 2008 SP1 ( including the Silverlight 2 RC0 runtime ).

And the latest Expression Blend.

First we should point out this release is intended to be used only from developers to begin migrating their existing code to RTW. The applications build with the tools will run only on the Silverlight 2 RC0 Developer Runtime an not on the Beta 2 runtimeAlso the full version of Silverlight 2.0 will have the same features as RC0 i.e. more functionality won't be added from this release until the final.

New features

  • New controls
    • PasswordBox, ComboBox, MessageBox and ProgressBar.
  • Improvement in controls
    • Improved accessibility and UI automation
    • Updated look and feel
    • IsEnabled and IsEnabledChanged added
    • Exposed virtual methods for On* events on Control e.g. OnGotFocus, OnKeyDown, OnKeyUp, OnMouseEnter etc.
  • CompositionTarget.Rendering event allows per-frame callbacks for physics and custom animation.
  • Networking
    • Support for HTTP requests on background threads.
    • Support for upload added to WebClient.
    • Support for percent escaped internationalized URIs for remote endpoints.
  • Input
    • LostMouseCapture adeed to UIElement
    • Support for non-ASCI characters
  • Resources
    • Much more built in resources like Fonts, Colors etc.
  • XAML
    • Default value support for custom dependency properties via PropertyMetadata.
    • Support for object element syntax for StaticResource.
  • Support for pop-up windows - HtmlPage.PopupWindow (except for Safari)

Breaking changes

Here is an almost complete list of the changes that break your code in this latest developer version. You can download the complete document from Microsoft and look for further information in these release notes. Some of the changes aim to make Silverlight more consistent with WPF.

  • First after you load and upgrade your project in Visual Studio you will also have to update these strings in the html documents that use Silverlight
    • The MIME type from "application/x-silverlight-2-b1" or "application/x-silverlight-2-b2" to "application/x-silverlight-2".
    • The Installation URL from "http://go.microsoft.com/fwlink/?LinkID=108182" or "http://go.microsoft.com/fwlink/?LinkID=115261" to "http://go.microsoft.com/fwlink/?LinkID=124807".
  • generic.xaml should be placed in the directory "themes" as it is in WPF and marked as an assembly resource.
  • There are changes in the layout rendering system concerning evaluation of pixel. Now the arrange and measure values are rounded to integers if they are not in an object that is part of transformation. This aims to improve the text rendering quality. The old layout rendering will be used if you set UIElement.UseLayoutRounding to false.
  • Changing some properties on running animation throws exception “Operation is not valid on an active Animation or Storyboard. Root Storyboard must be stopped first."
    Attached Properties
        Storyboard.TargetNameProperty 
        Storyboard.TargetPropertyProperty 
    Properties on derived classes from Timeline of a collection type
        Storyboard.Children 
        ColorAnimationUsingKeyFrames.KeyFrames 
        DoubleAnimationUsingKeyFrames.KeyFrames 
        PointAnimationUsingKeyFrames.KeyFrames 
        ObjectAnimationUsingKeyFrames.KeyFrames
  • VisualTransition.Duration has changed to VisualTransition.GeneratedDuration. Now this value will not affect the duration of the Storyboard in the transition. It will be used only in generated transitions.

  • VisualStateManager.CustomVisualStateManager now should be set on the root element of control instead of the control itself.

  • MeasureOverride and ArrangeOverride on Canvas are now sealed like on Grid and StackPanel. Derive from Panel if you need to override them.
  • Font URI now has to be an assembly resource. This affects the use of Control.FontFamily, TextBlock.FontFamily and the Glyphs.FontUri when the URIs reference fonts outside of the assembly.
  • Now in XAML you cannot create classes that do not have accessible constructors. This affects the following classes that have internal constructors and are no longer created in XAML:
    TriggerCollection
    InlineCollection
    RowDefinitionCollection
    ColumnDefinitionCollection
    RoutedEventARgs
    MouseButtonEventArgs
    KeyEventARgs
    ErrorEventArgs
    UIElementCollection
    Downloader
    InternalWebRequest
    MultiScaleSubImageCollection
    MediaAttribute
    MediaAttributeCollection
    ExceptionROutedEventArgs
    DownloadProgressEventArgs
    StartupEventArgs
    TextBoxBase
    TextBoxView
    TextChangedEventArgs
    RuntimeHostEventArgs
    SizeChangedEventArgs
    RenderingEventArgs
    ItemCollection
    CorePropertyChangedEventArgs
    IsEndabledChangedEventARgs
    TypeProxy
    ManagedObjectReference
    AutomationPropertiesEnum
    DependencyPropertyProxy
  • Cross domain hosts of Silverlight must set the right MIME type for XAP (application/x-silverlight-app). When the XAP is served from a different domain than the host HTML page, Silverlight will validate that the MIME type (Content-Type response header) returned on the HTTP response is application/x-silverlight-app.

  • Content-Type is allowed on cross domain request by default (more info in here)

  • Breaking change to Silverlight native hosting IXcpControl COM interface (more info in here)

  • HTTP Polling Duplex OM Changes and Reengineering (more info in here)

  • Removed
    • From ContentPresenter and ContentControl are removed TextAlignment, TextDecorations, TextWrapping.
    • FileDialogFileInfo type is removed. Use System.IO.FileInfo instead. OpenFileDialog.SelectedFile/SelectedFiles properties of the same type are changed to OpenFileDialog.File/Files of type System.IO.FileInfo.
    • Address property removed from all WebClient EventArg classes. (see the work around here)
    • From KeyFrameCollections including ColorKeyFrameCollection, DoubleKeyFrameCollection, ObjectKeyFrameCollection, PointKeyFrameCollection, PointKeyFrameCollection the follwoing methods are removed: Add, Contains, Indexof, Insert, Remove, get_Item, set_Item.
    • Control.OnIsEnabledChanged was removed. Now use IsEnabledChanged for extended controls.
    • DownloadProgressEventHandler was removed.
    • WebResponse.Dispose(bool explicitDisposing) was removed.
    • Converters that were removed:
      • TextDecorationCollectionConverter
      • FontStretchConverter
      • FontStyleConverter
      • FontWeightConverter
      • FontFamilyConverter
  • Moved
    • ContentPresenter now derives from FrameworkElement instead of Control. Properties that come from Control and are not in FrameworkElement are now missing.
    • UriTypeConverter is moved to System.dll.
    • System.Windows.Controls.Extended.dll merged to System.Windows.Controls.dll. All references must be updated.
    • MouseEventArgs.Handled was moved to MouseButtonEventArgs.
    • ITableItemProvider and ITableProvider are now derived from IGridItemProvider and IGridProvider.
  • Renamed
    • UIElement.HitTest method is now moved to the VisualTreeHelper class and renamed to VisualTreeHelper.FindElementsInHostCoordinates.
    • RoutedEventArgs.Source was renamed to OriginalSource and is now read-only.
    • RenderTargetBitmap was renamed to HostingRenderTargetBitmap and moved from System.Windows.Media.Imaging to namespace System.Windows.Interop.
    • WebHeaderCollection.Headers property was renamed to Keys.

    • WebHeaderCollection.Keys property was replaced with the AllKeys property.

  • Changed behavior

    • MulticastDelegate.CombineImpl(Delegate[]) now checks if the delegates are of the same type.

    • Control.IsTabStop defaults to true. Now, all Control derived classes (directly or indirectly) have IsTabStop set to true except, UserControl, HyperlinkButton, ScrollViewer and ListBox.

    • KeyDown now is synchronous. This may require changes in your code.
    • WebRequest.RegisterPrefix() now returns false in failure cases per the interface contract from the desktop framework rather than throwing an exception.
  • Properties made read only
    • Deployment.PartProperty
    • Deployment.EntryPointAssemblyProperty
    • Deployment.EntryPointTypeProperty
    • Deployment.RuntimeVersionProperty
    • Deployment.ExternalCallersFromCrossDomainProperty
    • Thumb.IsDragging
    • Slider.IsFocused
    • ButtonBase.IsFocused
    • ButtonBase.IsMouseOver
    • ButtonBase.IsPressed
  • Made private or protected
    • ToolTipService.GetToolTip is now private.
    • PasswordBox.SelectionChanged is now private.
    • IRawElementProviderSimple is now sealed and has a private default constructor.
    • AutomationPeer constructor is now protected.
  • Made internal
    • ItemCollection constructor is no longer available so any code that tries to instantiate an ItemCollection directly will no longer compile. This class is supposed to be instantiated only within ItemsControl.
    • The KeyboardNavigation class
    • Listbox field ListBoxItem._itemsControl
    • Setter.PropertyProperty. Use the CLR property instead of the DependencyProperty.
    • Slider.UpdateTrackLayout()
    • Slider.OnOrientationChanged()
    • Slider.OnIsFocusChanged(DependencyPropertyChangedEventArgs e)
    • ComboBox.get_IsSelectionActive()
    • ComboBox.ScrollIntoView(Int32 index)
    • Constructors made internal
      • ColumnDefinitionCollection
      • InlineCollection
      • ItemCollection
      • RowDefinitionCollection
      • UIElementCollection
      • TriggerCollection
      • SizeChangedEventArgs
      • TextChangedEventArgs
      • DownloadProgressEventArgs
      • ExceptionRoutedEventArgs
      • KeyEventArgs
      • MouseButtonEventArgs
      • MouseEventArgs
      • StartupEventArgs
      • Expression
      • GeneralTransform
      • Geometry
      • ImageSource
      • PathSegment
      • SetterBase
      • Transform
      • BindingExpressionBase
      • InputMethod
  • Changed signature
    • Ink.Stroke constructor changed to ctor(System.Windows.Input.StylusPointCollection).
    • CanConvertFrom(Type sourceType) changed its signature to CanConvertFrom(ITypeDescriptorContext context, Type sourceType).
    • CanConvertTo(Type destinationType) changed its signature to CanConvertTo(ITypeDescriptorContext context, Type destinationType).
    • ConvertFrom(object value) changed its signature to ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value).
    • ConvertFromString(string text) now is ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value) where value of type string.
    • ConvertTo(object value, Type destinationType) changed its signature to ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType).
    • ConvertToString(object value) now is ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType) with destinationType of type string.
  • Changed types
    • Browser.HtmlElementCollection is replaced by Browser.ScriptObjectCollection which is extension over HtmlElementCollection. Existing code will continue running only cast items from ScriptObjectCollection to HtmElement. Order of items in the returned collection may also change.
    • ComboBox.get_SelectionBoxItemTemplate() now returns System.Windows.DataTemplate.
    • TriggerActionCollection.Item now takes System.Windows.TriggerAction instead of System.Windows.Media.Animation.BeginStoryboard.
    • TriggerCollection.Item now takes System.Windows.TriggerBase instead of System.Windows.EventTrigger.
  • Exceptions
    • HttpWebRequest.EndGetResponse() now throws different exceptions.

    • In System.Xml methods of the following classes throw NullReferenceException instead of ArgumentNullException for null arguments: XmlReader , XmlNamespaceManager, XmlConvert ,XmlCharCheckingWriter

    • When MediaFailed exception is unhandled: before - application would continue running silently;  now - exceptions bubble up to the default OnError handler and AG_E_UNKNOWN_ERROR  is displayed.

    • HttpWebRequest.EndGetResponse() now raises more exceptions.

 


Subscribe

Comments

No comments

Add Comment

Login to comment:
  *      *       
Login with Facebook