Пример #1
0
            /// <summary>
            /// Make a smooth transition between two windows using Lerp.
            /// </summary>
            /// <param name="WFade">Window to fade.</param>
            /// <param name="WShow">Window to reveal.</param>
            /// <param name="Delay">Delay in ms.</param>
            /// <param name="shouldClose ">Close if true, Hide if false.</param>
            public static void Switch(System.Windows.Window WFade, System.Windows.Window WShow, int Delay = 1, bool shouldClose = true)
            {
                __shouldClose = shouldClose;

                SWITCH_LerpFade = new Core.Lerp(1, 0, 0.01f, 0.05f, 1);
                SWITCH_LerpShow = new Core.Lerp(0, 1, 0.01f, 0.05f, 1);

                SWITCH_LerpFade.delay = Delay;
                SWITCH_LerpShow.delay = Delay;

                _WFade = WFade;
                _WShow = WShow;

                _WShow.Hide();
                _WFade.Show();


                SWITCH_LerpShow.LStart += LerpShow_LerpStart;
                SWITCH_LerpShow.LTick  += LerpShow_LerpTick;
                SWITCH_LerpShow.LDone  += LerpShow_LerpDone;

                SWITCH_LerpFade.LStart += LerpFade_LerpStart;
                SWITCH_LerpFade.LTick  += LerpFade_LerpTick;
                SWITCH_LerpFade.LDone  += LerpFade_LerpDone;

                SWITCH_LerpFade.Start();
                SWITCH_LerpShow.Start();
            }
Пример #2
0
            /// <summary>
            /// Smoothly reveals a window.
            /// </summary>
            /// <param name="WReveal">Window to reveal.</param>
            /// <param name="delay">Delay in ms.</param>
            public static void Reveal(System.Windows.Window WReveal, int delay = 1)
            {
                SINGLE_LerpShow         = new Core.Lerp(0, 1, 0.01f, 0.05f, 1);
                SINGLE_LerpShow.LStart += SINGLE_LerpShow_LerpStart;
                SINGLE_LerpShow.LTick  += SINGLE_LerpShow_LerpTick;
                SINGLE_LerpShow.LDone  += SINGLE_LerpShow_LerpDone;

                HWND         = WReveal;
                HWND.Opacity = 0;
                HWND.Show();
                SINGLE_LerpShow.delay = delay;
                SINGLE_LerpShow.Start();
            }
Пример #3
0
            /// <summary>
            /// Smoothly hides/closes a window.
            /// </summary>
            /// <param name="WHide">Window to Hide/Close.</param>
            /// <param name="delay">Delay in ms.</param>
            /// <param name="shouldClose">Close if true, Hide if false.</param>
            public static void Hide(System.Windows.Window WHide, int delay = 1, bool shouldClose = false)
            {
                _shouldClose            = shouldClose;
                SINGLE_LerpFade         = new Core.Lerp(1, 0, 0.01f, 0.05f, 1);
                SINGLE_LerpFade.LStart += SINGLE_LerpFade_LerpStart;
                SINGLE_LerpFade.LTick  += SINGLE_LerpFade_LerpTick;
                SINGLE_LerpFade.LDone  += SINGLE_LerpFade_LerpDone;

                HWND         = WHide;
                HWND.Opacity = 1;
                HWND.Show();
                SINGLE_LerpFade.delay = delay;
                SINGLE_LerpFade.Start();
            }