private void watcher_EventArrived(object sender, EventArrivedEventArgs e) { CollectDrives _driveInfoCollection = new CollectDrives(); ObservableCollection <DriveInfoModel> driveCollection = new ObservableCollection <DriveInfoModel>(); driveCollection.AddRange(_driveInfoCollection.GetDrives()); _ea.GetEvent <CollectionChangedEvent>().Publish(driveCollection); }
public DriveInfoViewModel(IEventAggregator ea) { _ea = ea; CollectDrives driveCollection = new CollectDrives(); DriveInfoCollection.AddRange(driveCollection.GetDrives()); _ea.GetEvent <CollectionChangedEvent>().Subscribe(CollectionReceived); }