Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/silverlight/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Silverlight 从webclient读取xap文件_Silverlight_Webclient_Xap - Fatal编程技术网

Silverlight 从webclient读取xap文件

Silverlight 从webclient读取xap文件,silverlight,webclient,xap,Silverlight,Webclient,Xap,我已在服务器上托管了silverlight服务。我已经在本地计算机上创建了一个客户端应用程序,引用了服务器上的silverlight服务。一切都很顺利 现在,我将xap文件复制到另一个silverlight应用程序中,并尝试使用以下代码读取xap StreamResourceInfo _streamResourceInfo = new StreamResourceInfo(e.Result, null); StreamResourceInfo _streamResour

我已在服务器上托管了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

我们将非常感谢您的帮助。


但是。。。如果您喜欢动态XAP加载,请帮自己一个忙,看看它是一个MVVM框架,但这并不意味着您必须使用ViewModels。

谢谢TriggerPin,很抱歉回复太晚。我一定会调查的。