1
我能夠通過爲源參數提供正確的值來將silverlight xap文件集成到網站頁面中。喜歡的東西:如何將siilverlight與網頁集成
<object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="ClientBin/Demo3.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="white" />
<param name="minRuntimeVersion" value="4.0.50826.0" />
<param name="uiculture" value="<%= System.Threading.Thread.CurrentThread.CurrentUICulture %>" />
<param name="culture" value="<%= System.Threading.Thread.CurrentThread.CurrentCulture %>" />
<param name="autoUpgrade" value="true" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50826.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
</a>
</object>
但是,問題是我的Silverlight項目有,我想在不同的網頁,在網站分別顯示多個頁面。
查詢:如何修改源參數標籤以加載特定的xaml頁面?
如果這不可能比如何實現這個scenerio?
我是新來的Silverlight。你能指定我可以在哪寫Application_Startup事件嗎?另外,如果可能的話,你可以寫2行代碼來使用initParams來渲染一個特定的xaml文件。 – iMatoria 2011-06-13 09:57:07
@iMatoria:http://msdn.microsoft.com/en-us/library/system.windows.application.startup(v=vs.95).aspx'Startup'處理程序 – Snowbear 2011-06-13 09:59:08
它的工作。我在param標籤中使用了initParams。在App.xaml.c的Application_Startup事件中抓取它。並且能夠改變這個.RootLayout。但是,我正在使用只有1個xaml文件使用子窗口概念的商業應用程序。我怎樣才能將我從initParams獲得的值傳遞給mainPage.xaml。我嘗試在MainPage中創建一個屬性,並將其設置在Application_Startup中,並將相同的對象分配給RootVisual。但是,不工作。無論如何,我正在標記你的答案是正確的。 – iMatoria 2011-06-13 10:54:58