本文介绍了Silverlight:绑定矩形的模板的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试模板绑定矩形的StrokeThickness的时间很长。

I'm having a heck of a time trying to template bind the StrokeThickness of a rectangle.

我的目标是允许自定义控件的用户设置

My goal is to allow a user of my custom control to set a property called SelectedBorderThickness which will, in fact, set the StrokeThickness of a rectangle.

我以为我理解模板,但我想我真的不知道。

I thought I understood templating but I guess I really don't.

如果我这样做:

<Rectangle x:Name="myRect" Height="100" Width="100" Stroke="Black" SelectedBorderThickness="5" />

有人可以告诉我如何编写样式元素以使其工作吗?

Can someone please show me how to write the Style elements to get this to work?

推荐答案


















这篇关于Silverlight:绑定矩形的模板的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 00:32