public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var dotComButton     = new AccountButton("GitHub.com", Images.Logos.DotComMascot);
            var enterpriseButton = new AccountButton("Enterprise", Images.Logos.EnterpriseMascot);

            dotComButton.BackgroundColor     = DotComBackgroundColor;
            dotComButton.Label.TextColor     = EnterpriseBackgroundColor;
            dotComButton.ImageView.TintColor = EnterpriseBackgroundColor;

            enterpriseButton.BackgroundColor     = EnterpriseBackgroundColor;
            enterpriseButton.Label.TextColor     = dotComButton.BackgroundColor;
            enterpriseButton.ImageView.TintColor = dotComButton.BackgroundColor;

            Add(dotComButton);
            Add(enterpriseButton);

            View.ConstrainLayout(() =>
                                 dotComButton.Frame.Top == View.Frame.Top &&
                                 dotComButton.Frame.Left == View.Frame.Left &&
                                 dotComButton.Frame.Right == View.Frame.Right &&
                                 dotComButton.Frame.Bottom == View.Frame.GetMidY() &&

                                 enterpriseButton.Frame.Top == dotComButton.Frame.Bottom &&
                                 enterpriseButton.Frame.Left == View.Frame.Left &&
                                 enterpriseButton.Frame.Right == View.Frame.Right &&
                                 enterpriseButton.Frame.Bottom == View.Frame.Bottom);

            OnActivation(d =>
            {
                d(dotComButton.GetClickedObservable().Subscribe(_ => DotComButtonTouch()));
                d(enterpriseButton.GetClickedObservable().Subscribe(_ => EnterpriseButtonTouch()));
            });
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var dotComButton     = new AccountButton("GitHub.com", Images.Logos.GitHub);
            var enterpriseButton = new AccountButton("Enterprise", Images.Logos.Enterprise);

            dotComButton.BackgroundColor     = DotComBackgroundColor;
            dotComButton.Label.TextColor     = EnterpriseBackgroundColor;
            dotComButton.ImageView.TintColor = EnterpriseBackgroundColor;

            enterpriseButton.BackgroundColor     = EnterpriseBackgroundColor;
            enterpriseButton.Label.TextColor     = dotComButton.BackgroundColor;
            enterpriseButton.ImageView.TintColor = dotComButton.BackgroundColor;

            Add(dotComButton);
            Add(enterpriseButton);

            View.ConstrainLayout(() =>
                                 dotComButton.Frame.Top == View.Frame.Top &&
                                 dotComButton.Frame.Left == View.Frame.Left &&
                                 dotComButton.Frame.Right == View.Frame.Right &&
                                 dotComButton.Frame.Bottom == View.Frame.GetMidY() &&

                                 enterpriseButton.Frame.Top == dotComButton.Frame.Bottom &&
                                 enterpriseButton.Frame.Left == View.Frame.Left &&
                                 enterpriseButton.Frame.Right == View.Frame.Right &&
                                 enterpriseButton.Frame.Bottom == View.Frame.Bottom);

            this.WhenActivated(d => {
                d(enterpriseButton.GetClickedObservable().InvokeCommand(ViewModel.GoToEnterpriseLoginCommand));
                d(dotComButton.GetClickedObservable().InvokeCommand(ViewModel.GoToDotComLoginCommand));
            });
        }
示例#3
0
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            var dotComButton = new AccountButton("Bitbucket", Images.BitbucketLogo);

            dotComButton.BackgroundColor     = DotComBackgroundColor;
            dotComButton.Label.TextColor     = EnterpriseBackgroundColor;
            dotComButton.ImageView.TintColor = EnterpriseBackgroundColor;

            var enterpriseButton = new AccountButton("Stash", Images.StashLogo.ImageWithRenderingMode(UIImageRenderingMode.AlwaysTemplate));

            enterpriseButton.BackgroundColor     = EnterpriseBackgroundColor;
            enterpriseButton.Label.TextColor     = dotComButton.BackgroundColor;
            enterpriseButton.ImageView.TintColor = dotComButton.BackgroundColor;

            Add(dotComButton);
            Add(enterpriseButton);

            View.ConstrainLayout(() =>
                                 dotComButton.Frame.Top == View.Frame.Top &&
                                 dotComButton.Frame.Left == View.Frame.Left &&
                                 dotComButton.Frame.Right == View.Frame.Right &&
                                 dotComButton.Frame.Bottom == View.Frame.GetMidY() &&

                                 enterpriseButton.Frame.Top == dotComButton.Frame.Bottom &&
                                 enterpriseButton.Frame.Left == View.Frame.Left &&
                                 enterpriseButton.Frame.Right == View.Frame.Right &&
                                 enterpriseButton.Frame.Bottom == View.Frame.Bottom);

            OnActivation(disposable =>
            {
                dotComButton
                .GetClickedObservable()
                .Subscribe(_ => DotComButtonTouch())
                .AddTo(disposable);
                enterpriseButton
                .GetClickedObservable()
                .Subscribe(_ => EnterpriseButtonTouch())
                .AddTo(disposable);
            });
        }