private void SaveAlias_Click(object sender, RoutedEventArgs e) { if (CluesListBox.SelectedItem == null) { return; } PrimaryClueInfo info = CluesListBox.SelectedItem as PrimaryClueInfo; Clue oldClue = new Clue(info.Name); Clue newAlias = new Clue(AliasMemoirBar.SearchTextBox.Text); List <Document> affectedDocuments = ClueManager.Manager.AddClueAlias(oldClue, newAlias); foreach (Document doc in affectedDocuments) { doc.AddClue(newAlias); } PrimaryClues = ClueManager.Manager.GetPrimaryClueInfo(); }
private void CluesListBox_SelectionChanged(object sender, RoutedPropertyChangedEventArgs <object> e) { // Pending studying: diff between SelectedItem and SelectedValue if (CluesListBox.SelectedItem != null) // Can be null during selection { PrimaryClueInfo clueInfo = CluesListBox.SelectedItem as PrimaryClueInfo; string clueString = null; if (clueInfo != null) { clueString = clueInfo.Name; } else { clueString = CluesListBox.SelectedItem as string; } // Clear states currentClueString = ""; UpdateSecondaryAndFoundDocumentsPanel(clueString); } }