I've got some fade-in/fade-out animations that are triggered when a view is removed and added to a region. The initial fade-in works fine, but a fade-in after a fade-out is clipped. The animation timeline is set to 500 ms. This problem doesn't
happen when I boost the timeline to a value closer to 1000ms. By 'clipped', I mean that the last part of the fade-in animation might appear (say 20ms out of 500 ms) or it just doesn't appear to be an animated fade-in.
First, a 'leave' animation is triggered and the following
this.VisibilityService.LeaveViewAnimation(screen.View, () =>
IScreen newScreen = EnsureScreenExists(args.ScreenKey, args.ScreenSubject, args.RegionName);
public void LeaveViewAnimation(UserControl view, Action onLeaveComplete)
this.LeaveViewVisibilityStoryboard = new Storyboard();
this.LeaveViewVisibilityStoryboard.Completed += new EventHandler((sender, e) => onLeaveComplete());
PerformAnimation(view, this.LeaveViewVisibilityStoryboard, 500);
this.LeaveViewVisibilityStoryboard.Completed -= new EventHandler((sender, e) => onLeaveComplete());
Second, the new view is inserted and activated
Third, a entry animation begins
I've left out some intermediary code for the setup of the animations.
Is the problem related to the timing of view loading events???