VS2010 data binding

Mar 17, 2012 at 2:11 PM


I'm starting to use IronPython + PTVS + VisualStudio2010 with WPF.

This a great tool, thank you to the developpers.

I'm still failing to use data binding in between xaml & py files.

Statements like Text="{Binding BindedText}" are accepted inside the definition of a TextBlock in the .xaml page.

but command like BindedText="coucou" in the .py page doesn't trigg anything.

On the opposite, the assignement self.TextBlock.Text= "coucou" in the .py page works fine to refresh the value of the displayed TextBlock.

Is data binding supposed to work ?

Is there anything specific to do to get it working (different then with other VS embeded langages) ?

Mar 19, 2012 at 4:47 PM

I don't think there's any 2-way data binding in that normal Python attributes or properties cannot signal when they have changed.  IronPython probably needs to grow something like a wpf.dataproperty attribute which can be instantiated on a class to enable 2-way data binding for properties.  Then IronPython's custom type descriptor support needs to recognize this and wire it up appropriately for WPF.  I'd suggest opening a feature request over on ironpython.codeplex.com.

Apr 4, 2012 at 8:17 PM


Thank you for this answer. I tried also to use "PropertyChangedEventHandler" & "PropertyChangedEventArgs"  to trigg a change in the wpf window but I haven't find how to activate the "INotifyPropertyChanged" and my only result is getting "Object is not callable" errors....