> I still need to package my app into a zip file and serve it locally (doesn't 
> work from the filesystem)

Michael, what do you exactly mean by this? You need your app to run out of 
browser? 

> It doesn't seem to me that embedded xaml is working

First of all, docs/spec issue: the current online bits only support 
application/xml+xaml, and the docs have application/xaml+xml. The release that 
will be online in a few days supports both. After correcting that you will get 
a SL control created on the page; here's the exact HTML (with a Text attribute 
added to the TextBlock to make it obvious that it worked):

<html>
  <head>
    <script type="text/javascript" 
src="http://gestalt.ironpython.net/dlr-latest.js";></script>
  </head>
  <body>
    <script type="application/xml+xaml" id="inlineXAML" width="200" height="75">
      <Canvas> <TextBlock Canvas.Left="20" FontSize="24" Text="hi" /> </Canvas> 
    </script>
  </body>
 <html>

Then, if you add the following Python script-tag after the XAML script tag, it 
will update the text:

    <script type="text/python" class="inlineXAML">
      from System.Windows.Application import Current as app
      app.RootVisual.Children[0].Text += " from python"
    </script>

Note the *class="inlineXAML"* attribute; if you did not include this, the code 
would run against a different Silverlight control than the one created by your 
*id="inlineXAML"* tag. In fact, it would run against a SL control that is 
essentially hidden, so app.RootVisual would be None. In short, giving a XAML 
script-tag an ID lets you pick the Python script-tags that will run against it 
by setting their class attribute to the same value.

I'll update the docs accordingly...

~Jimmy
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to