I made it to work, Final animation would be with triangle polygon and sinusoidal path to move as soon as we move mouse pointer over triangle it start moving along path with its tip orientation
<pre lang="text"><pre lang="text">
<window x:class="Animation.MyArrowAnim" xmlns:x="#unknown">
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MyArrowAnim" Width="400" Height="400" MouseEnter="Window_MouseEnter">
<canvas width="400" height="400">
<polygon points="0,0 17.3,10 0,20" x:name="rct">
Fill="Red"
Canvas.Top="-1"
StrokeThickness="2"
Panel.ZIndex="1" Width="17" Height="21" Canvas.Left="1" RenderTransformOrigin="0.333,0.333">
<polygon.rendertransform>
<matrixtransform x:name="MyMatrixTransform">
<polygon.triggers>
<eventtrigger routedevent="FrameworkElement.MouseEnter">
<beginstoryboard>
<storyboard autoreverse="False" repeatbehavior="Forever">
<matrixanimationusingpath storyboard.targetname="MyMatrixTransform" storyboard.targetproperty="Matrix" doesrotatewithtangent="True" duration="0:0:1">
<matrixanimationusingpath.pathgeometry>
<pathgeometry figures="M 10,100 C 35,0 135,0 160,100 180,190 285,200 310,100">
<path stroke="SkyBlue" strokethickness="8">
Visibility="Visible">
<path.data>
<pathgeometry figures="M 10,100 C 35,0 135,0 160,100 180,190 285,200 310,100">
<path.rendertransform>
<translatetransform> X="{Binding ElementName=rct,
Path=ActualWidth,
Converter={StaticResource Converter}}"
Y="{Binding ElementName=rct,
Path=ActualHeight,
Converter={StaticResource Converter}}"/>
</canvas>
and use this Class for Translate transform
namespace MyNameSpace
{
public class Converter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value == null) return null;
return ((double)value / 2);
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
}
For above Xaml code to work call the above C# code in Resource Dictionary as follow
<resourcedictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:MyNameSpace">
{
<local:divideby2converter x:key="Converter" xmlns:x="#unknown" xmlns:local="#unknown" />
}
}</resourcedictionary>