R – How bind BorderThickness in template

expression-blendsilverlight

I'm trying make a simple control, with a some path in it. And binding Path's Fill, Stroke and StrokeThickness properties to template's Background, BorderBrush and BorderThickness.Left.

<Path x:Name="CorePart"
   Fill="{TemplateBinding Background}"
   Stroke="{TemplateBinding BorderBrush}"
   StrokeThickness="{TemplateBinding BorderThickness.Left} 
..."

But one problem: StrokeThickness do not want to binding. Silverlight report: "The name BorderThickness does not exist in the namespace http://schemas.microsoft.com/client/2007"

How to solve this problem?

Best Answer

Does your control have a BorderThickness dependency property? I don't think you can bind to a property of a property. I'd add a LeftBorderThickness dependnecy property to your control and the you could bind to that.

Related Topic