SDKの導入
第1回の最後にSilverlightの開発にはSilverlight.
まずは,
このSDKはSilverlight 1.
ダウンロードが完了したら,
SDKの中にはドキュメントやクイックスタート,
Silverlight.jsを使って表示する
前回の文字を表示するサンプルを,
以下が前回のサンプルのソースコードです。ファイル名はindex.
<html>
<head>
<title>Hello Silverlight</title>
<script type="text/xaml" id="xaml">
<?xml version="1.0"?>
<Canvas xmlns="http://schemas.microsoft.com/client/2007">
<TextBlock Text="Hello World" FontSize="25" />
</Canvas>
</script>
</head>
<body>
<object type="application/x-silverlight" width="200" height="200">
<param name="background" value="#FF0000" />
<param name="source" value="#xaml" />
</object>
</body>
</html>
まずは,
<script type="text/javascript" src="Silverlight.js"></script>
次に,
<body>
<div id="agContainer"></div>
<script type="text/javascript">
Silverlight.createObjectEx({
source : "#xaml",
parentElement : document.getElementById("agContainer"),
id : "agControl",
properties : {
version : "1.0",
width : "200px",
height : "200px",
background : "#FF0000"
},
events : {
onLoad : null,
onError : null
}
});
</script>
</body>
では,
Silverlight.