Esempio n. 1
0
 public TagButton InsertTagView(TagButton tagView, int index)
 {
     TagViews.Insert(index, tagView);
     _tagBackgroundViews.Insert(index, new UIView(tagView.Bounds));
     RearrangeViews();
     return(tagView);
 }
Esempio n. 2
0
        TagButton CreateNewTagView(string title)
        {
            var tagView = new TagButton(title);

            tagView.TextColor                  = TextColor;
            tagView.SelectedTextColor          = SelectedTextColor;
            tagView.TagBackgroundColor         = TagBackgroundColor;
            tagView.HighlightedBackgroundColor = TagHighlightedBackgroundColor;
            tagView.SelectedBackgroundColor    = TagSelectedBackgroundColor;
            tagView.CornerRadius               = CornerRadius;
            tagView.BorderWidth                = BorderWidth;
            tagView.BorderColor                = BorderColor;
            tagView.SelectedBorderColor        = SelectedBorderColor;
            tagView.PaddingX             = PaddingX;
            tagView.PaddingY             = PaddingY;
            tagView.TextFont             = TextFont;
            tagView.RemoveIconLineWidth  = RemoveIconLineWidth;
            tagView.RemoveButtonIconSize = RemoveButtonIconSize;
            tagView.EnableRemoveButton   = EnableRemoveButton;
            tagView.RemoveIconLineColor  = RemoveIconLineColor;

            tagView.OnTapped.Subscribe(args => _onTappedSubject.OnNext(new TagPressedArgs(args.TagView, this))).AddTo(Disposables);
            tagView.OnRemoveButtonTapped.Subscribe(args => _onRemoveButtonTappedSubject.OnNext(new TagPressedArgs(args.TagView, this))).AddTo(Disposables);
            tagView.OnLongPressed.Subscribe(tagButton => _onLongPressSubject.OnNext(new TagPressedArgs(tagButton, this))).AddTo(Disposables);
            tagView.OnTagSelected.Subscribe(tagButton => _onSelectedTagsChangedSubject.OnNext(SelectedTags())).AddTo(Disposables);

            return(tagView);
        }
Esempio n. 3
0
 public TagButton AddTagView(TagButton tagView)
 {
     TagViews.Add(tagView);
     _tagBackgroundViews.Add(new UIView(tagView.Bounds));
     RearrangeViews();
     return(tagView);
 }
Esempio n. 4
0
        public void RemoveTagView(TagButton tagView)
        {
            tagView.RemoveFromSuperview();
            var index = TagViews.IndexOf(tagView);

            if (index > -1)
            {
                TagViews.RemoveAt(index);
                _tagBackgroundViews.RemoveAt(index);
            }
            RearrangeViews();
        }
Esempio n. 5
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            TagButton = null;
        }