public TagButton InsertTagView(TagButton tagView, int index) { TagViews.Insert(index, tagView); _tagBackgroundViews.Insert(index, new UIView(tagView.Bounds)); RearrangeViews(); return(tagView); }
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); }
public TagButton AddTagView(TagButton tagView) { TagViews.Add(tagView); _tagBackgroundViews.Add(new UIView(tagView.Bounds)); RearrangeViews(); return(tagView); }
public void RemoveTagView(TagButton tagView) { tagView.RemoveFromSuperview(); var index = TagViews.IndexOf(tagView); if (index > -1) { TagViews.RemoveAt(index); _tagBackgroundViews.RemoveAt(index); } RearrangeViews(); }
protected override void Dispose(bool disposing) { base.Dispose(disposing); TagButton = null; }