1
我有以下頁面引用我的silverlight應用程序文件。這工作正常。我想知道是否可以指向.xap文件中的特定xaml文件?如何從xap文件加載特定的xaml文件?
也許像/ClientBin/test.xap?File=SomeXaml.xaml
?
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="test.Web.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript" src="Silverlight.js"></script>
</head>
<body>
<form id="form1" runat="server">
<div id="silverlightControlHost">
<script type="text/javascript">
Silverlight.createObject(
"ClientBin/test.xap", // source
document.getElementById('silverlightControlHost'), // parent element
"someId", // id for generated object element
{
width: "600px",
height: "600px",
background: "blue",
version: "4.0.60310.0",
autoUpgrade: "true"
},
{ onError: null }, null
);
</script>
</div>
</form>
</body>
</html>
謝謝!