Animation target Canvas Left, Top : Canvas « Windows Presentation Foundation « C# / C Sharp

Animation target Canvas Left, Top

Animation target Canvas Left, Top

<Canvas xmlns=""

    <Ellipse Width="48" Height="48" Fill="Red" Canvas.Left="0" Canvas.Top="0">
            <EventTrigger RoutedEvent="Ellipse.MouseDown">
                            From="0" To="300" Duration="0:0:0.25"
                            RepeatBehavior="20x" />
                            From="0" To="480" Duration="0:0:5"
                            AutoReverse="True" />
                        <ParallelTimeline BeginTime="0:0:10" FillBehavior="Stop">
                            <DoubleAnimation Storyboard.TargetProperty="Width" From="48" To="480" Duration="0:0:1" />
                            <DoubleAnimation Storyboard.TargetProperty="Height" From="48" To="480" Duration="0:0:1" />


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.Pixel Not SnappedPixel Not Snapped
5.Rotate ShapeRotate Shape
6.Canvas dependantCanvas dependant
7.Simple Canvas LayoutSimple Canvas Layout
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