/// <summary> /// Get Up and Down Storyboard /// </summary> public Storyboard GetStoryboard(Tile tile) { var storyboard = new Storyboard(); var animDuration = new Duration(TimeSpan.FromMilliseconds(1000d)); var offset = tile.BorderThickness.Top + tile.BorderThickness.Bottom; var start = 0d; var end = tile.ActualHeight - offset; if (tile.IsFrontSide) { tile.BackContentPresenter.Visibility = Visibility.Visible; storyboard.AddToStoryboard(start, -end, animDuration, tile.FrontContentPresenter, "(UIElement.Projection).(PlaneProjection.GlobalOffsetY)"); storyboard.AddToStoryboard(end, start, animDuration, tile.BackContentPresenter, "(UIElement.Projection).(PlaneProjection.GlobalOffsetY)"); storyboard.Completed += (sender1, o1) => { tile.FrontContentPresenter.Visibility = Visibility.Collapsed; tile.IsFrontSide = false; }; } else { tile.FrontContentPresenter.Visibility = Visibility.Visible; storyboard.AddToStoryboard(-end, start, animDuration, tile.FrontContentPresenter, "(UIElement.Projection).(PlaneProjection.GlobalOffsetY)"); storyboard.AddToStoryboard(start, end, animDuration, tile.BackContentPresenter, "(UIElement.Projection).(PlaneProjection.GlobalOffsetY)"); storyboard.Completed += (sender1, o1) => { tile.BackContentPresenter.Visibility = Visibility.Collapsed; tile.IsFrontSide = true; }; } return storyboard; }
public Storyboard GetStoryboard(Tile tile) { var storyboard = new Storyboard(); var animDuration = new Duration(TimeSpan.FromMilliseconds(1000d)); var offset = tile.BorderThickness.Right + tile.BorderThickness.Left; var end = tile.ActualWidth - offset; var start = 0d; if (tile.IsFrontSide) { storyboard.AddToStoryboard(-end, start, animDuration, tile.BackContentPresenter, "(UIElement.Projection).(PlaneProjection.GlobalOffsetX)"); storyboard.AddToStoryboard(start, end, animDuration, tile.FrontContentPresenter, "(UIElement.Projection).(PlaneProjection.GlobalOffsetX)"); storyboard.Completed += (sender1, o1) => { tile.IsFrontSide = false; }; } else { storyboard.AddToStoryboard(-end, start, animDuration, tile.FrontContentPresenter, "(UIElement.Projection).(PlaneProjection.GlobalOffsetX)"); storyboard.AddToStoryboard(start, end, animDuration, tile.BackContentPresenter, "(UIElement.Projection).(PlaneProjection.GlobalOffsetX)"); storyboard.Completed += (sender1, o1) => { tile.IsFrontSide = true; }; } return storyboard; }