void HideBackground(ITransitionControl container) { if (container.Contains(_background)) { Animate.The(UIElement.OpacityProperty) .From(1d) .To(0d) .For(_duration) .UponCompletion(() => container.Remove(_background)) .Create() .AnimateOn(_background); } }
void ShowBackground(ITransitionControl container) { if (!container.Contains(_background)) { container.Add(_background); Animate.The(UIElement.OpacityProperty) .From(0d) .To(1d) .For(_duration) .Create() .AnimateOn(_background); } }