我在服务器上托管了我的 silverlight 服务。我在本地机器上创建了一个客户端应用程序,引用了服务器上的 silverlight 服务。一切都编译并正常工作。
现在我将 xap 文件处理到另一个 silverlight 应用程序中,并尝试使用以下代码读取 xap。
StreamResourceInfo _streamResourceInfo = new StreamResourceInfo(e.Result, null);
StreamResourceInfo _streamResourceInfoDll = Application.GetResourceStream(_streamResourceInfo,
new Uri(string.Format("{0}.dll", abc), UriKind.Relative));
AssemblyPart _assemblyPart = new AssemblyPart();
Assembly _assembly = _assemblyPart.Load(_streamResourceInfoDll.Stream);
UserControl _userControl = _assembly.CreateInstance(string.Format("{0}.MainPage", abc)) as UserControl;
this.Main_Canvas.Children.Add(_userControl);
一切正常。现在我将导航框架添加到我的应用程序中。
我用导航框架修改了主页。在我的主页上,我有
<navigation:Frame x:Name="ContentFrame" Source="/Views/abc.xaml" Grid.Row="1" >
当我将修改后的 xap 复制到另一个应用程序时。它抱怨在 /Views/abc.xaml 位置找不到任何 xaml。
任何帮助将不胜感激。