1

ESRI Map コントロールのパス上を移動する矢印をアニメーション化する次の XAML があります。マップがズームインまたはズームアウトされたときにアニメーションが無効にならないことを除いて、アニメーションは期待どおりに機能します。アニメーションを画面外に移動して画面に戻すと、アニメーションはスケーリングされたパスに正しく再同期されます。マップの縮尺が変更されたときに再描画を強制するトリガーを設定するにはどうすればよいですか?

<esri:LineSymbol x:Key="tunnelSymbol">
    <esri:LineSymbol.ControlTemplate>
        <ControlTemplate>
            <Canvas>
                <Path x:Name="Element" StrokeStartLineCap="Round" StrokeEndLineCap="Round" StrokeDashCap="Round" StrokeLineJoin="Round" Opacity="0.5" RenderTransformOrigin="2,0" StrokeThickness="5" Stroke="#FF05AA05">
                    <Path.Effect>
                        <DropShadowEffect/>
                    </Path.Effect>
                    <VisualStateManager.VisualStateGroups>
                        <VisualStateGroup x:Name="SelectionStates">
                            <VisualState x:Name="Selected">
                            </VisualState>
                            <VisualState x:Name="Unselected"/>
                        </VisualStateGroup>
                        <VisualStateGroup x:Name="CommonStates">
                            <VisualState x:Name="Normal">
                                <Storyboard>
                                    <DoubleAnimation BeginTime="0" Duration="0:0:0.1" Storyboard.TargetName="Element" Storyboard.TargetProperty="(Path.StrokeThickness)" To="5"/>
                                </Storyboard>
                            </VisualState>
                            <VisualState x:Name="MouseOver">
                                <Storyboard>
                                    <DoubleAnimation BeginTime="0" Duration="0:0:0.1" Storyboard.TargetName="Element" Storyboard.TargetProperty="(Path.StrokeThickness)" To="10"/>
                                </Storyboard>
                            </VisualState>
                        </VisualStateGroup>
                    </VisualStateManager.VisualStateGroups>
                </Path>
                <Path x:Name="Arrow" Stretch="Fill" Width="16" Height="16" StrokeLineJoin="Miter"
                      Data="M 0 -5 L 10 -5 M 5 0 L 10 -5 L 5 -10"
                      Stroke="Black" StrokeThickness="3">
                    <Path.RenderTransform>
                        <TransformGroup>
                            <TranslateTransform X="-8" Y="-8"/>
                            <MatrixTransform>
                                <MatrixTransform.Matrix>
                                    <Matrix/>
                                </MatrixTransform.Matrix>
                            </MatrixTransform>
                        </TransformGroup>
                    </Path.RenderTransform>
                    <Path.Triggers>
                        <EventTrigger RoutedEvent="Path.Loaded">
                            <BeginStoryboard>
                                <Storyboard>
                                    <MatrixAnimationUsingPath x:Name="MatrixAnimation" Storyboard.TargetName="Arrow"
                                                              Storyboard.TargetProperty="RenderTransform.Children[1].Matrix"
                                                              DoesRotateWithTangent="True"
                                                              Duration="0:0:5"
                                                              BeginTime="0:0:0"
                                                              RepeatBehavior="Forever" PathGeometry="{Binding Data, Source=Element, BindsDirectlyToSource=True}">
                                    </MatrixAnimationUsingPath>
                                </Storyboard>
                            </BeginStoryboard>
                        </EventTrigger>
                    </Path.Triggers>
                </Path>
            </Canvas>
        </ControlTemplate>
    </esri:LineSymbol.ControlTemplate>
</esri:LineSymbol>
4

0 に答える 0