private async void SetOverlayFrame_Base(object content, bool animate)
        {
            await Application.Current.Dispatcher.InvokeAsync(() =>
            {
                bool isEmpty  = content == null;
                var focusMode = (isEmpty ? MainFrame_KeyboardNavigationMode_Default : KeyboardNavigationMode.None);
                KeyboardNavigation.SetTabNavigation(MainThread.MainFrame, focusMode);
                Keyboard.ClearFocus();

                if (animate)
                {
                    if (isEmpty)
                    {
                        PageAnimator.FrameSwipe_OverlayOut(MainThread.OverlayFrame, content);
                    }
                    else
                    {
                        PageAnimator.FrameSwipe_OverlayIn(MainThread.OverlayFrame, content);
                    }
                }
                else
                {
                    MainThread.OverlayFrame.Navigate(content);
                }
            });
        }
        public async void SetDialogFrame(object content)
        {
            bool animate = Properties.LauncherSettings.Default.AnimatePageTransitions;

            await Application.Current.Dispatcher.InvokeAsync(() =>
            {
                bool isEmpty  = content == null;
                var focusMode = (isEmpty ? MainFrame_KeyboardNavigationMode_Default : KeyboardNavigationMode.None);
                KeyboardNavigation.SetTabNavigation(MainThread.MainFrame, focusMode);
                KeyboardNavigation.SetTabNavigation(MainThread.OverlayFrame, focusMode);
                Keyboard.ClearFocus();

                if (animate)
                {
                    if (isEmpty)
                    {
                        PageAnimator.FrameFadeOut(MainThread.ErrorFrame, content);
                    }
                    else
                    {
                        PageAnimator.FrameFadeIn(MainThread.ErrorFrame, content);
                    }
                }
                else
                {
                    MainThread.ErrorFrame.Navigate(content);
                }
            });
        }
Example #3
0
        public void SetDialogFrame(object content, bool useFade = true)
        {
            bool isEmpty   = content == null;
            var  focusMode = (isEmpty ? MainFrame_KeyboardNavigationMode_Default : KeyboardNavigationMode.None);

            KeyboardNavigation.SetTabNavigation(MainThread.MainFrame, focusMode);
            KeyboardNavigation.SetTabNavigation(MainThread.OverlayFrame, focusMode);
            Keyboard.ClearFocus();

            if (useFade)
            {
                if (isEmpty)
                {
                    PageAnimator.FrameFadeOut(MainThread.ErrorFrame, content);
                }
                else
                {
                    PageAnimator.FrameFadeIn(MainThread.ErrorFrame, content);
                }
            }
            else
            {
                MainThread.ErrorFrame.Navigate(content);
            }
        }
Example #4
0
        public void TurnPageBack()
        {
            ShowPage();
            PageTurnedBack = true;
            PageAnimator.SetBool("TurnPageNormal", false);
            PageAnimator.SetBool("TurnPageBackNormal", true);

            Details.TurnPageBack();
            InsideFrontCover.mainTexture = Details.LeftPage();
            PageFront.mainTexture        = Details.RightPage();
            PageBack.mainTexture         = Details.NextLeftPage();
            InsideBackCover.mainTexture  = Details.NextRightPage();
        }
Example #5
0
        public void Update()
        {
            if (Input.GetKeyDown("c"))
            {
                string   screenshotFilename;
                DateTime td = System.DateTime.Now;
                screenshotFilename = "..//ScreenShots//SS - " + td.ToString("yyyy MM dd-HH-mm-ss-ffff") + ".png";
                ScreenCapture.CaptureScreenshot(screenshotFilename);
                Debug.Log("Taken Snap Shot." + td.ToString("yyyy MM dd-HH-mm-ss-ffff"));
            }

            if (PageTurning || PageTurnedBack)
            {
                AnimatorStateInfo currentBaseState = PageAnimator.GetCurrentAnimatorStateInfo(0);
                if (currentBaseState.IsName("WaitBackTurn"))
                {
                    if (PageTurning)
                    {
                        PageTurning = false;
                        Details.TurnPage();
                        HidePage();
                        PageAnimator.SetBool("TurnPageNormal", false);

                        InsideFrontCover.mainTexture = Details.LeftPage();
                    }
                }
                if (currentBaseState.IsName("WaitTurnMid"))
                {
                    if (PageTurnedBack)
                    {
                        PageTurnedBack = false;

                        HidePage();
                        PageAnimator.SetBool("TurnPageBackNormal", false);
                        InsideBackCover.mainTexture = Details.RightPage();
                    }
                }
            }
        }