Код: Выделить всё
System.NullReferenceException: “The object reference was not set to an object instance.”
Код: Выделить всё
private void AddMessageButton_Click(object sender, RoutedEventArgs e)
{
Schools_ViewModel viewModel = new Schools_ViewModel();
string subject = SubjectTextBox.Text.Trim();
string messageText = MessageTextBox.Text.Trim();
int? userId = UserSession.Instance.CurrentUser.UserId;
int? teacherId = viewModel.selectedTeacher.TeacherId;
int? fileId = null;
viewModel.AddMessage(userId, teacherId, fileId, subject, messageText);
SubjectTextBox.Clear();
MessageTextBox.Clear();
}
Код: Выделить всё
Подробнее здесь: https://stackoverflow.com/questions/787 ... ity-of-bei
Мобильная версия