文章目錄
- Ensuring That Your Silverlight 2 Applications Work with the Silverlight 3 Beta Release
首先你需要下載Microsoft Web Platform Installer 2.0 Beta
下載完後啟動安裝包,它會去擷取最新的網路安裝包資訊
我驚喜的發現Silverlight 3 Tools for Visual Studio 2008 SP1 Beta已經可以下載了
其詳細資料如所示,並和Silverlight 2 Tools比較,發現Silverlight 3 Tools的大小反而小了很多,壓縮了1倍多
Silverlight 3 Tools的版本號碼由Silverlight 2 Tools的9.0.30729.146提升到了9.0.30729.463
此外我們還從上面看到了ASP.NET MVC 1.0正式版
這兩個Web組件估計都是明天在MIX2009上才發布的
不過不小心通過Microsoft Web Platform Installer 2.0 Beta泄露出來了
但是目前的問題是簡體中文版的VS2008 SP1不能安裝(親身測試過)
Silverlight 3的文檔也已經提供了下載
Silverlight 3 Tools For Visual Studio Beta也可以從這裡下載
在英文版的VS2008 sp1上安裝過後,Silverlight 3 Runtime版本號碼是3.0.40307.0
Silverlight 3包含了三個工程Silverlight Application,Silverlight Navigation Application(這個是最新的),Silverlight Class Library
建立網站的類型依託現在依託在ASP.NET網站
ToolBox的控制項也增加了很多,包括所有的2含有的控制項+Silverlight Toolkit包+少量新控制項(比如ErrorSummary等)
Silverlight 3 Beta和Silverlight 2之間的相容性做的不錯,看下下面的 Breaking Change文檔就知道了
Ensuring That Your Silverlight 2 Applications Work with the Silverlight 3 Beta ReleaseIntroduction
This topic discusses the changes made to the Silverlight runtime and Silverlight tools between the Microsoft Silverlight 2 and Silverlight 3 Beta. 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.
Contents:
· OpenFileDialog.ShowDialog() can now only be opened from a user initiated event
· HyperlinkButton now navigates the entire window and not just the IFRAME that Silverlight is in
· Mouse events inside a Popup now give positions relative to the pop-up not the entire application
· ReadOnlyObservableCollection moved from System.Windows.Controls.Data.dll to System.Windows.dll
OpenFileDialog.ShowDialog() can now only be opened from a user initiated event
Who Is Affected: All applications.
Summary
For security reasons, OpenFileDialog.ShowDialog() may only be called during a user initiated event (MouseLeftButtonDown/Up and KeyDown/Up) or derived user event like clicking a button, checking a checkbox, etc. This brings Silverlight into line with how the other major browsers and plug-ins behave.
HyperlinkButton now navigates the entire window and not just the IFRAME that Silverlight is in
Who Is Affected: Silverlight 2 applications recompiled for Silverlight 3 Beta.
Summary
In Silverlight 2, HyperlinkButton behaved inconsistently across browsers. In Internet Explorer, HyperlinkButton will navigate the entire browser not just the current IFrame.
In other browsers, HyperlinkButton navigates only the current IFrame, which is consistent with HTML behavior. In Silverlight 3 Beta, we've changed the behavior inside Internet Explorer to match the behavior in other browsers.
Mouse events inside a Popup now give positions relative to the pop-up not the entire application
Who Is Affected: Silverlight 2 applications recompiled for Silverlight 3 Beta.
Summary
Suppose you have an element inside a pop-up that listens to mouse events:
[xaml]
<Popup>
<Border Name="border" MouseLeftButtonDown="OnMouseLeftButtonDown"/>
</Popup>
[c#]
void OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
… e.GetPosition(border) ...
}
In Silverlight 2, the coordinates from MouseButtonEventArgs.GetPosition will be relative to the entire Silverlight plug-in, even though the application asked for coordinates relative to the border control (the parameter to GetPosition is supposed to indicate the frame of reference). This has been fixed in Silverlight 3 Beta.
ReadOnlyObservableCollection moved from System.Windows.Controls.Data.dll to System.Windows.dll
Who Is Affected: Silverlight 2 applications recompiled for Silverlight 3 Beta.
Summary
This class has been moved into System.Windows.dll so that other APIs in System.Windows.dll can use it. In order to minimize download size impact we've removed some uncommonly used methods.
Note that this will not affect applications compiled for Silverlight 2. If you use ReadOnlyObservableCollection in Silverlight 2, your .xap file will contain a copy of System.Windows.Controls.Data.dll. When Silverlight 3 Beta runs your .xap, it will use the .xap's copy of System.Windows.Controls.Data.dll and that version of ReadOnlyObservableCollection, not the version that ships in the System.Windows.dll of Silverlight 3 Beta.