从Silverlight 2 Beta 2升级到Silverlight 2 RC0

从Silverlight 2 Beta 2升级到Silverlight 2 RC0,第1张

概述  This topic discusses the changes made to the Silverlight runtime and Silverlight tools between the Microsoft Silverlight 2 Beta 2 and the final release of Silverlight 2. The changes discussed in thi  

This topic discusses the changes made to the Silverlight runtime and Silverlight tools between the Microsoft Silverlight 2 Beta 2 and the final release of Silverlight 2. The changes discussed in this article are focused on changes that might cause your older Silverlight-based applications to Now fail or behave differently,not on new features/enhancements for this release.

Note   Corrections/Additions to this document (if any) are Listed here.

Note   Applications built with Beta 2 will not run on final runtime builds. End users will see a message informing them that the application was built with an obsolete version of Silverlight. You must rebuild your Beta 2 applications – see here for more information.

Tip   Given the large number of API changes,particularly those Listed in the Miscellaneous API Changes section,you may want to search this document by using CTRL+F.

 

Contents:

·         Important! Migrating Older Code to the Newer Release

·         ContentPresenter now derives from FrameworkElement instead of Control

·         Layout Rendering Slightly Changed

·         Cross domain hosts of Silverlight must set the right MIME type for XAP (application/x-silverlight-app)

·         Exceptions now thrown in HttpWebRequest.EndGetResponse()

·         Font URI is Restricted to Assembly Resource

·         Browser.HtmlElementCollection replaced with by Browser.ScriptObjectCollection

·         Exceptions When Changing Some Properties on an Active Animation

·         System.Windows.Controls.Extended.dll renamed to System.Windows.Controls.dll

·         VisualStateManager Changes

·         KeyDown Sent Synchronously

·         MeasureOverride/ArrangeOverride on Canvas Now Sealed

·         UriTypeConverter moved to System.dll

·         HtmlPage.UnregisterScriptableObject Removed

·         RenderingEventArgs Changes

·         ContentPresenter and ContentControl Changes

·         Removal of FileDialogFileInfo Type and OpenFileDialog.SelectedFile(s) Properties

·         Removal of FullAccess Option on the ExternalCallersFromCrossDomain attribute in the Silverlight 2 application manifest

·         KeyFrameCollection Changes

·         Request stream must be closed before calling HttpWebRequest.BeginGetResponse()

·         HtmlWindow references on Safari/Mac will no longer evaluate to true

·         Address property removed from all WebClient EventArg classes

·         Constructors Made Internal

·         Exception type change for System.Xml exception type

·         Cannot create classes in XAML that do not have accessible constructors

·         Get AG_E_UNKNOWN_ERROR in Silverlight 2 but not in Silverlight 1

·         Platform looks for generic.xaml as a resource at themes/generic.xaml

·         HTTP Polling Duplex OM Changes and Reengineering

·         Breaking change to Silverlight native hosting IXcpControl COM interface

·         Content-Type is allowed on cross domain request by default

·         Enforcing delegate type check when two delegate objects are combined

·         Miscellaneous API Changes

 

important! Migrating older Code to the Newer Release

If you are migrating Silverlight applications that were created for the Silverlight 2 Beta 2 release or earlIEr to the final release of Silverlight 2,you are going to need to get the newest Silverlight 2 Tools for Visual Studio 2008 and recompile your project(s).

1.      Get the newest version of Silverlight 2 Tools for Visual Studio 2008. You can get these tools from the SDK or online at Getting Started. You may have to uninstall any old tools before doing this install.

2.      Open your old project (e.g. .csproj file). A dialog will come up notifying you that your project was created with an older version of Silverlight tools and asks you if you want to upgrade your project. Click the Yes button.

3.      Open all of the HTML files and change:

·         The Silverlight MIME type from application/x-silverlight-2-b1 or application/x-silverlight-2-b2 to application/x-silverlight-2.

·         The Silverlight 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.

Note: some templates replaced http://go with http://go2. Be sure to search for both.

4.      DeBUG. Many of the breaking changes you are likely to encounter can be found in this document.

 

ContentPresenter Now derives from FrameworkElement instead of Control

Who Is Affected: Applications that use ContentPresenter or objects derived from ContentPresenter.

Summary

Because ContentPresenter Now derives from FrameworkElement,the following propertIEs are no longer exposed by ContentPresenter:

·         Background

·         borderBrush

·         borderThickness

·         DefaultStyleKey

·         FontFamily

·         FontSize

·         FontStretch

·         FontStyle

·         FontWeight

·         Foreground

·         HorizontalContentAlignment

·         IsEnabled

·         IsTabStop

·         padding

·         TabIndex

·         TabNavigation

·         Template

·         VerticalContentAlignment

 

In addition,some APIs were removed from ContentPresenter (see ContentPresenter and ContentControl Changes).

 

Fix required

Remove all these obsolete propertIEs from your ContentPresenter objects,which will likely require you to re-work some of your code to restore your prevIoUs UI rendering.

 

 

Layout Rendering Slightly Changed

Who Is Affected: All content using layout might be rendered slightly differently because layout no longer causes elements to be rendered at sub-pixel locations.

 

Summary

The layout system in Silverlight has been modifIEd to round final measure and arrange values to integers when placing elements on the screen (“pixel snapPing”). The result is crisper lines,more consistent rendering look,and fewer rendering artifacts.

 

Layout rounding will be *on* by default,but there is a new inherited property on UIElement called UseLayoutRounding that can be set to false if the old layout behavior is desired.

 

Note   It is possible that this change will affect how your animations render,in which case you might want to set UseLayoutRounding to false.

Note   This change does not affect transforms. If you apply a transform to an element,it may still be rendered at a sub-pixel location.

 

Cross domain hosts of Silverlight must set the right MIME type for XAP (application/x-silverlight-app)

Who Is Affected: Anyone serving Silverlight 2 apps from cross domain:

·         Via a web server that is not IIS7

·         Via a web server where the MIME type for .XAP files is incorrectly configured

Summary/Fix required

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.

 

Apache (and perhaps other servers) tend to serve unrecognized content as text/plain,and therefore will be affected by this change. You are required to add an entry for the Silverlight XAP MIME type to your .htaccess file -- e.g. AddType application/x-silverlight-app xap.

 

Note   IIS7 shipped with the right MIME type configurations for Silverlight XAPs. No action is required if you are using IIS7.

Exceptions Now thrown in httpWebRequest.EndGetResponse()

Who Is Affected:  Silverlight 2 applications that use httpWebRequest.

Summary/Fix required

For httpWebRequest:

Before:

·         Some security exceptions (e.g. cross-scheme violations) were being raised in httpWebRequest.BeingGetResponse()

·         All other request error conditions were being returned as 404s.

 

Now:

·         Error conditions are Now raised as exceptions in httpRequest.EndGetResponse().

·         Request security errors (e.g. requests not allowed by cross domain policy) raise SecurityExceptions

·         Non-successful requests (e.g. those that returned 404s) raise WebExceptions. The WebException.Response is set to httpStatusCode.NotFound. This is compatible with the desktop.

Font URI is Restricted to Assembly Resource

Who Is Affected: Silverlight 2 Beta1 or Beta 2 applications (not Silverlight 1.0 applications) that reference Fonts (or zip of Fonts) via the URI Syntax in the Control.FontFamily,TextBlock.FontFamily or Glyphs.FontUri attributes and where the Fonts are not embedded within the assembly (dll) of the control or application.

Fix required

You can specify a Font (or in some cases a zip of Fonts) in URI format via the Control.FontFamily,TextBlock.FontFamily and the Glyphs.FontUri attributes. If you are,you will need to ensure your Font is marked as a "resource" in the project system.

browser.HTMLElementCollection replaced with by browser.ScriptObjectCollection

Who Is Affected: SilvlIErlight 2 Beta 2 applications using HTML brIDge’s HTMLElementCollection will break.  The type has been replaced with a new type:  ScriptObjectCollection.

Summary

The System.windows.browser.HTMLElementCollection type was changed to ScriptObjectCollection.  All prevIoUs references to HTMLElement on the collection have been changed to instead reference ScriptObject.  Other areas of the HTML brIDge that prevIoUsly used HTMLElementCollection (i.e. HTMLElement.Children) have been switched to instead return a ScriptObjectCollection.  Note that if you retrIEve an item from the new ScriptObjectCollection that actually is an HTMLElement,you can still cast the return value back to an HTMLElement. 

The specific benefit from this change is that across all browsers you can Now access both element,and non-element,DOM nodes contained in a node collection.  We made this change because there is no consistent cross-browser implementation of an HTMLElement-specific collection type.

Fix required

Change existing references to HTMLElementCollection to ScriptObjectCollection.  If your existing code was working with HTMLElement return values you will need to explicitly cast the items returned from a ScriptObjectCollection to an HTMLElement.  Since the collection type is Now ScriptObjectCollection it is likely that on different browsers the ordinality of the resulting collection will also change.  Any code that was relying on fixed offsets into the collection may need to be changed to account for non-element nodes (e.g. text nodes such as whitespace,etc…) in the collection.

Beta 2

[c#]

HTMLElement myHTMLElement = someOtherHTMLElement.Children[5];

 

Release

[c#]

HTMLElement myHTMLElement = (HTMLElement)someOtherHTMLElement.Children[5]; //assuming the desired element is still at offset 5

 

Exceptions When Changing Some PropertIEs on an Active Animation

Who Is Affected: Silverlight 1.0 and 2.0 applications that change propertIEs on active animations.

Summary

When you change one of the propertIEs Listed below on an active Storyboard,an exception is raised at runtime with this message: “Operation is not valID on an active Animation or Storyboard. Root Storyboard must be stopped first."

The List of propertIEs that cannot be modifIEd on an active animation or Storyboard are Listed below:

Attached PropertIEs

·         Storyboard.TargetnameProperty

·         Storyboard.TargetPropertyProperty

PropertIEs on derived classes from Timeline of a collection type

·         Storyboard.Children (you cannot add/remove animations from an active storyboard)

·         colorAnimationUsingKeyFrames.KeyFrames

·         DoubleAnimationUsingKeyFrames.KeyFrames

·         PointAnimationUsingKeyFrames.KeyFrames

·         ObjectAnimationUsingKeyFrames.KeyFrames

Make sure you stop the Storyboard before changing one of these propertIEs. You can do this by using the Storyboard.Stop method.

System.windows.Controls.Extended.dll renamed to System.windows.Controls.dll

Who Is Affected: Anyone who uses the extended controls (Calendar,DatePicker,TabControl and GrIDSplitter).

Fix required

Change all references from System.Controls.Extended to System.windows.Controls and recompile your application.

visualstatemanager Changes

Who Is Affected: Silverlight 2 applications that use visualstatemanager.

Summary

VisualTransition.Duration has changed to VisualTransition.GeneratedDuration. This value will Now only affect the generated Transitions,and not the VisualTransition.Storyboard.

 

Example:

In the below XAML,the VSM generated animations for the pressed-> normal Transition will be created with 1 second durations. The explicit Transition Storyboard with its blue colorAnimation will still be 2 seconds.

[xaml]

<vsm:VisualStateGroup x:name="CommonStateGroup">

   ...

   <vsm:VisualStateGroup.Transitions>

      ...

      <vsm:VisualTransition From="pressed" To="normal" GeneratedDuration="0:0:1">

         <Storyboard>

             <colorAnimation Storyboard.Targetname="MainRect"  Duration="0:0:2"

                             Storyboard.TargetProperty="Fill" Speedratio="2" To="Blue"/>

        </Storyboard>

      </vsm:VisualTransition>

   </vsm:VisualStateGroup.Transitions>

 

</vsm:VisualStateGroup>

 

visualstatemanager.Customvisualstatemanager should be set on the root visual of the ControlTemplate or UserControl,not the Control/UserControl itself. In the example below,the custom visual state manager is set on the GrID,the ControlTemplate’s root visual.

[xaml]

<ControlTemplate  targettype="local:CheckBox">

  <GrID x:name="RootElement" HorizontalAlignment="Center"

    VerticalAlignment="Center" Background="transparent">

 

    <vsm:visualstatemanager.Customvisualstatemanager>

      <local:Myvisualstatemanager>

    </vsm:visualstatemanager.Customvisualstatemanager>

 

  ...

 

  </GrID>

</ControlTemplate>

 

KeyDown Sent Synchronously

Who Is Affected: If you prevIoUsly have been doing operations in the KeyDown event that Could cause reentrancy into the Silverlight control,such as calling into the HTMLPage.Window.Alert function,this will no longer be supported.

Summary

We switched over our keyboard handling for character input to use the concept of the WM_CHAR windows message. This is used for TextBox/PasswordBox text entry to enable scenarios such as entering AltGr keystrokes. In order for us to do this,the KeyDown event had to be sent synchronously for managed code.  

 

MeasureOverrIDe/ArrangeOverrIDe on Canvas Now Sealed

Who Is Affected: Silverlight 2 Beta 2 Applications that use MeasureOverrIDe and ArrangeOverrIDe on Canvas.

Summary

MeasureOverrIDe and ArrangeOverrIDe virtual methods on Canvas are sealed. These methods were already sealed for GrID and StackPanel. Any custom panel that requires its own layout logic should subclass Panel.

UriTypeConverter moved to System.dll

Who Is Affected: Silverlight 2 managed code referencing the UriTypeConverter class.

Fix required

UriTypeConverter was moved from System.windows.Controls.dll to System.dll where it resIDes on the desktop framework. Applications that reference it just need to be recompiled.

HTMLPage.UnregisterScriptableObject Removed

Who Is Affected: Those using HTMLPage.UnregisterScriptableObject.

Fix required

Alternative to using HTMLPage.UnregisterScriptableObject,developers can Now re-use the same script registration key for RegisterScriptableObject.  This allows developers to change the underlying managed object associated with a scriptable entry point.

RenderingEventArgs Changes

Who Is Affected: Silverlight 2 managed code referencing the RenderingEventArgs class.

Summary

The following changes have been made to class RenderingEventArgs

·         RenderingEventArgs is moved from System.windows to System.windows.Media

·         RenderingEventArgs.ctor() is Now internal

·         System.windows.RenderingEventHandler has been removed.

ContentPresenter and ContentControl Changes

Who Is Affected: Silverlight 2 managed code that uses either the ContentPresenter or ContentControl classes.

Summary

The following propertIEs were removed from ContentPresenter and ContentControl.

·         TextAlignment

·         Textdecorations

·         textwrapPing

Removal of fileDialogfileInfo Type and OpenfileDialog.Selectedfile(s) PropertIEs

Who Is Affected: Silverlight 2 applications which use the OpenfileDialog.

Summary

·         The System.windows.fileDialogfileInfo type is being removed. Its functionality is Now being exposed via its base System.IO.fileInfo type to transparent code within Silverlight’s sandBox.

·         System.windows.Controls.OpenfileDialog has a couple propertIEs which consume and expose fileDialogfileInfo. They were modifIEd to return the fileInfo type.

·         In addition,the property names Selectedfile and Selectedfiles were also changed to file and files.

 

Fix required

Beta 2

[c#]

// Returns a file object for the selected file. If multiple files are selected,returns the first selected file

public fileDialogfileInfo Selectedfile { get; }

 

// Returns a collection of file objects for the selected files

public IEnumerable<fileDialogfileInfo> Selectedfiles { get; }

 

Release

[c#]

// Returns a file object for the selected file. If multiple files are

// selected,returns the first selected file

public fileInfo file { get; }

 

// Returns a collection of file objects for the selected files

public IEnumerable<fileInfo> files { get; }

 

Sample usage of OpenfileDialog with this change:

[c#]

openfileDialog = new System.windows.Controls.OpenfileDialog();

openfileDialog.Multiselect = false;

openfileDialog.Filter = "Text files (*.txt)|*.txt|All files (*.*)|*.*";

 

bool? retval = ofd.ShowDialog();

if (retval != null && retval == true) {

 

    // Get the filename

    string filename = openfileDialog.file.name;

    // Open the file

    System.IO.Stream filestream = openfileDialog.file.OpenRead();

 

    // Do something with the filestream

 

    // Close it

}

 

 

Removal of FullAccess Option on the ExternalCallersFromCrossDomain attribute in the Silverlight 2 application manifest

Who Is Affected: Only Silverlight 2 applications that use this combination of features:

·         XAP deployed on a different domain than the host HTML page,and

·         with application manifest (AppManifest.xaml) specifying ExternalCallersFromCrossDomain=”FullAccess” on the root element are affected.

Summary

The ability for arbitrary scripts to walk the element tree,register for and get notifIEd on events,and use the Silverlight 1.0 Downloader from script has been curtailed in a cross-domain app deployment scenario. The application manifest prevIoUsly supported the ability for app author to designate the ExternalCallersFromCrossDomain attribute with the values NoAccess (default in cross-domain),ScriptableOnly and FullAccess. Support for the FullAccess option has been removed.

Many of the purposes you would have relIEd on the FullAccess option can Now be fulfilled via the Scriptable object feature,with minor additional work on your part.

 

KeyFrameCollection Changes

Summary and Fix

Virtual methods Add,Contains,Indexof,Insert,Remove,get_Item,set_Item are no longer declared on the following collections:

·         colorKeyFrameCollection.

·         DoubleKeyFrameCollection

·         ObjectKeyFrameCollection

·         PointKeyFrameCollection

·         PointKeyFrameCollection

·         strokeCollection

 

Request stream must be closed before calling httpWebRequest.BeginGetResponse()

Who Is Affected: Silverlight 2 applications that use httpWebRequest.BeginGetResponse().

Summary

You must close the request stream on an httpWebRequest before calling BeginGetResponse(). PrevIoUsly BeginGetResponse() would close an open request stream.

 

HTMLWindow references on Safari/Mac will no longer evaluate to true

Who Is Affected: Code that uses System.windows.browser.HTMLWindow and that expects two HTMLWindow references pointing at the same DOM window to evaluate to true will Now return false when running on Safari 2 or Safari 3 on Mac.

Summary

For example:

·         Create a page with one iframe

·         Use the brIDge to get two references to the iframe:

HTMLWindow myWin  = document.GetElementByID(“myiframe”);

HTMLWindow myWin2  = document.GetElementByID(“myiframe”);

·         With the change the following comparison will Now return false on Safari 2/3 Mac:

bool areEqual = (myWin == myWin2);

 

 

 

Address property removed from all WebClIEnt EventArg classes

Fix Needed

If you were depending on the Address property,you can work around this breaking change in the following way:

Beta 2

[c#]

voID Callback(object sender,DownloadStringCompletedEventArgs args)

{

    DeBUGPrint(args.Address.ToString());

}

 

voID MakeCall(Uri uri,object userState)

{

    webClIEnt.DownloadStringAsync(uri,userState);

}

 

Release

[c#]

class DownloadState

{

    public DownloadState() {}

    public Uri Address;

    public object ActualUserState;

}

 

voID Callback(object sender,DownloadStringCompletedEventArgs args)

{

    DownloadState userState = (DownloadState)args.UserState;

 

    DeBUGPrint(userState.Address.ToString());

}

 

voID MakeCall(Uri uri,object userState)

{

    Uri absoluteUri = uri;

    if (absoluteUri.IsabsoluteUri == false)

    {

        absoluteUri = new Uri(new Uri(webClIEnt.BaseAddress),absoluteUri);

    }

 

    DownloadState downloadState = new DownloadState();

    downloadState.Address = absoluteUri;

    downloadState.ActualUserState = userState;

 

    webClIEnt.DownloadStringAsync(uri,downloadState);

}

 

 

 

Constructors Made Internal

Summary

You can no longer create the objects Listed below because their associated constructors have been made internal:

·         SizeChangedEventArgs

·         TextChangedEventArgs

·         DownloadProgressEventArgs

·         ExceptionRoutedEventArgs

·         KeyEventArgs

·         MousebuttonEventArgs

·         MouseEventArgs

·         StartupEventArgs

·         Expression

·         Generaltransform

·         Geometry

·         ImageSource

·         PathSegment

·         SetterBase

·         transform

·         BindingExpressionBase

·         inputMethod

 

Exception type change for System.Xml exception type

Summary

In the methods/constructors shown below,we will no longer be checking for null arguments. As a result,the usage of null arguments will result in a NullReferenceException. In prevIoUs builds of Silverlight,use of a null argument would result in an ArgumentNullException being thrown. There is no change in functionality,just the type of exception that is being thrown.

·         XmlReader.Isname method

·         XmlReader constructor

·         XmlReader.MovetoAttribute method

·         XmlReader:IsnameToken method

·         XmlnamespaceManager constructor

·         XmlReader.nametable.Add method

·         XmlReader.nametable.Get method

·         XmlCharCheckingWriter.WriteQualifIEdname method

·         XmlCharCheckingWriter.WriteDOCTYPE method

·         XmlConvert.ToBoolean method

·         XmlConvert.Todouble method

·         XmlConvert.ToSingle method

·         XmlConvert.ToDateTime method

 

Cannot create classes in XAML that do not have accessible constructors

Summary

Certain classes that were defined by the Silverlight runtime were creatable in XAML,even though they dID not have an accessible constructor.  With this change,you can no longer instantiate those classes in XAML.

These classes (which only have internal constructors) can no longer be 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

 

Get AG_E_UNKNowN_ERROR in Silverlight 2 but not in Silverlight 1

Summary

In prevIoUs versions of Silverlight,when media Failed because a media file was not available,a MediaFailed event was fired but if the MediaFailed event was not handled by the developer,the end user would not be notifIEd of the failure. Now when a handler is not hooked up to the MediaFailed event,the error bubbles up to the default OnError handler of the plug-in and AG_E_UNKNowN_ERROR is displayed to the user.

Fix required

Attach the MediaFailed event to your MediaElement objects and handle errors as appropriate.

 

Platform looks for generic.xaml as a resource at themes/generic.xaml

Summary

The platform Now looks for the generic.xaml resource dictionary as an assembly resource in the "themes" directory rather than the root directory.

Fix required

Move your generic.xaml resource underneath the "themes" folder under Controllib in Solutions Explorer in Visual Studio.

 

http Polling Duplex OM Changes and Reengineering

Who Is Affected: This will impact anyone using the http Polling Duplex channel.

Summary

·         PollTimeout setting on the server sIDe (PollingDuplexhttpBinding and PollingDuplexBindingElement) has been renamed to ServerPollTimeout

·         PollTimeout setting on the PollingDuplexBindingElement (clIEnt sIDe) has been renamed to ClIEntPollTimeout.

·         PollTimeout setting on the PollingDuplexhttpBinding (clIEnt sIDe) has been cut. In most scenarios,it should not be necessary to change this. If a change is necessary,it can be achIEved through the ClIEntPollTimeout on the PollingDuplexBindingElement.

·         ClIEnt-sIDe support has been cut from the non-Silverlight (server-sIDe) polling duplex assembly (i.e. BuildChannelFactory will throw a NotSupportedException). That is,in RTM,the clIEnt sIDe for polling duplex must be Silverlight (and the server sIDe must be the regular .NET Framework,but this restriction was already in place in Beta2).

·         Default timeouts have been changed for the Duplex channel. For most common scenarios,the new out-of-the-Box defaults should be appropriate and there is no need to change them.

·         An error (404) on a polling request will cause the duplex channel to fault.

·         VarIoUs invalID messages used to be ignored by the Duplex stack but will Now be rejected.

·         If any http error (404,500,…) is encountered during a SOAP call,a CommunicationException is Now thrown instead of a ProtocolException.

 

Breaking change to Silverlight native hosting IXcpControl COM interface

Who Is Affected: Applications that host Silverlight 2 natively via its COM APIs.

Summary

·         The following splash screen related propertIEs added to IXcpControl interface are being broken out and being moved to a new IXcpControl2 interface:

·         get_OnSourceDownloadComplete

·         get_OnSourceDownloadProgressChanged

·         get_SplashScreenSource

·         put_OnSourceDownloadComplete

·         put_OnSourceDownloadProgressChanged

·         put_SplashScreenSource

 

In addition,the LoadRuntime function is also being moved to IXcpControl2.

 

Content-Type is allowed on cross domain request by default

Summary

Both supported cross domain policy files (crossdomain.xml,clIEntaccesspolicy.xml) no longer need to explicitly allow the Content-Type request header.  The Content-Type header is always settable on POST xdomain requests,as long as the request itself is allowed by a cross domain policy file.

In addition,the LoadRuntime function is also being moved to IXcpControl2.

 

Fix required

PrevIoUsly you needed to specify Content-Type in the headers whiteList.  Now,Content-Type is always allowed,so the bolded “Content-Type” attribute value is no longer required just for setting the Content-Type (see below).

clIEntaccesspolicy.xml

old version that explicitly Listed Content-Type as settable.  (This file still works in SL2 RTM.)

[xaml]

<?xml version="1.0"?>

<access-policy>

    <cross-domain-access>

        <policy>

            <allow-from http-request-headers="Content-Type,SOAPAction">

                <domain uri="*"/>

            </allow-from>

            <grant-to>

                <resource include-subpaths="true" path="/"/>

            </grant-to>

        </policy>

    </cross-domain-access>

</access-policy>

New version that still allows Content-Type to be set

[xaml]

<?xml version="1.0"?>

<access-policy>

    <cross-domain-access>

        <policy>

            <allow-from http-request-headers="SOAPAction">

                <domain uri="*"/>

            </allow-from>

            <grant-to>

                <resource include-subpaths="true" path="/"/>

            </grant-to>

        </policy>

    </cross-domain-access>

</access-policy>

 

crossdomain.xml

old version that explicitly Listed Content-Type as settable.  (This file still works in SL2 RTM.):

[xaml]

<?xml version="1.0"?>

<cross-domain-policy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nonamespaceSchemaLocation="http://www.adobe.com/xml/schemas/Policyfile.xsd">

    <allow-access-from domain="* " />

    <allow-http-request-headers-from domain="* " headers="Content-Type,SOAPAction" secure="true" />

</cross-domain-policy>

 

New version that still allows Content-Type to be set:

[xaml]

<?xml version="1.0"?>

<cross-domain-policy xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:nonamespaceSchemaLocation="http://www.adobe.com/xml/schemas/Policyfile.xsd">

    <allow-access-from domain="* " />

    <allow-http-request-headers-from domain="* " headers="SOAPAction" secure="true" />

</cross-domain-policy>

 

Enforcing delegate type check when two delegate objects are combined

Who Is Affected: Code that bypass the delegate type check in Delegate.Combine by calling MulticastDelegate.CombineImpl directly.

Fix required

If you want to combine two delegate objects they should be of the exact same delegate type.

 

Miscellaneous API Changes

·         UIElement.HitTest method has moved to the VisualTreeHelper class and renamed to VisualTreeHelper.FindElementsInHostCoordinates.

·         Moved DependencyPropertyChangedEventHandler delegate type from System.windows.Controls to System.windows namespace.

·         Control.IsTabStop defaults to true. Now,all Control derived classes (directly or indirectly) have IsTabStop set to true except,UserControl,Hyperlinkbutton,ScrollVIEwer and ListBox.

·         WebheaderCollection.Keys property was replaced with the AllKeys property.

·         WebheaderCollection.headers property was renamed to Keys.

·         WebRequest.RegisterPrefix() Now returns false in failure cases per the interface contract from the desktop framework rather than throwing an exception.

·         WebResponse.dispose(bool explicitdisposing) was removed.

·         Deployment.PartProperty is Now read only.

·         Deployment.EntryPointAssemblyProperty is Now read only.

·         Deployment.EntryPointTypeProperty is Now read only.

·         Deployment.RuntimeVersionProperty is Now read only.

·         Deployment.ExternalCallersFromCrossDomainProperty is Now read only.

·         Thumb.IsDragging is Now read only.

·         SlIDer.IsFocused is Now read only.

·         buttonBase.IsFocused is Now read only.

·         buttonBase.IsMouSEOver is Now read only.

·         buttonBase.Ispressed is Now read only.

·         tooltipService.Gettooltip is Now private.

·         IRawElementProvIDerSimple is Now sealed and has a private default constructor.

·         Setter.PropertyProperty is Now internal. Please use the CLR property instead of the DependencyProperty.

·         SlIDer.UpdateTrackLayout() is Now internal.

·         SlIDer.OnorIEntationChanged() is Now internal.

·         SlIDer.OnIsFocusChanged(DependencyPropertyChangedEventArgs e) is Now internal.

·         ComboBox.get_IsSelectionActive() is Now internal.

·         ComboBox.ScrollintoVIEw(Int32 index) is Now internal.

·         ComboBox.get_SelectionBoxItemTemplate() Now returns System.windows.DataTemplate.

·         PasswordBox.SelectionChanged is Now private.

·         MouseEventArgs.Handled was moved to MousebuttonEventArgs.

·         rendertargetBitmap was renamed to HostingrendertargetBitmap and moved from System.windows.Media.Imaging to namespace System.windows.Interop.

·         automationPeer constructor is Now protected.

·         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.

·         RoutedEventArgs.source was renamed to OriginalSource and is Now read-only.

·         ItableItemProvIDer and ItableProvIDer are Now derived from IGrIDItemProvIDer and IGrIDProvIDer.

·         The KeyboardNavigation class is Now internal.

·         ColumnDeFinitionCollection constructor was made internal.

·         InlineCollection constructor was made internal.

·         ItemCollection constructor was made internal.

·         RowDeFinitionCollection constructor was made internal.

·         UIElementCollection constructor was made internal.

·         TriggerCollection constructor was made internal.

·         ListBox fIEld ListBoxItem._itemsControl is Now internal.

·         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,object value) where value of type string.

·         ConvertTo(object value,Type destinationType) changed its signature to ConvertTo(ITypeDescriptorContext context,object value,Type destinationType).

·         ConvertToString(object value) Now is ConvertTo(ITypeDescriptorContext context,Type destinationType) with destinationType of type string.

·         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.

·         ContentPresenter Now derives from FrameworkElement instead of Control.

·         Control.OnIsEnabledChanged was removed. Now use IsEnabledChanged for extended controls.

·         DownloadProgressEventHandler was removed.

·         The following converters were removed:

·         TextdecorationCollectionConverter

·         FontStretchConverter

·         FontStyleConverter

·         FontWeightConverter

·         FontFamilyConverter

 

部分翻译:

 

 

从Silverlight Beta 2升级到Silverlight RC0
这里主要介绍了从Silverlight 2的Beta 2版本和最后的RTM版本之间做了一些关于Silverlight运行时和
Silverlight工具上的的变化。
在这篇文章介绍Silverlight的变化在可能会引起你的旧版本Silverlight应用程序到现在RC0的上运行失败或错误的内容表现,并声明在Silverlight的最终版发布后不会有新的特性和增强。

注意:  修改/增加后的内容请查看这个文档 <http://go.microsoft.com/fwlink/?LinkId=119604>.注意:  安装Beta 2用户运行RC版本应用程序时,终端用户将看见一条消息通知他们应用程序是由        Silverlight 的一个过时的版本被创建。你必须重建你的        Beta 2 应用程序 。

总结

以上是内存溢出为你收集整理的从Silverlight 2 Beta 2升级到Silverlight 2 RC0全部内容,希望文章能够帮你解决从Silverlight 2 Beta 2升级到Silverlight 2 RC0所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://www.outofmemory.cn/web/1053811.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-25
下一篇 2022-05-25

发表评论

登录后才能评论

评论列表(0条)

保存