ContainerBinding for Attached Property

2 posts, 0 answers
  1. Kevin
    Kevin avatar
    30 posts
    Member since:
    Jul 2012

    Posted 12 Apr 2011 Link to this post

    I am trying to use a ContainerBinding to bind to the Canvas.Left and Canvas.Top attached properties.  Here is an example:

            <telerik:ItemsControl ItemsSource="{Binding Parts}"
                                <SolidColorBrush Color="White" />
                <!--setup container bindings... temp workaround for inability to do setter bindings in SL-->
                            <telerik:ContainerBindingCollection x:Name="ContainerBindings">
                                <telerik:ContainerBinding PropertyName="(Canvas.Left)"
                                                          Binding="{Binding X}" />
                                <telerik:ContainerBinding PropertyName="(Canvas.Top)"
                                                          Binding="{Binding Y}" />
                                <telerik:ContainerBinding PropertyName="Width"
                                                          Binding="{Binding Width}" />
                                <telerik:ContainerBinding PropertyName="Height"
                                                          Binding="{Binding Height}" />
                        <Grid Background="Orange"/>

    The Width and Height bindings in the ContainerBinding collection are working fine, but the Canvas.Left and Canvas.Top bindings are not working.  

    Can anyone tell me how to get this working?

  2. Valeri Hristov
    Valeri Hristov avatar
    2252 posts

    Posted 13 Apr 2011 Link to this post

    Hi Kevin,

    Unfortunately due to some limitations of Silverlight the container bindings do not work with attached properties. Fortunately in Silverlight 5 this problem does not exist, and actually you will not need container bindings at all :)

    Valeri Hristov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top