/// <summary> /// Raises the TagClick event /// </summary> internal void RaiseTagClick(EvernoteTagItem tag) { if (this.TagClick != null) { TagClick(this, new EvernoteTagEventArgs(tag)); } }
private EvernoteTagItem CreateTagItem(ITag v) { var ret = new EvernoteTagItem() { DataContext = v, Text = v.Id }; ret.Resources.Add("converter", ConverterInstance); return(ret); }
/// <summary> /// Removes a tag from the collection /// </summary> internal void RemoveTag(EvernoteTagItem tag, bool cancelEvent = false) { if (this.ItemsSource != null) { ((IList)this.ItemsSource).Remove(tag); // assume IList for convenience SelectedTags.Clear(); SelectedTags.AddRange(((List <EvernoteTagItem>) this.ItemsSource).Select(d => d.DataContext as ITag)); this.Items.Refresh(); if (TagRemoved != null && !cancelEvent) { TagRemoved(this, new EvernoteTagEventArgs(tag)); } } }
/// <summary> /// Adds a tag to the collection /// </summary> internal void AddTag(EvernoteTagItem tag) { if (this.ItemsSource == null) { this.ItemsSource = new List <EvernoteTagItem>(); } ((IList)this.ItemsSource).Add(tag); // assume IList for convenience SelectedTags.Clear(); SelectedTags.AddRange(((List <EvernoteTagItem>) this.ItemsSource).Select(d => d.DataContext as ITag)); this.Items.Refresh(); if (TagAdded != null) { TagAdded(this, new EvernoteTagEventArgs(tag)); } }
public EvernoteTagEventArgs(EvernoteTagItem item) { this.Item = item; }