public ParticipantDetailViewModel() { _participantService = new ParticipantService(); // // TODO: Register for ParticipantSelectionMessage messages // }
public ParticipantDetailViewModel() { _participantService = new ParticipantService(); // // TODO: Register for ParticipantSelectionMessage messages // Messenger.Default.Register <ParticipantSelectionMessage>(this, message => { Participant p = _participantService.GetById(message.ParticipantId); Id = p.Id; FirstName = p.FirstName; LastName = p.LastName; Company = p.Company; } ); }
public ParticipantsViewModel() { _participantService = new ParticipantService(); var ps = new ObservableCollection <ParticipantViewModel>(); foreach (var p in _participantService.GetAll()) { ps.Add(new ParticipantViewModel { Id = p.Id, FirstName = p.FirstName, LastName = p.LastName, Company = p.Company } ); } Participants = ps; }