Databinding and transforms RRS feed

  • Question

  • I'm sure this must have been covered already but haven't been able to find it...

    In Silverlight 2 beta 2, if I have an element with a transform like this:

        <Rectangle Width="20" Height="{Binding RectHeight}" Fill="Orange" Margin="50">
            <RotateTransform CenterX="0" CenterY="0" Angle="45" />

    it works fine -- the rectangle height gets databound, and the transform is applied.

    If I now databind the RotateTransform.Angle property:

            <RotateTransform CenterX="0" CenterY="0" Angle="{Binding RotateAmount}" />

    Silverlight fails with the error AG_E_PARSER_BAD_PROPERTY_VALUE.

    RotateTransform.Angle is a dependency property, so I was expecting that it should be bindable.  Am I doing something wrong?  Or are Silverlight dependency properties not always bindable and if so how do we know which are and which aren't?


    Tuesday, June 10, 2008 8:43 PM


  • Hey,

    Unfortunately, currently you can use databinding only when the target is a FrameworkElement.


    Wednesday, June 11, 2008 1:31 PM