[IronPython] Loading XAML files

Gutfreund, Yechezkal ygutfreund at draper.com
Thu Jan 11 23:05:34 CET 2007


I am using Blend to create XAML files and testing out the design there.
Then but all my code is done via Python using the Tutorials "avalon.py"
module.
 
It works fine. Except for one annoying glitch.
 
true WPF Xaml files need to specify the class name:
 
<UserControl
 xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
 
xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=Windo
wsFormsIntegration"
 
xmlns:swf="clr-namespace:System.Windows.Forms;assembly=System.Windows.Fo
rms"
 x:Class="shell.WebWrapper"
 x:Name="webWrapper"
...
</UserControl>
 
But for some reason the LoadXAML() call chokes on this:
 
 

	>>> w.Content = LoadXaml("WebWrapper.xaml")
	'Class' attribute does not exist in XML namespace
'http://schemas.microsoft.com/winfx/2006/xaml' namespace. Line '6'
Position '2'.
	   at IronPython.Hosting.PythonEngine.ExecuteToConsole(String
text, EngineModule engineModule, IDictionary`2 locals)
	   at IronPython.Hosting.PythonEngine.ExecuteToConsole(String
text)
	   at IronPythonConsole.PythonCommandLine.DoOneInteractive()
	   at
IronPythonConsole.PythonCommandLine.<RunInteractiveLoop>b__6(Boolean&
continueInteractionArgument)
	   at
IronPythonConsole.PythonCommandLine.TryInteractiveAction(InteractiveActi
on interactiveAction, Boolean& continueInteraction)
	SystemError: 'Class' attribute does not exist in XML namespace
'http://schemas.microsoft.com/winfx/2006/xaml' namespace. Line '6'
Position '2'. 
	 
	Is there a fix. I really like the ability to have simple test
code and classes in the WPF project, but have the true implementation in
IronPython.
	 
	BTW, here is a wish list item. To be able to have direct support
of IronPython scripting in Blend, so that I can single step and debug
the scripts, and interactive try things out. They you would have a real
Flash killer.
	 
	
	Dr. Yechezkal Gutfreund
	<mailto:ygutfreund at draper.com> 
	 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20070111/38dae4a9/attachment.html>


More information about the Ironpython-users mailing list