I have two xaml files: MainWindow.xaml and the other is userControl EditTaskView.xaml . In MainWindow.xaml it consists of a list and when you double-click on any element of the list, it displays another window (edit window) from the EditView userControl. I try to animate this userControl every time any item in the list is double-clicked. I added animation to userControl, but animation only starts once. How can I run an animation every time I click on any item from the list?
MainWindow.xaml
<ListBox x:Name="lstBxTask" Style="{StaticResource ListBoxItems}" MouseDoubleClick="lstBxTask_MouseDoubleClick"> <ListBox.ItemTemplate> <DataTemplate> <StackPanel> <Rectangle Style="{StaticResource LineBetweenListBox}"/> <StackPanel Orientation="Horizontal"> <TextBlock Text="{Binding Taskname}" Style="{StaticResource TextInListBox}"/> <Button Name="btnDelete" Style="{StaticResource DeleteButton}" Click="btnDelete_Click"/> </StackPanel> </StackPanel> </DataTemplate> </ListBox.ItemTemplate> </ListBox> <ToDoTask:EditTaskView x:Name="EditTask" Grid.Row="1" Grid.RowSpan="2" Grid.ColumnSpan="2" Visibility="Collapsed"/>
MainWindow code has a double-click event that changes the visibility of an EditTaskView.
Suggestions?
animation wpf xaml user-controls
sanjeev40084
source share