[IronPython] WPF Window vs. Application

Lukáš Duběda loocas at duber.cz
Tue May 4 18:27:50 CEST 2010


Hi there everybody.

I have yet another question.

This time, since I'm trying to strictly use WPF for my GUI
etc... and what I do here is I host IronPython within another
application that calls it and IPy serves the GUI and
program logic, I bumped into a problem when calling the

Application().Run(LoadedXaml)

The problem seems to be that the app runs in its own thread
separately from the host app and thus doesn't communicate
with the host app, until I close the Application (then
it performs the last task I wanted it to).

So, I was thinking, since I already have most of the gory
Application stuff already up and running, courtesy of the
host app, is there a way to actually only use WPF to
display the GUI and have the program logic taken care of by
IPy? Such as WinForms provides using the Window.Show()
method.

A friend of mine suggested if I could change the Data Type
of the XamlReader.Load... object to a Window object. I don't
know C#, but he suggested this:

Window myWindow;
object result = XamlReader.Load( source );
myWindow = (Window)result;
myWindow.Show();

Is this somehow achieveable via IPy scripting or directly in
the Xaml? Or somehow else?

Thank you very much in advance, cheers,

Lukáš Duběda
Director
[T] +420 602 444 164

duber studio(tm)
[M] info at duber.cz
[W] http://www.duber.cz

[A] R.A.Dvorského 601, Praha 10
[A] 10900, Czech Republic, Europe



More information about the Ironpython-users mailing list