Found an F# example here.
Made a Boo example based on it. The source code:
namespace Hello
import System
import System.Windows
import System.Windows.Controls
class MyPage(UserControl):
def constructor():
canvas = Canvas()
textblock = TextBlock()
textblock.FontSize = 24
textblock.Text = "Hello!"
canvas.Children.Add(textblock)
self.Content = canvas
class MyApp(Application):
def constructor():
Startup += onStartup
def onStartup(sender, e):
self.RootVisual = MyPage()
Built with:
booc -nostdlib -target:library -lib:"C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Reference Assemblies","C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Libraries\Client" -r:System.Windows.dll -r:System.Windows.Controls.dll Hello.boo
The AppManifest.xaml:
<Deployment xmlns="http://schemas.microsoft.com/client/2007/deployment"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
EntryPointAssembly="Hello"
EntryPointType="Hello.MyApp" RuntimeVersion="2.0.31005.0">
<Deployment.Parts>
<AssemblyPart x:Name="Hello" Source="Hello.dll" />
<AssemblyPart x:Name="Boo.Lang" Source="Boo.Lang.dll" />
</Deployment.Parts>
</Deployment>
Then made an ordinary .zip file containing AppManifest.xaml, Hello.dll and Boo.Lang.dll (one of Boo libraries from it's directory) and renamed it into hello.xap.
An html to look at it:
<html>
<head></head>
<body>
<object id="SilverlightPlugin" data="data:application/x-silverlight,"
type="application/x-silverlight-2" width="450" height="540">
<param name="source" value="hello.xap"/>
<a href="http://go.microsoft.com/fwlink/?LinkID=124807" style="text-decoration: none;">
<img src="http://go.microsoft.com/fwlink/?LinkId=108181"
alt="Get Microsoft Silverlight" style="border-style: none"/>
</a>
</object>
</body>
</html>
The resulting hello.xap is 43 KB, which is much better than 1.5 MB that I got with IronPython and DLR.