Esempio n. 1
0
        private static void Window_Closing(this IAnimCloseWindow acw, object sender, CancelEventArgs e)
        {
            if (!acw.CloseStoryBoardCompleted)
            {
                acw.Anim_Closing();

                e.Cancel = true;
            }
        }
Esempio n. 2
0
        /// <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();
            };
        }