I have an animation that works fine the first time it is triggered, but when the GoNextCmd
is raising to true a second time, the animation doesn't start anymore. Here is my code :
<ItemsControl DockPanel.Dock="Top" ItemsSource="{Binding ViewCollection}" x:Name="itemsControl">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal"></StackPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemTemplate>
<DataTemplate>
<ContentControl Content="{Binding}" Width="500" Name="toMove">
</ContentControl>
</DataTemplate>
</ItemsControl.ItemTemplate>
<ItemsControl.Style>
<Style TargetType="ItemsControl">
<Style.Triggers>
<DataTrigger Binding="{Binding GoNextCmd}" Value="true">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<ThicknessAnimation RepeatBehavior="1x" FillBehavior="Stop" Storyboard.TargetProperty="Margin" By="-250,0,0,0" Duration="0:0:1">
<ThicknessAnimation.EasingFunction>
<QuinticEase EasingMode="EaseInOut" />
</ThicknessAnimation.EasingFunction>
</ThicknessAnimation>
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
</DataTrigger>
</Style.Triggers>
</Style>
</ItemsControl.Style>
</ItemsControl>
Does somebody knows something about it?
INotifyPropertyChanged
which has some simpleViewCollection
list andbool GoNextCmd
property – dkozlObservableCollection<string>
list property and onebool
property. which I change when button is clicked, andINotifyPropertyChanged
implementation + your XAML. – dkozl