[IronPython] Using Silverlight Controls from IronPython (Uhmm... it doesn't look like you can)

Michael Foord fuzzyman at voidspace.org.uk
Wed Sep 5 23:23:23 CEST 2007

Hello all,

I'm having an issue using Silverlight controls (compiled assemblies) 
from C#. Something is going wrong with member name resolution and XAML 

I've had this with controls I've created myself, but it also happens 
with the sample controls project in the Silverlight 1.1 Refresh SDK.

If you try adding a reference to the 'Button' class and using it from 
IronPython, then Silverlight bombs out with the following message:

Exception Details: System.MissingMethodException: Event handler 
'PulseStoryboardCompleted' is not defined

PulseStoryBoardCompleted is setup in XAML (embedded as a resource in the 
assembly). This exception kills Silverlight - it cannot be caught at the 
IronPython level.

To illustrate this, try the following IronPython code:

import clr
clr.AddReference("Silverlight.Samples.Controls, Version=, 
Culture=neutral, PublicKeyToken=null")
from Silverlight.Samples.Controls import Button

b = Button()

Any suggestions as to a way round this ?

All the best,

Michael Foord

More information about the Ironpython-users mailing list