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.
我想将停靠面板控件加载到 wpf 窗口。停靠面板控件位于资源字典文件中,并且已合并到我要使用它的窗口中。我想要可以在按钮单击事件时动态将此停靠面板添加到窗口上现有的停靠面板主机控件的 c# 代码。请通过提供 c# 代码实现来帮助我
问候
您可以从以下资源中获取 DockPanel:
var dockPanel = FindResource("DockPanelKey") as DockPanel;
稍后添加此行以将 dockPanel 插入到例如网格中:
m_Grid.Children.Add(dockPanel);