示例#1
0
            /// <summary>
            /// Make a smooth transition between two windows using Smooth Step.
            /// </summary>
            /// <param name="WFade">Window to fade.</param>
            /// <param name="WShow">Window to reveal.</param>
            /// <param name="Delay">Delay in ms.</param>
            /// <param name="shouldHideAfterSwitch">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_StepFade = new Core.SmoothStep(0, 1, 1.00f, -0.001f, 0.01f, 1);
                SWITCH_StepShow = new Core.SmoothStep(0, 1, 0.00f, +0.001f, 0.01f, 1);


                SWITCH_StepFade.delay = Delay;
                SWITCH_StepShow.delay = Delay;

                _WFade = WFade;
                _WShow = WShow;

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

                SWITCH_StepShow.SmoothStepStart += SWITCH_StepShow_SmoothStepStart;;
                SWITCH_StepShow.SmoothStepTick  += SWITCH_StepShow_SmoothStepTick;;
                SWITCH_StepShow.SmoothStepDone  += SWITCH_StepShow_SmoothStepDone;;

                SWITCH_StepFade.SmoothStepStart += SWITCH_StepFade_SmoothStepStart;;
                SWITCH_StepFade.SmoothStepTick  += SWITCH_StepFade_SmoothStepTick;;
                SWITCH_StepFade.SmoothStepDone  += SWITCH_StepFade_SmoothStepDone;;

                SWITCH_StepFade.Start();
                SWITCH_StepShow.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_StepShow = new Core.SmoothStep(0, 1, 0.01f, 0.05f, 1);
                SINGLE_StepShow.SmoothStepStart += SINGLE_StepShow_SmoothStepStart;;
                SINGLE_StepShow.SmoothStepTick  += SINGLE_StepShow_SmoothStepTick;;
                SINGLE_StepShow.SmoothStepDone  += SINGLE_StepShow_SmoothStepDone;;

                HWND         = WReveal;
                HWND.Opacity = 0;
                HWND.Show();
                SINGLE_StepShow.delay = delay;
                SINGLE_StepShow.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_StepFade = new Core.SmoothStep(1, 0, 0.01f, 0.05f, 1);
                SINGLE_StepFade.SmoothStepStart += SINGLE_StepFade_SmoothStepStart;;
                SINGLE_StepFade.SmoothStepTick  += SINGLE_StepFade_SmoothStepTick;;
                SINGLE_StepFade.SmoothStepDone  += SINGLE_StepFade_SmoothStepDone;;

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