I can do that on Grid well with Grid.Children.Add(...)
But I can't figure out how can I add a control to UserControl programmatically.
In order to use the Children
property, your control has to implement the IPanel
interface. The easiest way to achieve that is to make Panel
a base class for your UserControl
.