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






Canvas dependant

Canvas dependant
      
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    x:Class="Microsoft.Samples.Graphics.RectangleExample"
    WindowTitle="Example">
  <Canvas>
      <Ellipse Fill="Yellow" Stroke="Blue" 
               Width="100" Height="50" Margin="5" HorizontalAlignment="Left"></Ellipse>
      <Rectangle Fill="Yellow" Stroke="Blue" 
                 Width="100" Height="50" Margin="5"  HorizontalAlignment="Left"></Rectangle>
      <Ellipse Fill="Yellow" Stroke="Blue" Canvas.Left="100"  Canvas.Top="50"
               Width="100" Height="50" ></Ellipse>
      <Rectangle Fill="Yellow" Stroke="Blue" Canvas.Left="30"  Canvas.Top="40"                 
                 Width="100" Height="50" ></Rectangle>


  </Canvas>
</Page>

   
    
    
    
    
    
  








Related examples in the same category

1.Nested CanvasNested Canvas
2.Positioning on a CanvasPositioning on a Canvas
3.Canvas without ViewboxCanvas without Viewbox
4.Animation target Canvas Left, TopAnimation target Canvas Left, Top
5.Pixel Not SnappedPixel Not Snapped
6.Rotate ShapeRotate Shape
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