Nested Canvas : Canvas « Windows Presentation Foundation « C# / C Sharp






Nested Canvas

Nested Canvas
    

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      WindowTitle="Canvas Sample">

    <StackPanel>
        <TabControl MinHeight="500" MinWidth="400">
            <TabItem  Header="Canvas" IsSelected="True">
                <Canvas Height="400" Width="400">
                    <Canvas Height="100" Width="100"  Top="0" Left="0">
                        <Rectangle Width="100" Height="100" Fill="red"/>
                    </Canvas>
                    <Canvas Height="100" Width="100" Top="100" Left="100">
                        <Rectangle Width="100" Height="100" Fill="green"/>
                    </Canvas>
                    <Canvas Height="100" Width="100" Top="50" Left="50">
                        <Rectangle Width="100" Height="100" Fill="blue"/>
                    </Canvas>
                </Canvas>
            </TabItem>

        </TabControl>
    </StackPanel>

</Page>

   
    
    
    
  








Related examples in the same category

1.Positioning on a CanvasPositioning on a Canvas
2.Canvas without ViewboxCanvas without Viewbox
3.Animation target Canvas Left, TopAnimation target Canvas Left, Top
4.Pixel Not SnappedPixel Not Snapped
5.Rotate ShapeRotate Shape
6.Canvas dependantCanvas dependant
7.Simple Canvas LayoutSimple Canvas Layout
8.Canvas.SetTopCanvas.SetTop
9.Canvas.SetBottomCanvas.SetBottom
10.Canvas.SetRightCanvas.SetRight
11.Canvas PreviewMouseDown action and MouseDown actionCanvas PreviewMouseDown action and MouseDown action
12.Create a Scrollable Canvas ControlCreate a Scrollable Canvas Control
13.Create a Zoomable Canvas ControlCreate a Zoomable Canvas Control
14.Set control position for CanvasSet control position for Canvas
15.Canvas Positioning Properties SampleCanvas Positioning Properties Sample
16.Get position on a Canvas with Canvas.GetLeftGet position on a Canvas with Canvas.GetLeft