Silverlight doesn't support ICustomTypeDescriptor, which is how IronPython objects interact with data binding on the desktop. For a workaround, see http://devhawk.net/2009/04/24/clrtype+Metaclasses+Demo+Silverlight+Databinding.aspx
I believe Silverlight 4 supports IDynamicMetaObjectProvider for data binding, so the need for emitting your own CLR type goes away with that release. On Wed, Dec 30, 2009 at 2:07 AM, Shyam Gopale <[email protected]> wrote: > Hi, > > I am trying out some sample Silverlight code with IronPython and I found > that the data binding does not work properly. > The app.xaml is as below: > > <UserControl x:Class="System.Windows.Controls.UserControl" > xmlns="http://schemas.microsoft.com/client/2007" > xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> > <Grid x:Name="layout_root" Background="White"> > <StackPanel> > <Slider x:Name="sliderFontSize" Margin="3" Minimum="1" Maximum="40" > Value="10" /> > <TextBlock x:Name="lblMessage" Text="Hello World" Margin="5" > FontSize="{Binding ElementName=sliderFontSize, > Path=Value,Mode=TwoWay}"></TextBlock> > <Button x:Name="cmdClickMe" Content="Click Me!" > Margin="5"></Button> > </StackPanel> > </Grid> > </UserControl> > This XAML when used in a C# Silverlight app reflects the correct data > binding behaviour but does not work when used with IronPython and Chiron. > Mainly the font size of the text block is not updated. > Does anyone have any idea about this? > > Thanks, > Shyam > > _______________________________________________ > Users mailing list > [email protected] > http://lists.ironpython.com/listinfo.cgi/users-ironpython.com > >
_______________________________________________ Users mailing list [email protected] http://lists.ironpython.com/listinfo.cgi/users-ironpython.com
