コード例 #1
0
 /// <summary>
 /// Raises the TagClick event
 /// </summary>
 internal void RaiseTagClick(EvernoteTagItem tag)
 {
     if (this.TagClick != null)
     {
         TagClick(this, new EvernoteTagEventArgs(tag));
     }
 }
コード例 #2
0
        private EvernoteTagItem CreateTagItem(ITag v)
        {
            var ret = new EvernoteTagItem()
            {
                DataContext = v, Text = v.Id
            };

            ret.Resources.Add("converter", ConverterInstance);
            return(ret);
        }
コード例 #3
0
        /// <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));
                }
            }
        }
コード例 #4
0
        /// <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));
            }
        }
コード例 #5
0
 public EvernoteTagEventArgs(EvernoteTagItem item)
 {
     this.Item = item;
 }