protected override void CommandExecute(object parameter) { PersonCreationVM person = (parameter as PersonCreationVM); person.Exception = null; if (person.FirstName == null) { person.FirstName = " "; } if (person.LastName == null) { person.LastName = " "; } if (person.Age == null) { person.Age = " "; } StudentVM student = new StudentVM(person.FirstName, person.LastName, person.Age); try { _Validate(student); ClassRoomVM.Add(student); return; } catch (Exception e) { person.Exception = e; return; } }
public AddCommand(ClassRoomVM classRoom) : base(classRoom) { }
protected override void CommandExecute(object parameter) { StudentVM student = parameter as StudentVM; ClassRoomVM.Remove(student); }
public Command(ClassRoomVM classRoom) { ClassRoomVM = classRoom; }
public DeleteCommand(ClassRoomVM classRoom) : base(classRoom) { }