/// <summary> /// Adds group to the seleted groups /// </summary> /// <param name="group">Group to add</param> private void AddGroupToList(Group group) { if (AllowMultiSelect && !this.SelectedGroups.Select(g => g.Id).Contains(group.Id)) { var selectedGroups = SelectedGroups.ToList(); selectedGroups.Add(group); this.SelectedGroups = selectedGroups; } }
public ExportViewModel(IExportService exporter) { GroupSelectionChangedCommand = new RelayCommand <IEnumerable <object> >(SetListSelection); ExportCommand = new RelayCommand <Guid>(guid => _exporter.ExportAsync(SelectedGroups.ToList(), _settings, guid)); _exporter = exporter; _plugins = new ObservableCollection <IFileExporter>(_exporter.GetPlugins()); MessengerInstance.Register <string>(this, msg => { if (msg == Ri2Constants.Notifications.GroupsUpdated) { RaisePropertyChanged(nameof(Groups)); } }); }