2013-04-15 2 views
2

다음 코드로 점선을 만들 수 있다는 것을 알고 있습니다.이동 자르기를위한 점선

<Window x:Class="MarchingAnts.MainWindow" 
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
     Title="MainWindow" Height="350" Width="525"> 
    <Grid> 
     <Rectangle x:Name="RubberBand" Stroke="Black" StrokeDashArray="10"></Rectangle> 
    </Grid> 
</Window> 

점선이주의를 끌기 위해 주변을 움직일 수있는 방법이 있습니까?

자르기의 선을 쉽게 구별 할 수 있도록 이미지 자르기 용입니다.

+1

이것은 [marching ants] (http://en.wikipedia.org/wiki/Marching_ants)로 알려져 있습니다. –

+0

@DrewNoakes 감사합니다. 나는 그 용어를 결코 들어 본 적이 없었지만 그것은 완벽하게 이해됩니다. –

답변

5
<Storyboard x:Key="BorderAnimation"> 
    <DoubleAnimation To="200" Duration="0:0:10" RepeatBehavior="Forever" By="2" 
        Storyboard.TargetProperty="StrokeDashOffset" Storyboard.TargetName="Border"/> 
</Storyboard>