0
나는 슬롯 머신에서 볼 수있는 것과 같은 약간의 이미지 루프를 반복하려고합니다. 현재 코드는 더 많은 선택 윤곽을 가지므로 이미지는 맨 위부터 맨 아래로 이동하면서 첫 이미지의 뒤에있는 공백을 이동합니다.WPF 계속되는 애니메이션
마지막 이미지 immediatley가 루프의 첫 번째 이미지를 따르도록하려면 어떻게해야합니까?
XAML :
<Window x:Class="SlotV3.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Slot Machine" Height="600" Width="800" Loaded="Window_Loaded">
<Grid>
<Button Content="Button" Height="23" HorizontalAlignment="Left" Margin="634,185,0,0" Name="button1" VerticalAlignment="Top" Width="75" Click="button1_Click" />
<Canvas Name="canvas1" Margin="82,49,458,12" ClipToBounds="True" Height="500">
<StackPanel Height="1043" Name="stackPanel1" Width="193" Canvas.Left="28" Canvas.Top="8">
images here...
</StackPanel>
</Canvas>
</Grid>
및 사용하여 애니메이션 코드 메신저 :
DoubleAnimation da = new DoubleAnimation();
da.From = -stackPanel1.ActualHeight;
da.To = canvas1.ActualHeight;
da.Duration = new Duration(TimeSpan.FromSeconds(0.25));
da.RepeatBehavior = RepeatBehavior.Forever;
stackPanel1.BeginAnimation(Canvas.TopProperty, da);