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.
我正在尝试在 C# 代码中重现具有两个渐变背景的 Visual Studio 样式工具栏。我可以看到如何在 XAML 中执行此操作,但是如何深入到对象以在我的 C# 代码中更改其“MainPanelBorder”边框的背景?
谢谢
您需要使用
myToolbar.Template.FindName("MainPanelBorder", myToolbar) as Panel //Or whatever the type of the item is in the template.