private void SetupBinding()
        {
            Bindings.Add(this.SetBinding(
                             () => Vm.UserName,
                             () => NameValueLabel.Text,
                             BindingMode.OneWay));

            Bindings.Add(this.SetBinding(
                             () => Vm.UserEmail,
                             () => MailValueLabel.Text,
                             BindingMode.OneWay));

            Bindings.Add(this.SetBinding(
                             () => Vm.Balance,
                             () => BalanceValueLabel.Text,
                             BindingMode.OneWay));

            ShowTransactionsButton.TouchUpInside += (s, e) => { };
            ShowTransactionsButton.SetCommand(
                "TouchUpInside",
                Vm.ShowTransactionsCommand);

            NewTransactionButton.TouchUpInside += (s, e) => { };
            NewTransactionButton.SetCommand(
                "TouchUpInside",
                Vm.NewTransactionCommand);
        }
示例#2
0
        private void InitializeComponent()
        {
            var nav = (IOSNavigationService)ServiceLocator.Current.GetInstance <IExtendedNavigationService>();

            nav.Initialize(this.NavigationController);
            // Email text fiels
            this.View.BackgroundColor = UIColor.FromRGB(98, 174, 136);

            this.NavigationItem.SetLeftBarButtonItem(
                new UIBarButtonItem(LocalizedStrings.Exit, UIBarButtonItemStyle.Plain
                                    , (sender, args) =>
            {
                Vm.LogoutCommand.Execute(null);
            }), true);

            BalanceCard.BackgroundColor    = UIColor.White;
            BalanceCard.Layer.CornerRadius = 5;

            UserInfoCard.BackgroundColor    = UIColor.White;
            UserInfoCard.Layer.CornerRadius = 5;

            BalanceLabel.Text          = LocalizedStrings.Balance;
            BalanceLabel.TextColor     = UIColor.FromRGB(28, 104, 66);
            BalanceLabel.Font          = UIFont.SystemFontOfSize(16.0f, UIFontWeight.Regular);
            BalanceLabel.Lines         = 1;
            BalanceLabel.TextAlignment = UITextAlignment.Center;

            BalanceValueLabel.TextColor     = UIColor.FromRGB(28, 104, 66);
            BalanceValueLabel.Font          = UIFont.BoldSystemFontOfSize(48.0f);
            BalanceValueLabel.Lines         = 1;
            BalanceValueLabel.TextAlignment = UITextAlignment.Center;

            NameLabel.Text          = LocalizedStrings.Name;
            NameLabel.TextColor     = UIColor.FromRGB(28, 104, 66);
            NameLabel.Font          = UIFont.SystemFontOfSize(16.0f, UIFontWeight.Regular);
            NameLabel.Lines         = 1;
            NameLabel.TextAlignment = UITextAlignment.Left;

            MailLabel.Text          = LocalizedStrings.Email;
            MailLabel.TextColor     = UIColor.FromRGB(28, 104, 66);
            MailLabel.Font          = UIFont.SystemFontOfSize(16.0f, UIFontWeight.Regular);
            MailLabel.Lines         = 1;
            MailLabel.TextAlignment = UITextAlignment.Left;

            NameValueLabel.TextColor     = UIColor.FromRGB(28, 104, 66);
            NameValueLabel.Font          = UIFont.SystemFontOfSize(16.0f, UIFontWeight.Regular);
            NameValueLabel.Lines         = 1;
            NameValueLabel.TextAlignment = UITextAlignment.Left;

            MailValueLabel.TextColor     = UIColor.FromRGB(28, 104, 66);
            MailValueLabel.Font          = UIFont.SystemFontOfSize(16.0f, UIFontWeight.Regular);
            MailValueLabel.Lines         = 1;
            MailValueLabel.TextAlignment = UITextAlignment.Left;

            NewTransactionButton.SetTitle(LocalizedStrings.NewTransaction, UIControlState.Normal);
            NewTransactionButton.SetTitleColor(UIColor.White, UIControlState.Normal);
            NewTransactionButton.TitleLabel.Font    = UIFont.BoldSystemFontOfSize(16.0f);
            NewTransactionButton.BackgroundColor    = UIColor.FromRGB(28, 104, 66);
            NewTransactionButton.Layer.CornerRadius = 5;
            NewTransactionButton.ClipsToBounds      = true;

            ShowTransactionsButton.SetTitle(LocalizedStrings.ShowTransactions, UIControlState.Normal);
            ShowTransactionsButton.SetTitleColor(UIColor.White, UIControlState.Normal);
            ShowTransactionsButton.TitleLabel.Font    = UIFont.BoldSystemFontOfSize(16.0f);
            ShowTransactionsButton.BackgroundColor    = UIColor.FromRGB(28, 104, 66);
            ShowTransactionsButton.Layer.CornerRadius = 5;
            ShowTransactionsButton.ClipsToBounds      = true;

            View.AddSubviews(BalanceCard, BalanceLabel, BalanceValueLabel, UserInfoCard,
                             NameLabel, NameValueLabel, MailLabel, MailValueLabel,
                             NewTransactionButton, ShowTransactionsButton);
            AddLayoutConstraints();
        }