private void EditButton_OnClick(object sender, RoutedEventArgs e) { var window = new TagWindow(); var tag = (TagModel)TagsListBox.SelectedItems[TagsListBox.SelectedItems.Count - 1]; if (window.ShowDialog() == false) { return; } tag.Text = window.NewText; TagsList[TagsListBox.SelectedIndex].Text = tag.Text; TagsService.Update(tag); }
private void AddTagButton_OnCLick(object sender, RoutedEventArgs e) { var window = new TagWindow(); if (window.ShowDialog() == false) { return; } var tag = new TagModel { Text = window.NewText, TagTextColor = "Black" }; TagsService.Add(tag); TagsList.Add(tag); }