private static void EditQuest(EditQuestMessage message) { Window sender = message.Target as Window; EditQuestWindow dlg = new EditQuestWindow(message.Quest) { Owner = sender }; message.Accepted = dlg.ShowDialog() == true; }
private void AddQuest() { QuestViewModel newQuest = new QuestViewModel { QuestSet = this }; EditQuestMessage message = new EditQuestMessage { Quest = newQuest }; this.MessengerInstance.Send(message); if (message.Accepted) { this.AddQuest(newQuest); } }
private void Edit() { QuestViewModel copiedQuest = new QuestViewModel(); copiedQuest.CopyFrom(this); EditQuestMessage message = new EditQuestMessage { Quest = copiedQuest }; this.MessengerInstance.Send(message); if (message.Accepted) { this.CopyFrom(copiedQuest); } }