Ejemplo n.º 1
0
 private void AddSectionCell(LabeledValueCell cell, bool show)
 {
     if (ItemInformationSection.Contains(cell))
     {
         ItemInformationSection.Remove(cell);
     }
     if (show)
     {
         ItemInformationSection.Add(cell);
     }
 }
Ejemplo n.º 2
0
        private void Init()
        {
            EditItem = new EditLoginToolBarItem(this, _loginId);
            ToolbarItems.Add(EditItem);
            if (Device.OS == TargetPlatform.iOS)
            {
                ToolbarItems.Add(new DismissModalToolBarItem(this));
            }

            // Name
            var nameCell = new LabeledValueCell(AppResources.Name);

            nameCell.Value.SetBinding <VaultViewLoginPageModel>(Label.TextProperty, s => s.Name);

            // Username
            UsernameCell = new LabeledValueCell(AppResources.Username, button1Text: AppResources.Copy);
            UsernameCell.Value.SetBinding <VaultViewLoginPageModel>(Label.TextProperty, s => s.Username);
            UsernameCell.Value.SetBinding <VaultViewLoginPageModel>(Label.FontSizeProperty, s => s.UsernameFontSize);
            UsernameCell.Button1.Command = new Command(() => Copy(Model.Username, AppResources.Username));

            // Password
            PasswordCell = new LabeledValueCell(AppResources.Password, button1Text: string.Empty,
                                                button2Text: AppResources.Copy);
            PasswordCell.Value.SetBinding <VaultViewLoginPageModel>(Label.TextProperty, s => s.MaskedPassword);
            PasswordCell.Value.SetBinding <VaultViewLoginPageModel>(Label.FontSizeProperty, s => s.PasswordFontSize);
            PasswordCell.Button1.SetBinding <VaultViewLoginPageModel>(Button.ImageProperty, s => s.ShowHideImage);
            if (Device.OS == TargetPlatform.iOS)
            {
                PasswordCell.Button1.Margin = new Thickness(10, 0);
            }
            PasswordCell.Button1.Command  = new Command(() => Model.RevealPassword = !Model.RevealPassword);
            PasswordCell.Button2.Command  = new Command(() => Copy(Model.Password, AppResources.Password));
            PasswordCell.Value.FontFamily = Device.OnPlatform(iOS: "Courier", Android: "monospace", WinPhone: "Courier");

            // URI
            UriCell = new LabeledValueCell(AppResources.Website, button1Text: AppResources.Launch);
            UriCell.Value.SetBinding <VaultViewLoginPageModel>(Label.TextProperty, s => s.UriHost);
            UriCell.Button1.SetBinding <VaultViewLoginPageModel>(IsVisibleProperty, s => s.ShowLaunch);
            UriCell.Button1.Command = new Command(() => Device.OpenUri(new Uri(Model.Uri)));

            // Notes
            var notesCell = new LabeledValueCell();

            notesCell.Value.SetBinding <VaultViewLoginPageModel>(Label.TextProperty, s => s.Notes);
            notesCell.Value.LineBreakMode = LineBreakMode.WordWrap;

            LoginInformationSection = new TableSection(AppResources.LoginInformation)
            {
                nameCell
            };

            NotesSection = new TableSection(AppResources.Notes)
            {
                notesCell
            };

            Table = new ExtendedTableView
            {
                Intent          = TableIntent.Settings,
                EnableScrolling = true,
                HasUnevenRows   = true,
                EnableSelection = false,
                Root            = new TableRoot
                {
                    LoginInformationSection,
                    NotesSection
                }
            };

            if (Device.OS == TargetPlatform.iOS)
            {
                Table.RowHeight          = -1;
                Table.EstimatedRowHeight = 70;
            }
            else if (Device.OS == TargetPlatform.Android)
            {
                // NOTE: This is going to cause problems with i18n strings since various languages have difference string sizes
                PasswordCell.Button1.WidthRequest = 40;
                PasswordCell.Button2.WidthRequest = 59;
                UsernameCell.Button1.WidthRequest = 59;
                UriCell.Button1.WidthRequest      = 75;
            }

            Title          = AppResources.ViewLogin;
            Content        = Table;
            BindingContext = Model;
        }
Ejemplo n.º 3
0
        private void Init()
        {
            ToolbarItems.Add(new EditSiteToolBarItem(this, _siteId));
            if (Device.OS == TargetPlatform.iOS)
            {
                ToolbarItems.Add(new DismissModalToolBarItem(this));
            }

            // Name
            var nameCell = new LabeledValueCell(AppResources.Name);

            nameCell.Value.SetBinding <VaultViewSitePageModel>(Label.TextProperty, s => s.Name);

            // Username
            UsernameCell = new LabeledValueCell(AppResources.Username, button1Text: AppResources.Copy);
            UsernameCell.Value.SetBinding <VaultViewSitePageModel>(Label.TextProperty, s => s.Username);
            UsernameCell.Button1.Command = new Command(() => Copy(Model.Username, AppResources.Username));

            // Password
            PasswordCell = new LabeledValueCell(AppResources.Password, button1Text: string.Empty,
                                                button2Text: AppResources.Copy);
            PasswordCell.Value.SetBinding <VaultViewSitePageModel>(Label.TextProperty, s => s.MaskedPassword);
            PasswordCell.Button1.SetBinding <VaultViewSitePageModel>(Button.ImageProperty, s => s.ShowHideImage);
            if (Device.OS == TargetPlatform.iOS)
            {
                PasswordCell.Button1.Margin = new Thickness(10, 0);
            }
            PasswordCell.Button1.Command = new Command(() => Model.RevealPassword = !Model.RevealPassword);
            PasswordCell.Button2.Command = new Command(() => Copy(Model.Password, AppResources.Password));

            UsernameCell.Value.FontFamily = PasswordCell.Value.FontFamily = Device.OnPlatform(
                iOS: "Courier", Android: "monospace", WinPhone: "Courier");

            // URI
            UriCell = new LabeledValueCell(AppResources.Website, button1Text: AppResources.Launch);
            UriCell.Value.SetBinding <VaultViewSitePageModel>(Label.TextProperty, s => s.UriHost);
            UriCell.Button1.SetBinding <VaultViewSitePageModel>(IsVisibleProperty, s => s.ShowLaunch);
            UriCell.Button1.Command = new Command(() => Device.OpenUri(new Uri(Model.Uri)));

            // Notes
            var notesCell = new LabeledValueCell();

            notesCell.Value.SetBinding <VaultViewSitePageModel>(Label.TextProperty, s => s.Notes);
            notesCell.Value.LineBreakMode = LineBreakMode.WordWrap;

            SiteInformationSection = new TableSection("Site Information")
            {
                nameCell
            };

            NotesSection = new TableSection(AppResources.Notes)
            {
                notesCell
            };

            Table = new ExtendedTableView
            {
                Intent          = TableIntent.Settings,
                EnableScrolling = true,
                HasUnevenRows   = true,
                EnableSelection = false,
                Root            = new TableRoot
                {
                    SiteInformationSection,
                    NotesSection
                }
            };

            if (Device.OS == TargetPlatform.iOS)
            {
                Table.RowHeight          = -1;
                Table.EstimatedRowHeight = 70;
            }

            Title          = "View Site";
            Content        = Table;
            BindingContext = Model;
        }
Ejemplo n.º 4
0
        public void InitProps()
        {
            // Name
            var nameCell = new LabeledValueCell(AppResources.Name);

            nameCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.Name));
            nameCell.Value.LineBreakMode = LineBreakMode.WordWrap;

            // Notes
            NotesCell = new LabeledValueCell();
            NotesCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.Notes));
            NotesCell.Value.LineBreakMode = LineBreakMode.WordWrap;

            switch (_type)
            {
            case CipherType.Login:
                // Username
                LoginUsernameCell = new LabeledValueCell(AppResources.Username, button1Image: "clipboard.png");
                LoginUsernameCell.Value.SetBinding(Label.TextProperty,
                                                   nameof(VaultViewCipherPageModel.LoginUsername));
                LoginUsernameCell.Button1.Command =
                    new Command(() => Copy(Model.LoginUsername, AppResources.Username));
                LoginUsernameCell.Value.LineBreakMode = LineBreakMode.WordWrap;

                // Password
                LoginPasswordCell = new LabeledValueCell(AppResources.Password, button1Image: string.Empty,
                                                         button2Image: "clipboard.png");
                LoginPasswordCell.Value.SetBinding(Label.TextProperty,
                                                   nameof(VaultViewCipherPageModel.MaskedLoginPassword));
                LoginPasswordCell.Button1.SetBinding(Button.ImageProperty,
                                                     nameof(VaultViewCipherPageModel.LoginShowHideImage));
                if (Device.RuntimePlatform == Device.iOS)
                {
                    LoginPasswordCell.Button1.Margin = new Thickness(10, 0);
                }
                LoginPasswordCell.Button1.Command =
                    new Command(() => Model.RevealLoginPassword = !Model.RevealLoginPassword);
                LoginPasswordCell.Button2.Command =
                    new Command(() => Copy(Model.LoginPassword, AppResources.Password));
                LoginPasswordCell.Value.FontFamily =
                    Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", Windows: "Courier");
                LoginPasswordCell.Value.LineBreakMode = LineBreakMode.WordWrap;

                // URI
                LoginUriCell = new LabeledValueCell(AppResources.Website, button1Image: "launch.png");
                LoginUriCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.LoginUriHost));
                LoginUriCell.Button1.SetBinding(IsVisibleProperty, nameof(VaultViewCipherPageModel.ShowLoginLaunch));
                LoginUriCell.Button1.Command = new Command(async() =>
                {
                    if (Device.RuntimePlatform == Device.Android && Model.LoginUri.StartsWith("androidapp://"))
                    {
                        await _deviceActionService.LaunchAppAsync(Model.LoginUri, this);
                    }
                    else if (Model.LoginUri.StartsWith("http://") || Model.LoginUri.StartsWith("https://"))
                    {
                        Device.OpenUri(new Uri(Model.LoginUri));
                    }
                });

                // Totp
                LoginTotpCodeCell = new LabeledValueCell(
                    AppResources.VerificationCodeTotp, button1Image: "clipboard.png", subText: "--");
                LoginTotpCodeCell.Value.SetBinding(Label.TextProperty,
                                                   nameof(VaultViewCipherPageModel.LoginTotpCodeFormatted));
                LoginTotpCodeCell.Value.SetBinding(Label.TextColorProperty,
                                                   nameof(VaultViewCipherPageModel.LoginTotpColor));
                LoginTotpCodeCell.Button1.Command =
                    new Command(() => Copy(Model.LoginTotpCode, AppResources.VerificationCodeTotp));
                LoginTotpCodeCell.Sub.SetBinding(Label.TextProperty,
                                                 nameof(VaultViewCipherPageModel.LoginTotpSecond));
                LoginTotpCodeCell.Sub.SetBinding(Label.TextColorProperty,
                                                 nameof(VaultViewCipherPageModel.LoginTotpColor));
                LoginTotpCodeCell.Value.FontFamily =
                    Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", Windows: "Courier");
                break;

            case CipherType.Card:
                CardNameCell = new LabeledValueCell(AppResources.CardholderName);
                CardNameCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.CardName));

                CardNumberCell = new LabeledValueCell(AppResources.Number, button1Image: "clipboard.png");
                CardNumberCell.Button1.Command = new Command(() => Copy(Model.CardNumber, AppResources.Number));
                CardNumberCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.CardNumber));
                CardNumberCell.Value.LineBreakMode = LineBreakMode.WordWrap;

                CardBrandCell = new LabeledValueCell(AppResources.Brand);
                CardBrandCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.CardBrand));

                CardExpCell = new LabeledValueCell(AppResources.Expiration);
                CardExpCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.CardExp));

                CardCodeCell = new LabeledValueCell(AppResources.SecurityCode, button1Image: "clipboard.png");
                CardCodeCell.Button1.Command = new Command(() => Copy(Model.CardCode, AppResources.SecurityCode));
                CardCodeCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.CardCode));
                break;

            case CipherType.Identity:
                IdNameCell = new LabeledValueCell(AppResources.Name);
                IdNameCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.IdName));
                IdNameCell.Value.LineBreakMode = LineBreakMode.WordWrap;

                IdUsernameCell = new LabeledValueCell(AppResources.Username, button1Image: "clipboard.png");
                IdUsernameCell.Button1.Command = new Command(() => Copy(Model.IdUsername, AppResources.Username));
                IdUsernameCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.IdUsername));
                IdUsernameCell.Value.LineBreakMode = LineBreakMode.WordWrap;

                IdCompanyCell = new LabeledValueCell(AppResources.Company);
                IdCompanyCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.IdCompany));

                IdSsnCell = new LabeledValueCell(AppResources.SSN);
                IdSsnCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.IdSsn));

                IdPassportNumberCell = new LabeledValueCell(AppResources.PassportNumber,
                                                            button1Image: "clipboard.png");
                IdPassportNumberCell.Button1.Command =
                    new Command(() => Copy(Model.IdPassportNumber, AppResources.PassportNumber));
                IdPassportNumberCell.Value.SetBinding(Label.TextProperty,
                                                      nameof(VaultViewCipherPageModel.IdPassportNumber));
                IdPassportNumberCell.Value.LineBreakMode = LineBreakMode.WordWrap;

                IdLicenseNumberCell = new LabeledValueCell(AppResources.LicenseNumber,
                                                           button1Image: "clipboard.png");
                IdLicenseNumberCell.Button1.Command =
                    new Command(() => Copy(Model.IdLicenseNumber, AppResources.LicenseNumber));
                IdLicenseNumberCell.Value.SetBinding(Label.TextProperty,
                                                     nameof(VaultViewCipherPageModel.IdLicenseNumber));
                IdLicenseNumberCell.Value.LineBreakMode = LineBreakMode.WordWrap;

                IdEmailCell = new LabeledValueCell(AppResources.Email);
                IdEmailCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.IdEmail));

                IdPhoneCell = new LabeledValueCell(AppResources.Phone);
                IdPhoneCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.IdPhone));

                IdAddressCell = new LabeledValueCell(AppResources.Address, button1Image: "clipboard.png");
                IdAddressCell.Button1.Command = new Command(() => Copy(Model.IdAddress, AppResources.Address));
                IdAddressCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.IdAddress));
                IdAddressCell.Value.LineBreakMode = LineBreakMode.WordWrap;
                break;

            default:
                break;
            }

            ItemInformationSection = new TableSection(AppResources.ItemInformation)
            {
                nameCell
            };

            NotesSection = new TableSection(AppResources.Notes)
            {
                NotesCell
            };

            Table = new ExtendedTableView
            {
                Intent          = TableIntent.Settings,
                EnableScrolling = true,
                HasUnevenRows   = true,
                EnableSelection = true,
                Root            = new TableRoot
                {
                    ItemInformationSection
                }
            };

            if (Device.RuntimePlatform == Device.iOS)
            {
                Table.RowHeight          = -1;
                Table.EstimatedRowHeight = 70;
            }
            else if (Device.RuntimePlatform == Device.Android)
            {
                Table.BottomPadding = 170;
            }
        }
        private void Init()
        {
            EditItem = new EditLoginToolBarItem(this, _loginId);
            ToolbarItems.Add(EditItem);
            if (Device.RuntimePlatform == Device.iOS)
            {
                ToolbarItems.Add(new DismissModalToolBarItem(this));
            }

            // Name
            var nameCell = new LabeledValueCell(AppResources.Name);

            nameCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewLoginPageModel.Name));

            // Username
            UsernameCell = new LabeledValueCell(AppResources.Username, button1Text: AppResources.Copy);
            UsernameCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewLoginPageModel.Username));
            UsernameCell.Button1.Command     = new Command(() => Copy(Model.Username, AppResources.Username));
            UsernameCell.Value.LineBreakMode = LineBreakMode.WordWrap;

            // Password
            PasswordCell = new LabeledValueCell(AppResources.Password, button1Text: string.Empty,
                                                button2Text: AppResources.Copy);
            PasswordCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewLoginPageModel.MaskedPassword));
            PasswordCell.Button1.SetBinding(Button.ImageProperty, nameof(VaultViewLoginPageModel.ShowHideImage));
            if (Device.RuntimePlatform == Device.iOS)
            {
                PasswordCell.Button1.Margin = new Thickness(10, 0);
            }
            PasswordCell.Button1.Command     = new Command(() => Model.RevealPassword = !Model.RevealPassword);
            PasswordCell.Button2.Command     = new Command(() => Copy(Model.Password, AppResources.Password));
            PasswordCell.Value.FontFamily    = Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", WinPhone: "Courier");
            PasswordCell.Value.LineBreakMode = LineBreakMode.WordWrap;

            // URI
            UriCell = new LabeledValueCell(AppResources.Website, button1Text: AppResources.Launch);
            UriCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewLoginPageModel.UriHost));
            UriCell.Button1.SetBinding(IsVisibleProperty, nameof(VaultViewLoginPageModel.ShowLaunch));
            UriCell.Button1.Command = new Command(() =>
            {
                if (Device.RuntimePlatform == Device.Android && Model.Uri.StartsWith("androidapp://"))
                {
                    MessagingCenter.Send(Application.Current, "LaunchApp", Model.Uri);
                }
                else if (Model.Uri.StartsWith("http://") || Model.Uri.StartsWith("https://"))
                {
                    Device.OpenUri(new Uri(Model.Uri));
                }
            });

            // Totp
            TotpCodeCell = new LabeledValueCell(AppResources.VerificationCodeTotp, button1Text: AppResources.Copy, subText: "--");
            TotpCodeCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewLoginPageModel.TotpCodeFormatted));
            TotpCodeCell.Value.SetBinding(Label.TextColorProperty, nameof(VaultViewLoginPageModel.TotpColor));
            TotpCodeCell.Button1.Command = new Command(() => Copy(Model.TotpCode, AppResources.VerificationCodeTotp));
            TotpCodeCell.Sub.SetBinding(Label.TextProperty, nameof(VaultViewLoginPageModel.TotpSecond));
            TotpCodeCell.Sub.SetBinding(Label.TextColorProperty, nameof(VaultViewLoginPageModel.TotpColor));
            TotpCodeCell.Value.FontFamily = Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", WinPhone: "Courier");

            // Notes
            NotesCell = new LabeledValueCell();
            NotesCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewLoginPageModel.Notes));
            NotesCell.Value.LineBreakMode = LineBreakMode.WordWrap;

            LoginInformationSection = new TableSection(AppResources.LoginInformation)
            {
                nameCell
            };

            NotesSection = new TableSection(AppResources.Notes)
            {
                NotesCell
            };

            Table = new ExtendedTableView
            {
                Intent          = TableIntent.Settings,
                EnableScrolling = true,
                HasUnevenRows   = true,
                EnableSelection = true,
                Root            = new TableRoot
                {
                    LoginInformationSection
                }
            };

            if (Device.RuntimePlatform == Device.iOS)
            {
                Table.RowHeight          = -1;
                Table.EstimatedRowHeight = 70;
            }
            else if (Device.RuntimePlatform == Device.Android)
            {
                // NOTE: This is going to cause problems with i18n strings since various languages have difference string sizes
                PasswordCell.Button1.WidthRequest = 40;
                PasswordCell.Button2.WidthRequest = 59;
                UsernameCell.Button1.WidthRequest = 59;
                TotpCodeCell.Button1.WidthRequest = 59;
                UriCell.Button1.WidthRequest      = 75;
            }

            Title          = AppResources.ViewLogin;
            Content        = Table;
            BindingContext = Model;
        }
        public void InitProps()
        {
            // Name
            var nameCell = new LabeledValueCell(AppResources.Name);

            nameCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.Name));
            nameCell.Value.LineBreakMode = LineBreakMode.WordWrap;

            // Notes
            NotesCell = new LabeledValueCell();
            NotesCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.Notes));
            NotesCell.Value.LineBreakMode = LineBreakMode.WordWrap;

            var revisionDateCell = new LabeledValueCell(AppResources.DateUpdated);

            revisionDateCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.RevisionDate));
            revisionDateCell.Value.LineBreakMode = LineBreakMode.WordWrap;

            switch (_type)
            {
            case CipherType.Login:
                // Username
                LoginUsernameCell = new LabeledValueCell(AppResources.Username, button1Image: "clipboard.png");
                LoginUsernameCell.Value.SetBinding(Label.TextProperty,
                                                   nameof(VaultViewCipherPageModel.LoginUsername));
                LoginUsernameCell.Button1.Command =
                    new Command(() => Copy(Model.LoginUsername, AppResources.Username));
                LoginUsernameCell.Value.LineBreakMode = LineBreakMode.WordWrap;

                // Password
                LoginPasswordCell = new LabeledValueCell(AppResources.Password, button1Image: string.Empty,
                                                         button2Image: "clipboard.png");
                LoginPasswordCell.Value.SetBinding(Label.FormattedTextProperty,
                                                   nameof(VaultViewCipherPageModel.FormattedLoginPassword));
                LoginPasswordCell.Button1.SetBinding(Button.ImageProperty,
                                                     nameof(VaultViewCipherPageModel.LoginShowHideImage));
                LoginPasswordCell.Button1.Command =
                    new Command(() => Model.RevealLoginPassword = !Model.RevealLoginPassword);
                LoginPasswordCell.Button2.Command =
                    new Command(() => Copy(Model.LoginPassword, AppResources.Password));
                LoginPasswordCell.Value.FontFamily =
                    Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", Windows: "Courier");
                LoginPasswordCell.Value.LineBreakMode = LineBreakMode.WordWrap;

                // Totp
                LoginTotpCodeCell = new LabeledValueCell(
                    AppResources.VerificationCodeTotp, button1Image: "clipboard.png", subText: "--");
                LoginTotpCodeCell.Value.SetBinding(Label.TextProperty,
                                                   nameof(VaultViewCipherPageModel.LoginTotpCodeFormatted));
                LoginTotpCodeCell.Value.SetBinding(Label.TextColorProperty,
                                                   nameof(VaultViewCipherPageModel.LoginTotpColor));
                LoginTotpCodeCell.Button1.Command =
                    new Command(() => Copy(Model.LoginTotpCode, AppResources.VerificationCodeTotp));
                LoginTotpCodeCell.Sub.SetBinding(Label.TextProperty,
                                                 nameof(VaultViewCipherPageModel.LoginTotpSecond));
                LoginTotpCodeCell.Sub.SetBinding(Label.TextColorProperty,
                                                 nameof(VaultViewCipherPageModel.LoginTotpColor));
                LoginTotpCodeCell.Value.FontFamily =
                    Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", Windows: "Courier");

                // Password Revision Date
                LoginPasswordRevisionDateCell = new LabeledValueCell(AppResources.DatePasswordUpdated);
                LoginPasswordRevisionDateCell.Value.SetBinding(Label.TextProperty,
                                                               nameof(VaultViewCipherPageModel.PasswordRevisionDate));
                LoginPasswordRevisionDateCell.Value.LineBreakMode = LineBreakMode.WordWrap;
                break;

            case CipherType.Card:
                CardNameCell = new LabeledValueCell(AppResources.CardholderName);
                CardNameCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.CardName));

                CardNumberCell = new LabeledValueCell(AppResources.Number, button1Image: "clipboard.png");
                CardNumberCell.Button1.Command = new Command(() => Copy(Model.CardNumber, AppResources.Number));
                CardNumberCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.CardNumber));
                CardNumberCell.Value.LineBreakMode = LineBreakMode.WordWrap;

                CardBrandCell = new LabeledValueCell(AppResources.Brand);
                CardBrandCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.CardBrand));

                CardExpCell = new LabeledValueCell(AppResources.Expiration);
                CardExpCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.CardExp));

                CardCodeCell = new LabeledValueCell(AppResources.SecurityCode, button1Image: string.Empty,
                                                    button2Image: "clipboard.png");
                CardCodeCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.MaskedCardCode));
                CardCodeCell.Button1.SetBinding(Button.ImageProperty,
                                                nameof(VaultViewCipherPageModel.CardCodeShowHideImage));
                CardCodeCell.Button1.Command  = new Command(() => Model.RevealCardCode = !Model.RevealCardCode);
                CardCodeCell.Button2.Command  = new Command(() => Copy(Model.CardCode, AppResources.SecurityCode));
                CardCodeCell.Value.FontFamily =
                    Helpers.OnPlatform(iOS: "Menlo-Regular", Android: "monospace", Windows: "Courier");
                break;

            case CipherType.Identity:
                IdNameCell = new LabeledValueCell(AppResources.Name);
                IdNameCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.IdName));
                IdNameCell.Value.LineBreakMode = LineBreakMode.WordWrap;

                IdUsernameCell = new LabeledValueCell(AppResources.Username, button1Image: "clipboard.png");
                IdUsernameCell.Button1.Command = new Command(() => Copy(Model.IdUsername, AppResources.Username));
                IdUsernameCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.IdUsername));
                IdUsernameCell.Value.LineBreakMode = LineBreakMode.WordWrap;

                IdCompanyCell = new LabeledValueCell(AppResources.Company);
                IdCompanyCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.IdCompany));

                IdSsnCell = new LabeledValueCell(AppResources.SSN);
                IdSsnCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.IdSsn));

                IdPassportNumberCell = new LabeledValueCell(AppResources.PassportNumber,
                                                            button1Image: "clipboard.png");
                IdPassportNumberCell.Button1.Command =
                    new Command(() => Copy(Model.IdPassportNumber, AppResources.PassportNumber));
                IdPassportNumberCell.Value.SetBinding(Label.TextProperty,
                                                      nameof(VaultViewCipherPageModel.IdPassportNumber));
                IdPassportNumberCell.Value.LineBreakMode = LineBreakMode.WordWrap;

                IdLicenseNumberCell = new LabeledValueCell(AppResources.LicenseNumber,
                                                           button1Image: "clipboard.png");
                IdLicenseNumberCell.Button1.Command =
                    new Command(() => Copy(Model.IdLicenseNumber, AppResources.LicenseNumber));
                IdLicenseNumberCell.Value.SetBinding(Label.TextProperty,
                                                     nameof(VaultViewCipherPageModel.IdLicenseNumber));
                IdLicenseNumberCell.Value.LineBreakMode = LineBreakMode.WordWrap;

                IdEmailCell = new LabeledValueCell(AppResources.Email);
                IdEmailCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.IdEmail));

                IdPhoneCell = new LabeledValueCell(AppResources.Phone);
                IdPhoneCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.IdPhone));

                IdAddressCell = new LabeledValueCell(AppResources.Address, button1Image: "clipboard.png");
                IdAddressCell.Button1.Command = new Command(() => Copy(Model.IdAddress, AppResources.Address));
                IdAddressCell.Value.SetBinding(Label.TextProperty, nameof(VaultViewCipherPageModel.IdAddress));
                IdAddressCell.Value.LineBreakMode = LineBreakMode.WordWrap;
                break;

            default:
                break;
            }

            ItemInformationSection = new TableSection(AppResources.ItemInformation)
            {
                nameCell
            };

            NotesSection = new TableSection(AppResources.Notes)
            {
                NotesCell
            };

            OtherSection = new TableSection(Helpers.GetEmptyTableSectionTitle())
            {
                revisionDateCell
            };

            Table = new ExtendedTableView
            {
                Intent          = TableIntent.Settings,
                EnableScrolling = true,
                HasUnevenRows   = true,
                EnableSelection = true,
                Root            = new TableRoot
                {
                    ItemInformationSection
                }
            };

            if (Device.RuntimePlatform == Device.iOS)
            {
                Table.RowHeight          = -1;
                Table.EstimatedRowHeight = 70;
            }
            else if (Device.RuntimePlatform == Device.Android)
            {
                Table.BottomPadding = 170;
            }
        }