private static void Window_Closing(this IAnimCloseWindow acw, object sender, CancelEventArgs e) { if (!acw.CloseStoryBoardCompleted) { acw.Anim_Closing(); e.Cancel = true; } }
/// <summary> /// Call this in Construct Method. /// </summary> /// <param name="acw"></param> public static void InitAnimCloseWindow(this IAnimCloseWindow acw) { acw.Window.Closing += acw.Window_Closing; acw.Window.RenderTransformOrigin = new Point { X = 0.5, Y = 0.5 }; acw.CloseStoryBoardCompleted = false; acw.CloseAnimationCompleted += (x, y) => { LogTo.Debug("Window_Closing Animation Completed."); acw.CloseStoryBoardCompleted = true; acw.Window.Close(); }; }