/// <summary> /// Receive edited service from the EditViewModel /// </summary> private void getServiceEdit() { Messenger.Default.Register <ServiceItem>( this, service => { if (SelectedServicesCollection.Any(x => x.OriginalDisplayName == service.OriginalDisplayName)) { SelectedServicesCollection[SelectedServicesCollection.IndexOf(service)].DisplayName = service.DisplayName; SelectedServicesCollection[SelectedServicesCollection.IndexOf(service)].Description = service.Description; } }); }
/// <summary> /// Get selected services from the collection of services on the AddWindow /// </summary> private void displaySelectedServices() { Messenger.Default.Register <ObservableCollection <ServiceItem> >( this, services => { foreach (ServiceItem service in services) { if (!SelectedServicesCollection.Any(x => x.DisplayName == service.DisplayName)) { SelectedServicesCollection.Add(service); } } }); }