Canvas为容器控件,用于定位,在此容器下面的控件,都可以采用绝对定位的方式来进行定位。
<Canvas><Rectangle Canvas.ZIndex&#61;"3" Width&#61;"100" Height&#61;"100" Canvas.Top&#61;"100" Canvas.Left&#61;"100" Fill&#61;"blue"/><Rectangle Canvas.ZIndex&#61;"1" Width&#61;"100" Height&#61;"100" Canvas.Top&#61;"150" Canvas.Left&#61;"150" Fill&#61;"yellow"/><Rectangle Canvas.ZIndex&#61;"2" Width&#61;"100" Height&#61;"100" Canvas.Top&#61;"200" Canvas.Left&#61;"200" Fill&#61;"green"/><Rectangle Canvas.ZIndex&#61;"1" Width&#61;"100" Height&#61;"100" Canvas.Top&#61;"300" Canvas.Left&#61;"200" Fill&#61;"green"/><Rectangle Canvas.ZIndex&#61;"3" Width&#61;"100" Height&#61;"100" Canvas.Top&#61;"350" Canvas.Left&#61;"150" Fill&#61;"yellow"/><Rectangle Canvas.ZIndex&#61;"2" Width&#61;"100" Height&#61;"100" Canvas.Top&#61;"400" Canvas.Left&#61;"100" Fill&#61;"blue"/>Canvas>