<div>hi Dino</div>
<div>Thanks for your reply.</div>
<div>But I try my sample (look attachment), It can&#39;t run! Is my code mistake ?</div>
<div>&nbsp;</div>
<div><strong>IronPython code:</strong></div>
<div>from System.Windows import Application<br>from System.Windows.Markup import XamlReader</div>
<div>class App:<br>&nbsp;&nbsp; def __init__(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Application.Current.RootVisual = XamlReader.Load(&quot;app.xaml&quot;)<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.scene = Application.Current.RootVisual.grid<br>&nbsp;&nbsp; def start(self):<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # TO DO: Replace this with your application start logic.<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; self.scene.message.Content = &quot;Welcome to Silverlight and IronPython!&quot;</div>
<div>App().start()<br></div>
<div><strong>XAML code:</strong></div>
<div>&lt;UserControl x:Class=&quot;System.Windows.Controls.UserControl&quot;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; xmlns=&quot;<a href="http://schemas.microsoft.com/client/2007">http://schemas.microsoft.com/client/2007</a>&quot; <br>xmlns:x=&quot;<a href="http://schemas.microsoft.com/winfx/2006/xaml">http://schemas.microsoft.com/winfx/2006/xaml</a>&quot;&gt;<br>
&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; &lt;Grid x:Name=&quot;grid&quot; Background=&quot;White&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &lt;TextBlock x:Name=&quot;message&quot; FontSize=&quot;30&quot; /&gt;<br>&nbsp;&nbsp;&nbsp; &lt;/Grid&gt;</div>
<div>&lt;/UserControl&gt;<br></div>
<div class="gmail_quote">On Fri, Mar 7, 2008 at 11:55 AM, Dino Viehland &lt;<a href="mailto:dinov@exchange.microsoft.com">dinov@exchange.microsoft.com</a>&gt; wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div lang="EN-US" vlink="purple" link="blue">
<div>
<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d">You'll need to download the Silverlight 2 SDK.&nbsp; After installing that you'll get all the necessary components installed into something like C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Libraries\Client.&nbsp; Also installed is an extremely useful tool called Chiron which you'll find somewhere around C:\Program Files\Microsoft SDKs\Silverlight\v2.0\Tools\Chiron.&nbsp; Chiron can take your .py file and produce a .xap which includes the IronPython &amp; DLR DLLs using the /zipdlr command line option.&nbsp; You can also use it to serve http requests and automatically serve up the .xap and let you just edit the files.</span></p>

<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d">&nbsp;</span></p>
<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d">So once you're ready to make your xap the directory you point at should contain a .py file (I'm not sure what the multi .py file experience is like, but w/ a single file the it doesn't seem the name matters).&nbsp;&nbsp;&nbsp; The simplest thing to put in there is:</span></p>

<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d">&nbsp;</span></p>
<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d">from System.Windows import Application</span></p>
<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d">from System.Windows.Markup import XamlReader</span></p>
<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d">&nbsp;</span></p>
<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d">Application.Current.RootVisual = XamlReader.Load("someXaml")</span></p>
<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d">&nbsp;</span></p>
<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d">You can see this from the Ruby perspective over at <a href="http://www.iunknown.com/2008/03/dynamic-silverl.html" target="_blank">http://www.iunknown.com/2008/03/dynamic-silverl.html</a></span></p>

<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d">&nbsp;</span></p>
<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d">There's various options on how to deploy the DLLs, and you can get into manifest files to deploy additional DLLs, but hopefully that'll get you started.</span></p>
<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d">&nbsp;</span></p>
<p><span style="FONT-SIZE: 11pt; COLOR: #1f497d">&nbsp;</span></p>
<div style="BORDER-RIGHT: medium none; PADDING-RIGHT: 0in; BORDER-TOP: #b5c4df 1pt solid; PADDING-LEFT: 0in; PADDING-BOTTOM: 0in; BORDER-LEFT: medium none; PADDING-TOP: 3pt; BORDER-BOTTOM: medium none">
<p><b><span style="FONT-SIZE: 10pt">From:</span></b><span style="FONT-SIZE: 10pt"> <a href="mailto:users-bounces@lists.ironpython.com" target="_blank">users-bounces@lists.ironpython.com</a> [mailto:<a href="mailto:users-bounces@lists.ironpython.com" target="_blank">users-bounces@lists.ironpython.com</a>] <b>On Behalf Of </b>Kevin Chu<br>
<b>Sent:</b> Thursday, March 06, 2008 7:39 PM<br><b>To:</b> Discussion of IronPython<br><b>Subject:</b> [IronPython] how to use IronPython in Silverlight 2</span></p></div>
<div class="Ih2E3d">
<p>&nbsp;</p>
<div>
<p>Silverlight 2 beta1 tools for VS2008 only create C# code file,</p></div>
<div>
<p>How to create a IronPython code file?<br clear="all"><br>-- <br>Once in a Redmoon </p></div></div></div></div><br>_______________________________________________<br>Users mailing list<br><a href="mailto:Users@lists.ironpython.com">Users@lists.ironpython.com</a><br>
<a href="http://lists.ironpython.com/listinfo.cgi/users-ironpython.com" target="_blank">http://lists.ironpython.com/listinfo.cgi/users-ironpython.com</a><br><br></blockquote></div><br><br clear="all"><br>-- <br>Once in a Redmoon