Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想更改列表框的样式,因为在 WinRT 中,列表框在选择项目后具有浅色背景。但我希望列表框在选择一个项目后仍然具有透明背景。我怎样才能做到这一点?我不想更改 ListBoxItem,因为那里一切正常。
右键单击列表框,选择编辑模板 -> 编辑副本。
导航到 Border 里面<ControlTemplate TargetType="ListBox">。选择背景属性,单击高级选项方块,选择重置。您现在可以将背景设置为您想要的任何内容。
<ControlTemplate TargetType="ListBox">