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.
我为我的 Windows 8 Metro 风格应用程序创建了一个用户控件,我知道如何使用 XAML 将其添加到页面,但如何使用 C# 代码动态添加它?
我没有检查它,但它应该与WPF相同:
MyUserControl myControl = new MyUserControl(); myPanel.Children.Add(myControl);