コード例 #1
0
        private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            AppDataManager = AppDataManager.Instance;

            AppDataManager.GetTags().ForEach(tag =>
            {
                var view = new TagView(tag)
                {
                    UseSelection = false
                };
                view.ClickDleted += View_ClickDleted;
                TagArea.Children.Add(view);
            });
        }
コード例 #2
0
        private void AddButton_Click(object sender, RoutedEventArgs e)
        {
            if (string.IsNullOrEmpty(NewTag.Text.Trim()))
            {
                return;
            }

            TagInfo tag  = AppDataManager.AddTag(NewTag.Text);
            TagView view = new TagView(tag)
            {
                UseSelection = false
            };

            TagArea.Children.Add(view);
        }
コード例 #3
0
        private List <TagView> CreateTagViews()
        {
            var selectedTag = AppDataManager.GetTags(TaskInfo);

            return(AppDataManager.GetTags().Select(tag =>
            {
                bool isSelected = selectedTag.FirstOrDefault(t => t == tag) != null;

                var view = new TagView(tag)
                {
                    IsSelected = isSelected,
                    EditEnabled = false,
                };

                return view;
            }).ToList());
        }