private void DeleteProject(object sender, RoutedEventArgs e) { ProjectProxy proxy = ((MenuItem)sender).DataContext as ProjectProxy; string projectTitle = PromptDialog.Prompt("Type the name of this project (to be sure you delete the right project)", "Delete project"); if (!string.IsNullOrWhiteSpace(projectTitle) && projectTitle.Equals(proxy.Title)) { ProjectManager projManager = new ProjectManager(); projManager.DeleteById(proxy.ID); this.UIProjectProxyList.Remove(proxy); } }