如何覆盖 BorderBrush?
我有一个文本框的样式,我想在应用程序层覆盖这种样式的 BorderBrush。
我尝试过:d:LayoutOverrides="BorderBrush"。但这行不通。
我想要相同的样式,但使用红色的 BorderBrush。
请问我该怎么做?
谢谢。
I have a style to a textbox, and I want in the application layer override de BorderBrush of this style.
I tried: d:LayoutOverrides="BorderBrush". But this doesn't work.
I want the same style, but with a red BorderBrush.
How can I do this please?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如您提到的在标签中混合:您可以右键单击文本框搜索模板并从现有模板中创建新模板(编辑副本)。这将提取文本框的完整定义,您可以在那里更改您想要的所有内容。
以下是分步说明的所有内容:创建或编辑控件模板
as you mentioned Blend in your tags: you can right-click a textbox search templates and create new ones from the existing (Edit a Copy). This will extract the complete definition of the textbox and you can change everything you want there.
Here is everything explained step-by-step: Create or edit a control template
将您的样式基于旧的样式并更改边框画笔
,或者如果它是您想要覆盖的默认样式,请使用
Base your style on your old one and change the Border brush
or if it's the default style you want to override use