Recent Posts
Recent Comments
Link
관리 메뉴

NaggingMachine

실버라이트 2.0 변경내용 본문

Visual Studio

실버라이트 2.0 변경내용

naggingmachine 2009. 5. 24. 14:24
출처: Port Silverlight 1.1 to Silverlight 2.0

1.1로 작성된 코드를 빌드하려니 오류가 발생하더군요. 그래서 찾아봣습니다.^^

  1. As I mentioned in my previous article, you need to edit your previous project file.
  2. Change HtmlTimer To System.Windows.Threading.DispatcherTimer
  3. HtmlPage.Navigate(link) To HtmlPage.Window.Navigate(new Uri(link))
  4. You can directly use Static function HtmlPage.Document.GetElementsByTagName to get DOM elements.
  5. You can directly use HtmlPage.Document.CreateElement("Div") to create DOM elements
  6. XamlReader requires xmlns unlike Silverlight 1.1. XamlReader.Load(“<Canvas/>”); ToXamlReader.Load("<Canvas xmlns="http://schemas.microsoft.com/client/2007"/>");
  7. FontWeights enumeration has been changed to a static class FontWeight.
  8. Change System.Windows.Media.Color.FromRgb(118, 118, 118) To System.Windows.Media.Color.FromARgb(255,118, 118, 118)
  9. this.MouseLeave += delegate(object sender, EventArgs e) To this.MouseLeave += delegate(object sender, MouseEventArgs e)
  10. this.MouseLeftButtonUp += delegate(object sender, MouseEventArgs e) To this.MouseLeftButtonUp += delegate(object sender, MouseButtonEventArgs e)
  11. In MouseEventHandlers, e.ctrl To ((Keyboard.Modifiers & ModifierKeys.Control) == ModifierKeys.Control)
  12. ActualWidth of Silverlight Control

    System.Windows.Interop.BrowserHost.ActualWidth; To

    System.Windows.Interop.SilverlightHost silverlightHost = new System.Windows.Interop.SilverlightHost();

    width = silverlightHost.Content.ActualWidth

  13. In Silverlight 2.0, Managed Downloader has been removed.So you’ll have to use WebClient.

For a complete list, visit http://msdn2.microsoft.com/en-us/library/cc189007(vs.95).aspx