<DockPanel Name="dcPanel"> <Button Name="TopRect" DockPanel.Dock="Top" Background="LightGreen" Height="50" Content="Top" Margin="30,50,0,0" /> </DockPanel> The code above stretch a button if I maximize the window. How can I add a Canvas inside the dockpanel, so when I maximize the window, all the canvas content will be stretched? thanks!