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); }); }
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); }
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()); }