This type of behaviour is generally accomplished using
While... triggers. In this case you might want something like this instead:
<Panel ux:Name="panel" Visibility="Hidden">
This approach is built around a state model rather than an imperative model. Typically the
While... trigger may do several things as well, and this groups them together. It also creates a logical group of changes, and is state stable (you won’t accidentally get into an irreversible or inconsistent state when using change and transfrom animators).
If you have more than two states to toggle you can use the