Silverlight: How can I make a dash dot dot border using brushes

I would like to make a brush with a style of "dash dot dot" in silverlight. I cannot use Rectangle because I actually want to accomplish a "dash dot dot" border around a Path element (not rectangular graphic). Is there a way to do this?

Thanks, Roman.

Answers


It sounds like you just need the StrokeDashArray property of the Path. For example, StrokeDashArray="3 1 1 1 1 1" will give a dash dot dot pattern.

Translated to english it says:

Dash of 3 units,
gap  of 1 unit,
dash of 1 unit,
gap  of 1 unit, 
dash of 1 unit,
gap  of 1 unit.

I say units, because, per MSDN: "Each Double in the collection specifies the length of a dash or gap relative to the Thickness of the pen.".

A full path markup sample,

<Path Data="M120,141 C344,128 314,1 397,145 C480,289 619,392.00076 418,369.00067 C217,346.00061 131.99998,314.00018 134.99998,243.00008 C137.99998,171.99995 120,141 120,141 z" Fill="#FFF4F4F5" Margin="119.5,76.374,117.918,107.283" Stretch="Fill" Stroke="Black" UseLayoutRounding="False" StrokeDashArray="3 1 1 1 1 1"/>

MSDN link: http://msdn.microsoft.com/en-us/library/system.windows.shapes.shape.strokedasharray.aspx


Need Your Help

Return nested serializer in serializer method field

django serialization django-rest-framework

I have a method field called followers. I get the list of followers in a SerializerMethodField :

How to find and show files in one command?

linux bash

I have to find all files (in ~/), which weren't moderated more than 14 days and show content of files, which ends on *.txt. I have tried to do something like this: