PushpinLocationAnimation.Completed Event
Occurs when a PushpinLocationAnimation is completed.
Namespace: DevExpress.Xpf.Map
Assembly: DevExpress.Xpf.Map.v19.2.dll
Declaration
Event Data
The Completed event's data class is EventArgs.
Example
This example illustrates how to provide animation for a map pushpin.
To do this, it is necessary to create a PushpinLocationAnimation object and assign it to the MapPushpin.LocationChangedAnimation property. After that, it becomes possible to customize the animation duration (PushpinLocationAnimation.Duration) and easing function (PushpinLocationAnimation.EasingFunction).
In addition, you can change the pushpin state after its location animation is complete via the PushpinLocationAnimation.Completed
event. In this example, this event is used to change the pushpin location randomly each time the bouncing animation effect is complete.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-animate-a-map-pushpin-e4259.
<Window x:Class="LocationAnimation.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:dxm="http://schemas.devexpress.com/winfx/2008/xaml/map"
Title="MainWindow" Height="350" Width="525" >
<Grid>
<dxm:MapControl>
<dxm:ImageTilesLayer>
<dxm:ImageTilesLayer.DataProvider>
<dxm:OpenStreetMapDataProvider/>
</dxm:ImageTilesLayer.DataProvider>
</dxm:ImageTilesLayer>
<dxm:VectorLayer>
<dxm:MapItemStorage>
<dxm:MapPushpin x:Name="pushpin" TraceDepth="30" TraceStroke="Red" >
<dxm:MapPushpin.LocationChangedAnimation>
<dxm:PushpinLocationAnimation Duration="00:00:02" Completed="PushpinLocationAnimation_Completed" >
<dxm:PushpinLocationAnimation.EasingFunction>
<BounceEase/>
</dxm:PushpinLocationAnimation.EasingFunction>
</dxm:PushpinLocationAnimation>
</dxm:MapPushpin.LocationChangedAnimation>
</dxm:MapPushpin>
<dxm:MapItemStorage>
</dxm:VectorLayer>
</dxm:MapControl>
</Grid>
</Window>
Related GitHub Examples
The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Completed event.
Note
The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.