问题
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?
回答1:
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.
来源:https://stackoverflow.com/questions/1935416/how-bind-borderthickness-in-template