protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            if (e.Parameter is Tuple <string, Rect> Parameter)
            {
                string[] Paras = Parameter.Item1.Split("||");
                switch (Paras[0])
                {
                case "PathActivate":
                {
                    IsPathActivate = true;
                    ActivatePath   = Paras[1];
                    break;
                }
                }

                if (WindowsVersionChecker.IsNewerOrEqual(WindowsVersionChecker.Version.Windows10_1903) && AnimationController.Current.IsEnableAnimation && !IsPathActivate)
                {
                    EntranceEffectProvider = new EntranceAnimationEffect(this, Nav, Parameter.Item2);
                    EntranceEffectProvider.PrepareEntranceEffect();
                }
            }
            else if (e.Parameter is Rect SplashRect)
            {
                if (WindowsVersionChecker.IsNewerOrEqual(WindowsVersionChecker.Version.Windows10_1903) && AnimationController.Current.IsEnableAnimation && !IsPathActivate)
                {
                    EntranceEffectProvider = new EntranceAnimationEffect(this, Nav, SplashRect);
                    EntranceEffectProvider.PrepareEntranceEffect();
                }
            }
        }
Beispiel #2
0
        public MainPage(object Parameter)
        {
            InitializeComponent();
            ThisPage = this;
            Window.Current.SetTitleBar(TitleBar);
            Application.Current.FocusVisualKind = FocusVisualKind.Reveal;
            Loaded += MainPage_Loaded;
            Loaded += MainPage_Loaded1;
            Window.Current.Activated += MainPage_Activated;
            Application.Current.EnteredBackground += Current_EnteredBackground;
            Application.Current.LeavingBackground += Current_LeavingBackground;
            SystemNavigationManagerPreview.GetForCurrentView().CloseRequested += MainPage_CloseRequested;
            SystemNavigationManager.GetForCurrentView().BackRequested         += MainPage_BackRequested;

            BackgroundController.Current.SetAcrylicEffectPresenter(CompositorAcrylicBackground);

            if (Package.Current.IsDevelopmentMode)
            {
                AppName.Text += " (Development Mode)";
            }

            FullTrustProcessController.Current.AuthorityModeChanged += async(s, e) =>
            {
                await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
                {
                    if (FullTrustProcessController.Current.RuningInAdministratorMode)
                    {
                        AppName.Text += $" ({Globalization.GetString("RunningInAdminModeTip")})";
                    }
                });
            };

            if (Parameter is Tuple <Rect, string> RSParamter)
            {
                string[] Paras = RSParamter.Item2.Split("||");

                switch (Paras[0])
                {
                case "PathActivate":
                {
                    IsPathActivate = true;
                    ActivatePath   = Paras[1];
                    break;
                }
                }

                if (WindowsVersionChecker.IsNewerOrEqual(WindowsVersionChecker.Version.Windows10_1903) && !AnimationController.Current.IsDisableStartupAnimation && !IsPathActivate)
                {
                    EntranceEffectProvider = new EntranceAnimationEffect(this, Nav, RSParamter.Item1);
                    EntranceEffectProvider.PrepareEntranceEffect();
                }
            }
            else if (Parameter is Rect RectParameter)
            {
                if (WindowsVersionChecker.IsNewerOrEqual(WindowsVersionChecker.Version.Windows10_1903) && !AnimationController.Current.IsDisableStartupAnimation && !IsPathActivate)
                {
                    EntranceEffectProvider = new EntranceAnimationEffect(this, Nav, RectParameter);
                    EntranceEffectProvider.PrepareEntranceEffect();
                }
            }
        }