public VaultListViewCell(Action <VaultListPageModel.Cipher> moreClickedAction, bool groupingOrCipherBinding = false)
        {
            string bindingPrefix = null;

            if (groupingOrCipherBinding)
            {
                SetBinding(GroupingOrCipherParameterProperty, new Binding("."));
                bindingPrefix  = string.Concat(nameof(VaultListPageModel.GroupingOrCipher.Cipher), ".");
                Button.Command = new Command(() => moreClickedAction?.Invoke(GroupingOrCipherParameter?.Cipher));
            }
            else
            {
                SetBinding(CipherParameterProperty, new Binding("."));
                Button.Command = new Command(() => moreClickedAction?.Invoke(CipherParameter));
            }

            Label.SetBinding(Label.TextProperty, bindingPrefix + nameof(VaultListPageModel.Cipher.Name));
            Detail.SetBinding(Label.TextProperty, bindingPrefix + nameof(VaultListPageModel.Cipher.Subtitle));
            LabelIcon.SetBinding(VisualElement.IsVisibleProperty,
                                 bindingPrefix + nameof(VaultListPageModel.Cipher.Shared));
            LabelIcon2.SetBinding(VisualElement.IsVisibleProperty,
                                  bindingPrefix + nameof(VaultListPageModel.Cipher.HasAttachments));

            Button.Image           = "more.png";
            Button.BackgroundColor = Color.Transparent;

            LabelIcon.Source  = "share.png";
            LabelIcon2.Source = "paperclip.png";

            BackgroundColor = Color.White;
        }
Esempio n. 2
0
        public VaultListViewCell(Action <VaultListPageModel.Cipher> moreClickedAction)
        {
            SetBinding(CipherParameterProperty, new Binding("."));
            Label.SetBinding(Label.TextProperty, nameof(VaultListPageModel.Cipher.Name));
            Detail.SetBinding(Label.TextProperty, nameof(VaultListPageModel.Cipher.Subtitle));
            LabelIcon.SetBinding(VisualElement.IsVisibleProperty, nameof(VaultListPageModel.Cipher.Shared));
            LabelIcon2.SetBinding(VisualElement.IsVisibleProperty, nameof(VaultListPageModel.Cipher.HasAttachments));

            Button.Image           = "more.png";
            Button.Command         = new Command(() => moreClickedAction?.Invoke(CipherParameter));
            Button.BackgroundColor = Color.Transparent;

            LabelIcon.Source  = "share.png";
            LabelIcon2.Source = "paperclip.png";

            BackgroundColor = Color.White;
        }