public void Exit(System.Action onCompleted)
{
storyboard.Stop();
storyboard.Children.Clear();
//exit animation
var projection = new PlaneProjection { CenterOfRotationY = 0.1 };
viewContainer.Projection = projection;
AddDoubleAnimation(projection, "RotationX", from: 0, to: 90, ms: 250);
AddDoubleAnimation(maskingLayer, "Opacity", from: 1, to: 0, ms: 350);
EventHandler handler = null;
handler = new EventHandler((o, e) =>
{
storyboard.Completed -= handler;
onCompleted();
currentPlacement = null;
});
storyboard.Completed += handler;
storyboard.Begin();
}