I have the below definition for a DrawingBrush. It is an exmaple I found online that draws an arrow:
<DrawingBrush x:Key="arrow" Stretch="Uniform">
<DrawingBrush.Drawing>
<DrawingGroup>
<DrawingGroup.Children>
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M 358.447,332.449L 358.447,319.664L 380.875,319.664L 380.798,309.408L 407.698,326.505L 381.068,343.628L 380.982,332.45L 358.447,332.449 Z "/>
</DrawingGroup.Children>
</DrawingGroup>
</DrawingBrush.Drawing>
</DrawingBrush>
Now, I created a rectangle on my Canvas and set the rectangle's Fill property to the above DrawingBrush:
<Rectangle Fill="{DynamicResource arrow}" Stroke="#FF000000" Width="Auto" Height="Auto" Canvas.Top="339.815" Canvas.Left="112.037" x:Name="arrowRectangle"/>
With the rectangle's Width and Height set to "Auto", I expected the rectangle to resize to automatically display the arrow that is drawn. However, it seems that I need to explicitly set a Width/Height in order to see anything. If I leave the Width/Height as Auto, the rectangle is displayed as a single point, as if Width = Height = 0.
It seems that I am misunderstanding how the DrawingBrush works. I am just looking for a way to display an arrow. Would I have to use an Image instead of a DrawingBrush? I looked for a DrawingBrush first because I thought for such a simple thing as an arrow it would work fine.
Thanks.