private void OnLayerAvailabilityChange(DataLayer layer, bool visible) { // Change opacity of data layers dataLayers.AutoReduceToolOpacity(); // Create a slider for each data layer UpdateSlider(layer, visible); if (!visible) { layer.SetToolOpacity(1f); } }
// // Private Methods // private void ShowContoursLayer(bool show) { if (show) { // Add visible grids to the contours layer foreach (var g in grids) { contoursLayer.Add(g); } grids.Clear(); // Show locked or normal if (lockedContours != null) { lockedContours.Show(true); } else { contoursLayer.Show(true); // Update contours' data contoursLayer.Refresh(); // Add listeners after refreshing contoursLayer.Grid.OnGridChange += OnContoursGridChange; contoursLayer.Grid.OnValuesChange += OnContoursValuesChange; } dataLayers.AutoReduceToolOpacity(); } else { // Hide at the beginning contoursLayer.Show(false); contoursLayer.Grid.OnGridChange -= OnContoursGridChange; contoursLayer.Grid.OnValuesChange -= OnContoursValuesChange; // Move visible grids from contours layer to list if (contoursLayer.grids.Count > 0) { grids.AddRange(contoursLayer.grids); contoursLayer.Clear(); } dataLayers.ResetToolOpacity(); } }
private void OnLayerVisibilityChange(DataLayer layer, bool visible) { dataLayers.AutoReduceToolOpacity(); }