Ali Demirci
Ali Demirci

Reputation: 5442

Xaml Grid Visibility Transitions

Since I cannot find any official documentation about it I need to ask this questions. Is there any way to animate grids on visibility change?

I have tried adding TransitionCollections to grids but it works only the first time that grid initialized.

I also tried this answer but it also wont work because Grid.Loaded event fires even if grid is collapsed.

Upvotes: 0

Views: 816

Answers (1)

Alexej Sommer
Alexej Sommer

Reputation: 2679

You can use event Loaded(). Just add attributes in XAML

 x:DeferLoadStrategy="Lazy" Visibility="Collapsed"

and element will be completely collapsed.
To load it use somewhere in C# code standart:

SomeHiddenElement.Visibility = Visibility.Visible;

Upvotes: 1

Related Questions