<p>I've written a WPF UserControl, and want to add one or more of it to my Window at runtime when I click a button. How can I do that?</p>

<p>Edit: Further specification
I want to add the usercontrols to a Canvas, and put in a absolute position. The canvas is a drawing of the floors in my house, and each usercontrol has properties to indicate where in the house it is positioned. So I want all the controls to be positioned in the correct position on the canvas.</p>

<p>I'm thinking something like this</p>

<pre><code>var light = new LightUserControl(2);
HouseCanvas.Children.Add(light); // this should be positioned in a specific place
</code></pre>

Add a StackPanel to the window and on each button click,
```
```
_stackPanel.Children.Add(new YourControl());
```
```
You can do this in many ways.