[IronPython] Extending .NET Classes

Dan Eloff dan.eloff at gmail.com
Wed Apr 16 14:47:18 CEST 2008


I think I've already guessed the answer to this one, but I want to
hear it from someone else just to be thorough.

There's no way to subclass, say Button, as SuperButton and then use
<ipy:SuperButton> in XAML. Maybe if you involve some C#?

Certainly you could use SuperButton programmatically and add it to the
xaml tree yourself.

Currently I've been able to get by in many cases simply by using
composition. It looks a little strange to me, but I can use Button in
the xaml, and
have SuperButton(xaml.myButton) somewhere in the code. There are some
things that are difficult to do that way, but so far it works for me.

What do you folks do?

Thanks,
-Dan



More information about the Ironpython-users mailing list