看起来与扩展器一模一样的标签
在 WPF 中,我想要一个扩展器,它显示一堆标签,这些标签的样式与默认扩展器完全相同;圆角,黑色边框,打开/关闭图像除外。
有人有这样的风格吗?
In WPF I'd like to have an expander that shows a stack of labels that have the exact style as the default expander; rounded corners, black border, except the open/close image.
Anyone got a style for that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我尝试从默认的 Expander 样式中提取样式,但我认为它可能有点不同,另请注意,默认情况下没有可见边框,因此除非更改相应的画笔或使用背景,否则您不会看到圆角边缘color:
如果您想自己尝试,这里是完整的默认样式,所有标题样式和触发器都是无关紧要的,因为它们用于您不希望在标签中出现的 ToggleButton:
I tried to extract a style from the default Expander style but i think it might be a bit different, also note that by default there is no visible border, so you will not see the rounded edges unless you change the respective brush or use a background colour:
Here is the complete default style if you want to try yourself, all the header styles and triggers are irrelevant since they are used for the ToggleButton which you do not want in a Label: