public void Transition(ITransitionControl container, FrameworkElement oldContent, FrameworkElement newContent) { FrameworkElement newContentToAdd = ModifyNewContent(container, newContent); container.Add(newContentToAdd); if (oldContent != null) { GetOutAnimation() .UponCompletion(() => container.Remove(oldContent)) .AnimateOn(oldContent); } if (newContentToAdd != null) { GetInAnimation() .AnimateOn(newContentToAdd); } }
void ShowBackground(ITransitionControl container) { if (!container.Contains(_background)) { container.Add(_background); Animate.The(UIElement.OpacityProperty) .From(0d) .To(1d) .For(_duration) .Create() .AnimateOn(_background); } }