2.0 不支持InitializeFromXaml(xaml) 方法了。
在写Application.LoadComponent(this, new Uri("MyControl.xaml", UriKind.Relative));
FrameworkElement fe = this.Content;
MyControl.xaml为 Embedded Resource
报错。Error 1 Cannot implicitly convert type 'System.Windows.UIElement' to 'System.Windows.FrameworkElement'. An explicit conversion exists (are you missing a cast?)
F:\SilverLight开发\silverlight英文视频\Creat 3D Image\SLCreate3DImageDemo\SLCreate3DImageDemo\CubeControl.xaml.cs 37 35 SLCreate3DImageDemo
因为this.Content是一个类型为UIElement的对象,应该写成
UIElement ue = this.Content;
当然你可以尝试着强制类型转换
FrameworkElement fe = (FrameworkElement)this.Content;