먼저 당연하겠지만 지금은 영문 버전에서만 되니깐 한글 버전 Visual Studio 에서 왜 안되냐고 땡깡부리지 마세요 :)
내용 엄청 기니까 Ctrl+F를 활용하시길. 웬만하면 영어 문서 참고하시고요.
더보기
구 버전에서 마이그레이션 하기.
- 기존의 Microsoft Silverlight 관련 툴을 모두 제거하고 새 버전의 툴로 설치.
- 구 프로젝트 파일(예 ; .csproj)을 열 때 나오는 업그레이드 질문에 Yes 선택.
- HTML 파일의 <object> 태그 설정에 MIME-Type을 application/x-silverlight-2로 변경.
Silverlight 설치 URL을 http://go.microsoft.com/fwlink/?LinkID=124807로 변경.
혹시 http://go 나 http://go2가 있으면 이것도 위의 URL로 변경.(검색 할 것) - 디버그, 엄청난 브레이킹 체인지가 쏟아져 나오겠지만 문서를 참고해서 수정할 것.
ContentPresenter는 이제 Control 대신 FrameworkElement에서 파생됨.
적용 대상 : ContentPresenter 혹은 ContentPresenter를 상속받는 오브젝트를 사용하는 애플리케이션.
요약
다음의 속성이 ContentPresenter에서 제거됨.
- Background
- BorderBrush
- BorderThickness
- DefaultStyleKey
- FontFamily
- FontSize
- FontStretch
- FontStyle
- FontWeight
- Foreground
- HorizontalContentAlignment
- IsEnabled
- IsTabStop
- Padding
- TabIndex
- TabNavigation
- Template
- VerticalContentAlignment
또한 몇몇 API가 ContentPresenter에서 제거됨(※ContentPresenter 및 ContentControl 변경 사항 참조)
수정 요구 사항
ContentPresenter 오브젝트의 지원되지 않는 모든 속성들을 제거하고 그에 상응하는 UI 렌더링을 위한 작업이 필요.
레이아웃 렌더링이 살짝 변경됨.
적용 대상 : 레이아웃을 사용하는 모든 콘텐트가 아마도 살짝 다르게 렌더링 됨.
요약
실버라이트의 레이아웃 시스템이 최종 측정(measure)과 배치(arrange)된 값을 정수로 반올림하도록 수정됨(pixel snapping). 결과적으로 뚜렷한 선과 일관적인 렌더링 룩, 그리고 잡티가 줄어듬.
레이아웃 반올림은 기본으로 켜질 것이지만 필요하다면 UIElement에서 상속받은 UseLayoutRounding을 false로 설정하여 끌 수 있음.
단, 이 변경은 Transform에는 적용되지 않음.
Cross domain 호스트는 반드시 올바른 XAP MIME 타입을 설정해야 함(application/x-silverlight-app)
적용 대상 : 크로스 도메인에서 실버라이트 2 앱을 호스팅하는 모든 사람
- IIS7이 아닌 웹 서버
- .XAP 파일을 위한 MIME타입이 올바르지 않은 웹 서버
요약 및 수정 요구 사항
XAP 파일이 호스트 HTML 페이지와 다른 도메인에서 제공된 경우 실버라이트는 HTTP response의 Content-Type의 MIME type이 application/x-silverlight-app임을 검증.
올바른 XAP MIME타입을 웹 서버 설정에 추가해야 함
예 : 아파치의 경우 .htaccess 파일에 AddType application/x-silverlight-app xap
단, IIS7은 실버라이트 XAP을 위한 MIME 타입이 이미 설정되어 있음.
HttpWebRequest.EndGetResponse()에서 이제 예외가 발생함.
적용 대상 : HttpWebRequest를 사용하는 실버라이트 2 애플리케이션.
요약 및 수정 요구 사항
[Beta 2]
- 몇몇 보안 예외(예를 들어 크로스 스키마 위반)가 HttpWebRequest.BeingGetResponse()에서 발생함
- 다른 모든 요청 에러 조건은 404로 반환됨
[RC0]
- 에러 조건은 이제 HttpRequest.EndGetResponse()에서 예외로 발생함
- 요청 보안 에러(예; 크로스 도메인 정책에서 불허용)는 SecurityException으로 발생
- 성공적이지 않은 요청(예; 404 등)은 WebExceptions로 발생. WebException.Response는 HttpStatusCode.NotFound로 설정됨.
폰트 URI가 어셈블리 리소스로 제한됨.
적용 대상 : Control.FontFamily, TextBlock.FontFamily, Glyphs.FontUri에서 URI 문법을 사용하여 폰트(zip, ttf 등)를 참조하는 실버라이트 2 애플리케이션.
수정 요구 사항
만약 Control.FontFamily, TextBlock.FontFamily, Glyphs.FontUri 어트리뷰트에 URI 문법으로 폰트를 지정하였다면 반드시 해당 폰트가 프로젝트의 “resource”로 추가되어야 함.
Browser.HtmlElementCollection이 Browser.ScriptObjectCollection으로 대체됨.
수정 요구 사항 요약
[Beta 2]
HtmlElement myHtmlElement = someOtherHtmlElement.Children[5];
[RC0]
HtmlElement myHtmlElement = (HtmlElement)someOtherHtmlElement.Children[5];
동작중인 애니메이션의 몇몇 속성을 변경할 때 예외.
요약
동작중인 Storyboard에 있는 다음의 속성을 변경했을 때 “Operation is not valid on an active Animation or Storyboard. Root Storyboard must be stopped first.”라는 메시지와 함께 예외 발생.
<Attached 속성>
- Storyboard.TargetNameProperty
- Storyboard.TargetPropertyProperty
<Timeline 컬렉션 타입에서 파생된 클래스에 있는 속성>
- Storyboard.Children (동작중의 스토리보드에 애니메이션을 추가/제거 불가능)
- ColorAnimationUsingKeyFrames.KeyFrames
- DoubleAnimationUsingKeyFrames.KeyFrames
- PointAnimationUsingKeyFrames.KeyFrames
- ObjectAnimationUsingKeyFrames.KeyFrames
System.Windows.Controls.Extended.dll 이 System.Windows.Controls.dll로 이름이 바뀜.
모든 참조를 변경하고 리컴파일 고고싱.
VisualStateManager 변경 사항.
요약
VisualTransition.Duration이 VisualTransition.GeneratedDuration으로 변경됨. 이 값은 오직 생성된 트랜지션에만 적용되며 VisualTransition.Storyboard에는 적용되지 않음.
예제:
아래의 XAML에서, VSM은 Pressed –> Normal 트랜지션을 1초 길이로 애니메이션을 생성할 것임. 그러나 명시적인 트랜지션 Storyboard에 있는 ColorAnimation은 여전히 2초가 됨.
<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는 Control/UserControl 자신이 아닌 반드시 ControlTemplate이나 UserControl의 루트 비주얼에서 설정되어야 함.
<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이 동기적으로 전송됨.
요약
문자 입력을 위한 키보드 핸들링을 WM_CHAR 윈도 메시지의 컨셉으로 전환함. TextBox/PasswordBox의 입력 시나리오에서 필요하며 KeyDown 이벤트는 매니지드 코드를 위해 동기적으로 전송됨.
Canvas에 있는 MeasureOverride/ArrangeOverride가 이제 봉인(Sealed)됨.
요약
이미 Grid나 StackPanel에는 Sealed되었고 자신의 레이아웃 시스템이 필요하다면 Panel의 서브 클래스를 작성할 것.
UriTypeConverter가 System.dll로 이동함.
참조를 수정하고 리컴파일 고고씽.
HtmlPage.UnregisterScriptableObject 제거됨.
요약
HtmlPage.UnregisterScriptableObject 대신 동일한 스크립트 등록 키를 사용한 RegisterScriptableObject를 재사용 할 수 있음. 이를 통해 매니지드 오브젝트에 연결된 스크립터블 진입점을 교체 가능.
RenderingEventArgs 변경 사항.
요약
- RenderingEventArgs가 System.Windows에서 System.Windows.Media로 이동
- RenderingEventArgs.ctor()가 internal로 변경
- System.Windows.RenderingEventHandler가 제거됨
ContentPresenter와 ContentControl 변경 사항.
요약
다음의 속성이 제거됨
- TextAlignment
- TextDecorations
- TextWrapping
FileDialogFileInfo 타입과 OpenFileDialog.SelectedFile(s) 속성의 수정.
요약
- System.Windows.FileDialogFileInfo 타입이 제거됨. 그 기능들은 System.IO.FileInfo 타입에 기반하여 실버라이트의 샌드박스 모델 하에서 투명한 코드로 노출됨.
- System.Windows.Controls.OpenFileDialog에 있는 FileDialogFileInfo를 노출하는 두 프로퍼티가 FileInfo타입을 노출하도록 변경됨.
- 또한 SelectedFile과 SelectedFiles가 File과 Files로 이름이 변경됨.
수정 요구 사항
[Beta 2]
public FileDialogFileInfo SelectedFile { get; }
public IEnumerable<FileDialogFileInfo> SelectedFiles { get; }
[RC0]
public FileInfo File { get; }
public IEnumerable<FileInfo> Files { get; }
[RC0 샘플]
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
}
실버라이트 애플리케이션 매니페스트의 ExternalCallersFromCrossDomain 어트리뷰트에 있는 FullAccess옵션 제거됨.
적용 대상 : 다음의 기능을 사용하는 실버라이트 2 애플리케이션
- 호스트 HTML 페이지와 다른 도메인에서 배포된 XAP 그리고,
- 애플리케이션 매니페스트(AppManifest.xaml)에 ExternalCallersFromCrossDomain="FullAccess"가 적용된 경우
요약
크로스 도메인 상황에서의 기본 값은 NoAccess이고 기존의 FullAccess대신 ScriptableOnly를 사용해야 함.
KeyFrameCollection 변경 사항.
요약 및 수정
Add, Contains, Indexof, Insert, Remove, get_Item, set_Item 버추얼 메서드가 다음의 컬렉션에서 더 이상 정의되지 않음.
- ColorKeyFrameCollection
- DoubleKeyFrameCollection
- ObjectKeyFrameCollection
- PointKeyFrameCollection
- StrokeCollection
스트림 요청은 HttpWebRequest.BeginGetResponse()를 호출하기 전에 반드시 닫아야 함.
적용 대상 : HttpWebRequest.BeginGetResponse()를 사용하는 실버라이트 2 애플리케이션.
Safari/MAC에서의 HtmlWindow 참조가 더 이상 true로 평가되지 않음.
요약
예를 들어,
- 하나의 iframe을 가진 페이지 생성
- iframe에 대한 두 개의 참조를 획득
HtmlWindow myWin = document.GetElementById("myIframe");
HtmlWindow myWin2 = document.GetElementById("myIframe");
- MAC의 Safari 2/3는 다음의 비교를 false로 반환
bool areEqual = (myWin == myWin2);
모든 WebClient EventArg 클래스들에 있는 Address 속성이 제거됨.
[Beta 2]
void Callback(object sender, DownloadStringCompletedEventArgs args)
{
DebugPrint(args.Address.ToString());
}
void MakeCall(Uri uri, object userState)
{
webClient.DownloadStringAsync(uri, userState);
}
[RC0]
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);
}
Internal이 된 생성자들
요약
다음 오브젝트들의 생성자가 internal이 되어 더 이상 생성할 수 없음.
- SizeChangedEventArgs
- TextChangedEventArgs
- DownloadProgressEventArgs
- ExceptionRoutedEventArgs
- KeyEventArgs
- MouseButtonEventArgs
- MouseEventArgs
- StartupEventArgs
- Expression
- GeneralTransform
- Geometry
- ImageSource
- PathSegment
- SetterBase
- Transform
- BindingExpressionBase
- InputMethod
System.Xml 예외 타입 변경.
요약
다음의 메서드/생성자 내에서 더 이상 null체크를 하지 않음. 그 때문에 null 인자는 NullReferenceException 예외를 발생 시킴. 이 전에는 ArgumentNullException을 발생했었음. 기능의 차이는 없고 단지 타입의 변화만 있음.
- 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
접근가능한 생성자가 없는 클래스를 XAML에서 생성할 수 없음.
요약
이 클래스들은 더 이상 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
- IsEndabledChanged
- EventARgsTypeProxy
- anagedObjectReference
- AutomationPropertiesEnum
- DependencyPropertyProxy
실버라이트 2에서 AG_E_UNKNOWN_ERROR 얻기.
요약
이전 버전의 실버라이트에서 미디어 파일이 사용불가능하여 실패했을 때, MediaFailed 이벤트가 발생하였지만 MediaFailed 이벤트가 개발자에게의해 처리되지 않으면 엔드 유저는 실패한 것을 볼 수 없었음. 이제는 MediaFailed 이벤트가 처리가 되지 않았을 때, 에러가 plug-in의 기본 OnError 핸들러까지 버블되고 AG_E_UNKNOWN_ERROR가 사용자에게 표시됨.
수정 요구 사항
MediaElement의 MediaFailed 이벤트 핸들러로 적절한 에러 처리를 할 것.
플랫폼은 리소스인 generic.xaml을 themes/generic.xaml에서 찾음.
수정 요구 사항
generic.xaml을 themes 폴더로 이동할 것.
HTTP Polling Duplex OM 변경 사항 및 리엔지리어링.
적용 대상 : Duplex 채널에서 HTTP Polling을 사용하는 모든 사람.
요약
- 서버사이드의 PollTimeout 세팅(PollingDuplexHttpBinding 과 PollingDuplexBindingElement)가 ServerPollTimeout으로 이름 변경 됨.
- PollingDuplexBindingElement(클라이언트 사이드)의 PollTimeout이 ClientPollTimeout으로 이름이 바뀜.
- PollingDuplexHttpBinding(클라이언트 사이드)의 PollingTimeout 세팅이 제거됨. 대부분의 시나리오에서 변경할 필요가 없음. 만약 필요하다면 PollingDuplexBindingElement의 ClientPollTimeout을 통해 가능.
- 실버라이트가 아닌(서버 사이드) 폴링 듀플렉스 어셈블리로부터 클라이언트 사이드 지원이 제거됨(예를 들어 BuildChannelFactory가 NotSupportedException을 띄움). RTM에서 폴링 듀플렉스를 위한 클라이언트 사이드는 반드시 실버라이트이어야 함(그리고 서버 사이드는 반드시 정규 .NET 프레임워크이어야 함 이 제한은 이미 베타2때 적용됨).
- 듀플렉스 채널을 위한 기본 타임아웃이 변경됨. 대부분의 일반적인 시나리오에서 새로운 out-of-the-box 기본이 적당하고 그것들을 바꿀 필요가 없어짐.
- 폴링 요청 에러 (404)가 듀플렉스 채널이 실패하여 발생함.
- 듀플렉스 스택에 의해 무시되었던 다양한 유효하지 않은 메시지가 이제는 거부됨.
- SOAP 콜 도중 발생한 모든 HTTP 에러(404,500)도 ProtocolException 대신 CommunicationException으로 발생.
IXcpControl COM 인터페이스를 호스팅의 브레이킹 체인지.
적용 대상 : COM API를 사용하여 네이티브하게 실버라이트 2 애플리케이션을 호스팅 하는 애플리케이션.
요약
다음의 스플래시 스크린 관련 속성이 추가된 IXcpControl 인터페이스가 새 IXcpControl2 인터페이스로 이동 함.
- get_OnSourceDownloadComplete
- get_OnSourceDownloadProgressChanged
- get_SplashScreenSource
- Put_OnSourceDownloadComplete
- put_OnSourceDownloadProgressChanged
- put_SplashScreenSource
추가로 LoadRuntime 함수또한 IXcpControl2로 이동함.
Content-Type은 크로스 도메인 요청시 기본으로 허용됨.
요약
지원되는 크로스 도메인 정책 파일(crossdomain.xml, clientaccesspolicy.xml)은 더 이상 명시적인 Content-Type 요청 헤더를 필요로 하지 않음. 그러나 명시적인 Content-Type 지정도 역시 허용됨.
[Beta 2]
<allow-from http-request-headers="Content-Type, SOAPAction">
[RC0]
<allow-from http-request-headers="SOAPAction">
두 개의 딜리게이트 오브젝트가 합쳐졌을 때 딜리게이트 타입 체크가 강제 됨.
적용 대상 : MulticastDelegate.CombineImpl을 직접 호출하는 Delegate.Combine에서 딜리게이트 타입 채크를 통과하는 코드.
수정 요청 사항
두 딜리게이트 오브젝트를 합치려면 반드시 딜리게이트 타입이 정확히 같아야 함.
기타 자잘한 API 변경 사항
- UIElement.HitTest 메서드가 VisualTreeHelper 클래스로 옮겨갔고 VisualTreeHelper.FindElementsInHostCoordinates로 변경됨.
- DependencyPropertyChangedEventHandler 딜리게이트 타입이 System.Windows.Controls에서 System.Windows 네임스페이스로 이동.
- UserControl, HyperlinkButton, ScrollViewer 및 ListBox를 제외한 모든 Control에서 파생된 클래스가 IsTabStop을 기본으로 true로 세팅함.
- WebHeaderCollection.Keys 속성이 AllKeys 속성으로 대체 됨.
- WebHeaderCollection.Headers 속성이 Keys로 이름이 변경됨.
- WebRequest.RegisterPrefix()이 실패했을 때 예외를 던지지 않고 false를 반환.
- WebResponse.Dispose(bool explicitDisposing)이 제거됨.
다음의 속성이 읽기 전용으로 변경됨.
- Deployment.PartProperty
- Deployment.EntryPointAssemblyProperty
- Deployment.EntryPointTypeProperty
- Deployment.RuntimeVersionProperty
- Deployment.ExternalCallersFromCrossDomainProperty
- Thumb.IsDragging
- Slider.IsFocused
- ButtonBase.IsFocused
- ButtonBase.IsMouseOver
- ButtonBase.IsPressed
다음 중 별도의 설명 없는 속성이나 메서드가 internal 혹은 private로 변경됨.
- ToolTipService.GetToolTip
- IRawElementProviderSimple이 sealed되고 private 기본생성자로 변경됨
- Setter.PropertyProperty ; DependencyProperty 대신 CLR 속성을 사용할 것.
- Slider.UpdateTrackLayout()
- Slider.OnOrientationChanged()
- Slider.OnIsFocusChanged(DependencyPropertyChangedEventArgs e)
- ComboBox.get_IsSelectionActive()
- ComboBox.ScrollIntoView(Int32 index)
- ComboBox.get_SelectionBoxItemTemplate()이 이제 System.Windows.DataTemplate을 반환
- PasswordBox.SelectionChanged
- MouseEventArgs.Handled가 MouseButtonEventArgs로 이동.
- RenderTargetBitmap가 HostingRenderTargetBitmap으로 이름이 바뀌고 System.Windows.Media.Imaging에서 System.Windows.Interop으로 이동됨.
- AutomationPeer 생성자가 이제 protected임.
- TriggerActionCollection.Item이 이제 System.Windows.Media.Animation.BeginStoryboard 대신 System.Windows.TriggerAction을 취함.
- TriggerCollection.Item이 이제 System.Windows.EventTrigger 대신 System.Windows.TriggerBase를 취함.
- RoutedEventArgs.Source가 OriginalSource로 이름이 바뀌고 읽기 전용으로 변경됨.
- ITableItemProvider와 ITableProvider가 이제 IGridItemProvider와 IGridProvider에서 파생됨.
- KeyboardNavigation 클래스가 이제 internal.
다음 중 별도의 설명이 없는 클래스의 생성자나 속성이 internal로 변경됨.
- ColumnDefinitionCollection 클래스
- InlineCollection 클래스
- ItemCollection 클래스
- RowDefinitionCollection 클래스
- UIElementCollection 클래스
- TriggerCollection 클래스
- ListBox의 ListBoxItem._itemsControl
- Ink.Stroke 생성자가 ctor(System.Windows.Input.StylusPointCollection)으로 변경됨.
- CanConvertFrom(Type sourceType)이 CanConvertFrom(ITypeDescriptorContext context, Type sourceType)으로 변경됨.
- CanConvertTo(Type destinationType)이 CanConvertTo(ITypeDescriptorContext context, Type destinationType)으로 변경됨.
- ConvertFrom(object value)이 ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)으로 변경됨.
- ConvertFromString(string text)이 이제 ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, object value)으로 변경됨.
- ConvertTo(object value, Type destinationType)이 ConvertTo(ITypeDescriptorContext context, CultureInfo culture, object value, Type destinationType)으로 변경됨.
- ItemCollection 생성자가 더 이상 사용가능하지 않기 때문에 ItemCollection을 직접 생성하려는 어떤 코드도 컴파일 되지 않음. 이 클래스는 반드시 ItemControl에서 생성되어야 함.
- Control.OnIsEnabledChanged가 제거됨. 이제 IsEnabledChanged를 사용할 것.
- DownloadProgressEventHandler가 제거됨.
다음 컨버터가 제거됨.
- TextDecorationCollectionConverter
- FontStretchConverter
- FontStyleConverter
- FontWeightConverter
- FontFamilyConverter
