void AddPhrase_ExecuteTargets(object obj) { if (mConvesationTree.SelectedItem is PhraseProxy) { PhraseProxy phrase = new PhraseProxy(); phrase.Text = "Text"; CommandManager.Execute(new AddPhrase(mConvesationTree.SelectedItem as PhraseProxy, phrase)); } else { PhraseProxy phrase = new PhraseProxy(); phrase.Text = "Text"; CommandManager.Execute(new AddPhrase(mConversation, phrase)); } }