private void SlideBack() { _isAnimating = true; if (Settings.AnimationsEnabled) { DispatcherTimer timer = new DispatcherTimer(); timer.Interval = TimeSpan.FromMilliseconds(10); timer.Tick += timer_Tick; timer.Start(); } else { AdornerLayer.GetAdornerLayer(this).Remove(_overlayElement); //Application.Current.MainWindow.Content as Grid).Remove(_overlayElement); _originalElement.ApplyAnimationClock(FrameworkElement.OpacityProperty, null); _originalElement.Opacity = 1; _overlayElement = null; _isAnimating = false; _dragCopy = false; Mouse.Capture(null); } }