public MainViewModel( Dispatcher dispatcher, IEventAggregator eventAggregator, ISeriesSelectorController seriesSelectorController, IUiModeChanges uiModeModel, ITargetLocation targetModel, ITransformation transformationInterface, IStripsViewerLayoutController viewerLayoutController, ICalibration calibrationInterface, IMovementDetection movementDetectionModel, ILocateXD locateXDModel, IStripsManager stripsManager, IACPC acpcInterface, IRigidNPR rigidNPRInterface) { _dispatcher = dispatcher; _eventAggregator = eventAggregator; _seriesSelectorController = seriesSelectorController; _uiModeModel = uiModeModel; _uiModeModel.ModeChanged += (s, a) => UiModeChanged?.Invoke(s, a); _uiModeModel.LayerVisiblityChanged += (s, a) => LayerVisibilityChanged?.Invoke(s, a); _viewerLayoutController = viewerLayoutController; _stripsManager = stripsManager; _rigidNPR = rigidNPRInterface; ACPC = new TargetViewModel(targetModel, transformationInterface, calibrationInterface, acpcInterface); MD = new MDViewModel(movementDetectionModel); XDCalib = new XDCalibViewModel(locateXDModel); SwitchLayoutCommand = new DelegateCommand <StripsViewerLayout>(SwitchLayout); AppWorkingOcurredCommand = new DelegateCommand(() => _eventAggregator.GetEvent <AppWorkingEvent>().Publish()); StripsViewerLayouts = new ObservableCollection <StripsViewerLayout>(_viewerLayoutController.Layouts); _seriesSelectorController.SeriesSelected += OnSeriesSelected; _stripsManager.Changed += OnStripsManagerChanged; }
/// <summary> Set the visibility of the specified layer. </summary> /// <remarks> The visibility is set for all maps added to the LayerCollection via <see cref="Register"/>. /// A layer can not be hidden in one map and shown in another one. </remarks> /// <param name="layer"> Layer of which the visibility should be modified. </param> /// <param name="visible"> Flag indicating the (in-)visibility of the layer. </param> public void SetVisible(ILayer layer, bool visible) { if (IsVisible(layer) == visible) { return; } visibilities[layer] = visible; foreach (var mapView in mapViews.Where(mapView => mapView.IsVisible)) { if (visible) { layer.AddToMapView(mapView); } else { layer.RemoveFromMapView(mapView); } } LayerVisibilityChanged?.Invoke(this, new LayerChangedEventArgs(layer)); }
public static void OnLayerVisibilityChanged(object sender) { LayerVisibilityChanged?.Invoke(sender, EventArgs.Empty); }