from this link. I can animate my Grid with this code inside the Grid in XAML:
<Grid.Transitions>
<TransitionCollection>
<EntranceThemeTransition />
</TransitionCollection>
</Grid.Transitions>
it simply animate the grid when we start the page. But can we animate it again in C# so when users click a button it will animate again?
if you are trying to reanimate the transition, i can suggest that you can remove the grid and then create again the grid:
XAML
<Grid x:Name="grid"></Grid>
then in code you can do this
grid.Children.Clear();
then recreate it again afterwards
grid.Children.Add("//insertItemsHere");
after a button was click for example, it will delete all the items in grid and it will add again the controls by this it will do animation again.
Here an example code:
public void btn_click(object sender, RoutedEventsArgs e)
{
Grid.Children.Clear();
Grid.Children.Add(ListView);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With