1
我在服務器上託管了我的silverlight服務。我在本地機器上創建了一個引用服務器上的silverlight服務的客戶端應用程序。一切編譯和工作正常。從webclient中讀取xap文件
現在我將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 Framework添加到我的應用程序中。
我用導航框架修改了主頁面。在我的主頁上,我有
<navigation:Frame x:Name="ContentFrame" Source="/Views/abc.xaml" Grid.Row="1" >
當我將修改的xap複製到其他應用程序。它抱怨在位置/Views/abc.xaml找不到xaml。
任何幫助將不勝感激。
謝謝TriggerPin,對不起,延遲迴復。肯定會研究它。 – 2012-08-06 17:12:59