コード例 #1
0
        private void OnAddClickHandler(object obj)
        {
            if (TagText != string.Empty && TagsList.Count(t => t.Name == TagText) == 0)
            {
                Tag newTag = dataRepository.TagCollection.FirstOrDefault(t => t.Name == TagText);
                if (newTag == null)
                {
                    newTag      = new Tag();
                    newTag.Name = TagText;
                    dataRepository.CreateTag(newTag);
                    newTag = dataRepository.TagCollection.FirstOrDefault(t => t.Name == TagText);
                }

                currentBlurb.Tags.Add(newTag);
                TagsList.Add(newTag);
                OnPropertyChanged("TagsList");
                TagText = string.Empty;
            }
        }