コード例 #1
0
        public ShowAuthPanel()
        {
            WrappedTextWidget userLoginPromptLabel = new WrappedTextWidget("Sign in to access your cloud printer profiles.\n\nOnce signed in you will be able to access:".Localize())
            {
                TextColor = ActiveTheme.Instance.PrimaryTextColor,
            };

            contentRow.AddChild(userLoginPromptLabel);

            AddBulletPointAndDescription(contentRow,
                                         "Cloud Library".Localize(),
                                         "Save your designs to the cloud and access them from anywhere in the world. You can also share them any time with with anyone you want.".Localize());
            AddBulletPointAndDescription(contentRow,
                                         "Cloud Printer Profiles".Localize(),
                                         "Create your machine settings once, and have them available anywhere you want to print. All your changes appear on all your devices.".Localize());
            AddBulletPointAndDescription(contentRow,
                                         "Remote Monitoring".Localize(),
                                         "Check on your prints from anywhere. With cloud monitoring, you have access to your printer no matter where you go.".Localize());

            var skipButton = textImageButtonFactory.Generate("Skip".Localize());

            skipButton.Name   = "Connection Wizard Skip Sign In Button";
            skipButton.Click += (sender, e) =>
            {
                if (!ProfileManager.Instance.ActiveProfiles.Any())
                {
                    WizardWindow.ChangeToPage <SetupStepMakeModelName>();
                }
                else
                {
                    UiThread.RunOnIdle(WizardWindow.Close);
                }
            };
            var createAccountButton = textImageButtonFactory.Generate("Create Account".Localize());

            createAccountButton.Name   = "Create Account From Connection Wizard Button";
            createAccountButton.Margin = new Agg.BorderDouble(right: 5);
            createAccountButton.Click += (s, e) =>
            {
                WizardWindow.ChangeToAccountCreate();
                UiThread.RunOnIdle(WizardWindow.Close);
            };

            var signInButton = textImageButtonFactory.Generate("Sign In".Localize());

            signInButton.Name   = "Sign In From Connection Wizard Button";
            signInButton.Click += (s, e) =>
            {
                WizardWindow.ShowAuthDialog?.Invoke();
                UiThread.RunOnIdle(WizardWindow.Close);
            };

            footerRow.AddChild(skipButton);
            footerRow.AddChild(new HorizontalSpacer());
            footerRow.AddChild(createAccountButton);
            footerRow.AddChild(signInButton);
        }