Exemple #1
0
        private void RemovePreTag(object sender, EventArgs e)
        {
            PreviewTag tag = sender as PreviewTag;

            todo.TagItems.RemoveAt(todo.TagItems.FindIndex(x => x.ID == tag.tagItem.ID));
            LoadTagItems();
            UpdateChosenTag?.Invoke(this, EventArgs.Empty);
        }
Exemple #2
0
        public void LoadTagItems()
        {
            TagItemPreviewStackPanel.Children.Clear();

            if (TagItems != null)
            {
                foreach (var item in TagItems)
                {
                    PreviewTag previewTag = new PreviewTag()
                    {
                        Color = (SolidColorBrush)DrawingColorToBrushConverter.ConvertBack(item.TagColor), Text = item.Content, tagItem = item
                    };

                    previewTag.RemovePreTag += new EventHandler(this.RemovePreTag);
                    TagItemPreviewStackPanel.Children.Add(previewTag);
                }
            }
        }