Silverlight - Binding ImageSource to Rectangle Fill

Posted by Matt.M on Stack Overflow See other posts from Stack Overflow or by Matt.M
Published on 2010-04-27T19:11:12Z Indexed on 2010/04/27 19:13 UTC
Read the original article Hit count: 622

Filed under:
|
|

Blend 4 is telling me this is invalid markup and its not telling me why:

<ImageBrush Stretch="Fill"  ImageSource="{Binding Avatar, Mode=OneWay}"/>

I'm pulling data from a Twitter feed, saving to an ImageSource, and then binding it to an ImageBrush(as seen below) to be used as the Fill for a Rectangle. Here is more context:

<Rectangle x:Name="Avatar" RadiusY="9" RadiusX="9" Width="45" Height="45"  VerticalAlignment="Center" HorizontalAlignment="Center" >
    <Rectangle.Fill>
       <ImageBrush Stretch="Fill"  ImageSource="{Binding Avatar, Mode=OneWay}"/>
    </Rectangle.Fill>
</Rectangle>

I'm using this inside of a Silverlight UserControl, which is used inside of a Silverlight Application. Any Ideas on what the problem could be?

© Stack Overflow or respective owner

Related posts about Silverlight

Related posts about binding