[IronPython] using XAML in IronPython

Dino Viehland dinov at microsoft.com
Sat Jul 10 23:36:09 CEST 2010


It'll be 2.7 Alpha 1 by the end of this month.  I need to investigate a couple of failing tests in the 2.6.2 branch and then we'll need to kick off the final test pass and then that'll be ready to go too - it'll probably come out slightly after 2.7A1 simply due to machine resources for the test passes.

I'll keep quite on the tools side of things just not to jinx things :)

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Tristan Zajonc
Sent: Saturday, July 10, 2010 10:20 AM
To: Discussion of IronPython
Subject: Re: [IronPython] using XAML in IronPython

No need to say anything before official announcement if you don't want to, but for planning purposes:

- Are you planning on 2.7 by the end of this month, or just 2.6.2?
- Do you expect license issues to be resolved and code released for next IronPython Tools release?

I'm looking forward to both,
Tristan
On Fri, Jul 9, 2010 at 6:44 PM, Dino Viehland <dinov at microsoft.com<mailto:dinov at microsoft.com>> wrote:
It should be sometime this month.

From: users-bounces at lists.ironpython.com<mailto:users-bounces at lists.ironpython.com> [mailto:users-bounces at lists.ironpython.com<mailto:users-bounces at lists.ironpython.com>] On Behalf Of Andrew Evans
Sent: Friday, July 09, 2010 3:37 PM

To: Discussion of IronPython
Subject: Re: [IronPython] using XAML in IronPython

Sounds great when is the expected release date for that :D
On Fri, Jul 9, 2010 at 3:28 PM, Dino Viehland <dinov at microsoft.com<mailto:dinov at microsoft.com>> wrote:
The next release of Ipy Tools (and IronPython 2.7) will greatly simplify this.  You'll be able to call clr.LoadComponent and point at your XAML file and your Window subclass.  It'll then automatically add all of the x:Name (and Name'd) elements onto your Window subclass so you can just do "self.hello.Text" or whatever w/o having to pull the values from the instance using FindName or other methods.

From: users-bounces at lists.ironpython.com<mailto:users-bounces at lists.ironpython.com> [mailto:users-bounces at lists.ironpython.com<mailto:users-bounces at lists.ironpython.com>] On Behalf Of Andrew Evans
Sent: Friday, July 09, 2010 3:23 PM
To: Discussion of IronPython
Subject: Re: [IronPython] using XAML in IronPython

ahh yes that's right I was using the development environment you linked. Thanks for the insight into my issue makes sense now
On Fri, Jul 9, 2010 at 3:14 PM, Andrew Evans <evans.d.andrew at gmail.com<mailto:evans.d.andrew at gmail.com>> wrote:
Hello I am learning IronPython having come from a CPython background, I started learning C# to add more to my knowledge base for IronPython.

I have a few questions using XAML:

First if I build something using the xaml designer in IronPython Studio and give it a name x:name="somename" and want to reference it in a function def doSomething(s, e): how do I reference the item with the x:name value do I just type somename = changePropertyofControl? and how do I call the function?

XAML

<Window
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
       Title="Hello World" Height="300" Width="300">
       <Button x:Name="hello">Click Me</Button>
</Window>

Python Code is where I am confused

import clr
clr.AddReference('PresentationFramework')

from System.Windows.Markup import XamlReader
from System.Windows import Application
from System.IO import FileStream, FileMode

app = Application()

def doSomething(sender,event):
    hello.Content = "Try again"


app.Run(XamlReader.Load(FileStream('Hello_World.xaml', FileMode.Open)))

This I am sure is really simple... Coming from a Tk background its confusing for me.

Anyway ty

Cheers

Andrew


_______________________________________________
Users mailing list
Users at lists.ironpython.com<mailto:Users at lists.ironpython.com>
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


_______________________________________________
Users mailing list
Users at lists.ironpython.com<mailto:Users at lists.ironpython.com>
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20100710/3c87dbb6/attachment.html>


More information about the Ironpython-users mailing list