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

Home
C# / C Sharp
1.2D Graphics
2.Class Interface
3.Collections Data Structure
4.Components
5.Data Types
6.Database ADO.net
7.Design Patterns
8.Development Class
9.Event
10.File Stream
11.Generics
12.GUI Windows Form
13.Language Basics
14.LINQ
15.Network
16.Office
17.Reflection
18.Regular Expressions
19.Security
20.Services Event
21.Thread
22.Web Services
23.Windows
24.Windows Presentation Foundation
25.XML
26.XML LINQ
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source
C# / C Sharp » Windows Presentation Foundation » CanvasScreenshots 
Animation target Canvas Left, Top
Animation target Canvas Left, Top
      

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

    <Ellipse Width="48" Height="48" Fill="Red" Canvas.Left="0" Canvas.Top="0">
        <Ellipse.Triggers>
            <EventTrigger RoutedEvent="Ellipse.MouseDown">
                <BeginStoryboard>
                    <Storyboard>
                        <DoubleAnimation 
                            Storyboard.TargetProperty="(Canvas.Left)"
                            From="0" To="300" Duration="0:0:0.25"
                            AutoReverse="True" 
                            RepeatBehavior="20x" />
                        <DoubleAnimation 
                            Storyboard.TargetProperty="(Canvas.Top)"
                            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" />
                        </ParallelTimeline>
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
        </Ellipse.Triggers>
    </Ellipse>
</Canvas>

   
    
    
    
    
    
  
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
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
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.