2
我需要能夠加載HTML頁面與Silverlight模塊呈現基於頁面訪問的內容。例如,如果打開頁面的請求來自Page1.html,則內容將顯示Content.1。我試圖去處理它,但需要更多的信息。任何幫助,高度讚賞:Silverlight深層鏈接不使用頁面和框架?
這裏是我的代碼: HTML:分配新PARAM:
<param name="inputParams" value="Page1.html" />
它可以是一個不同的URL字符串。
Silverlight的代碼在App.xaml.cs
private void Application_Startup(object sender, StartupEventArgs e)
{
this.RootVisual = new MainPage();
if (e.InitParams != null)
{
string ValueParam = e.InitParams["value"];
}
}
MainPage.xaml.cs中
public MainPage()
{
InitializeComponent();
this.Loaded += new RoutedEventHandler(MainPage_Loaded);
}
void MainPage_Loaded(object sender, RoutedEventArgs e)
{
if (ValueParam = ?)
{
contentIndex =1;
}
}
非常感謝您的信息。我會嘗試。 – vladc77