private void btn_addComment_Click(object sender, RoutedEventArgs e) { CommentWindow commentWindow = new CommentWindow(); if (commentWindow.ShowDialog() == true) { taskContract.AddComment(commentWindow.CurrentText, (this.DataContext as Task).ID, GlobalSettings.CurrentUser.ID); UpdateComment((this.DataContext as Task).ID); } }