コード例 #1
0
        protected override void OnElementChanged(ElementChangedEventArgs <GoogleSignInButton> e)
        {
            base.OnElementChanged(e);
            if (Control == null)
            {
                SignInButton signInButton = new SignInButton(Context);
                signInButton.SetColorScheme(SignInButton.ColorDark);

                switch (this.Element.Size)
                {
                case GoogleSignInButton.SizeOptions.IconOnly:
                    signInButton.SetSize(SignInButton.SizeIconOnly);
                    break;

                case GoogleSignInButton.SizeOptions.Wide:
                    signInButton.SetSize(SignInButton.SizeWide);
                    break;

                default:
                    signInButton.SetSize(SignInButton.SizeStandard);
                    break;
                }

                switch (this.Element.ColorScheme)
                {
                case GoogleSignInButton.ColorSchemeOptions.Dark:
                    signInButton.SetColorScheme(SignInButton.ColorDark);
                    break;

                default:
                    signInButton.SetColorScheme(SignInButton.ColorLight);
                    break;
                }

                signInButton.Click += SignInButton_Click;

                SetNativeControl(signInButton);
            }
        }