Reputation: 1100
I created an user control for my Windows 8 metro style app, I know how to add it to the page with XAML, but how to add it dynamically with C# code?
Upvotes: 1
Views: 2295
Reputation: 14994
I haven't checked it, but it should be the same as for WPF:
MyUserControl myControl = new MyUserControl();
myPanel.Children.Add(myControl);
Upvotes: 5