Search code examples
silverlightblendregion

Silverlight custom shape region with settable background color


I want to have a region element on my silverlight window that I can set a foreground color to.

My questions are:

  1. Which tool should I use to draw a custom shape region (in my case in need it to be in a form of a raindrop)?
  2. How will I set a color to a shape whenever I have a XAML declaration for it?

Thank you.


Solution

  • I think you can accomplish this with Expression Design. :)

    I just drew something (well let's call it a raindrop lol) in Expression Design and exported it to Expression Blend as a path object,

    <Path Stretch="Fill" StrokeLineJoin="Round" Stroke="#FF000000" Fill="#FFFFFFFF" Data="F1 M 507.262,234.751C 537.262,324.251 561.008,330.866 561.008,364.002C 561.008,397.137 534.146,423.999 501.011,423.999C 467.876,423.999 441.014,397.137 441.014,364.002C 441.014,330.866 497.071,204.348 507.262,234.751 Z " HorizontalAlignment="Left" Margin="131.514,83.574,0,201.502" UseLayoutRounding="False" Width="120.994"/>
    

    You can change its background color by modifying its Fill property.

    I hope this helps. :)