ASP.NET教程:Silverlight使用内联XAML
来源:学生作业帮助网 编辑:作业帮 时间:2024/05/15 12:20:54 ASP.NET
在asp等中使用内嵌是XAML,同使用javescript几乎一样.
1)需要在Script/script.
2)Type属性是“text/xaml
3)XML 文档类型声明 ?xml version=1.0?
实例:
html
head
titleDisplay Date/title
! Define Loaded event handler for TextBlock.
script type=text/javascript
function setDate(sender, eventArgs)
{
sender.text = Date();
}
/script
/head
body bgcolor=Teal
! Define XAML content.
script type=text/xaml id=xamlContent?xml version=1.0?
Canvas
xmlns=http://schemas.microsoft/client/2007
Background=Wheat
TextBlock
Canvas.Left=20
FontSize=24
Loaded=setDate /
/Canvas
/script
div id=silverlightControlHost
object type=application/x-silverlight width=100% height=100% id=slc
param name=source value=#xamlContent/
param name=onload value=onLoaded /
param name=iswindowless value=true /
/object
iframe style=‘visibility:hidden;height:0;width:0;border:0px‘/iframe
/div
/body
/html
ASP.NET