private void AddANewLayer() { var newLayer = new ScaleLineOrBarAdornmentLayerViewModel(); newLayer.Name = GenerateScaleName(); newLayer.Location = AdornmentLocation.LowerLeft; ScaleLayers.Add(newLayer); SelectedLayer = newLayer; }
private void InitLayers() { if (GisEditor.ActiveMap != null) { GisEditorWpfMap wpfMap = GisEditor.ActiveMap; var scaleLayers = wpfMap.FixedAdornmentOverlay.Layers.Where(tmpAdornmentLayer => (tmpAdornmentLayer is ScaleLineAdornmentLayer || tmpAdornmentLayer is ScaleBarAdornmentLayer)); foreach (var tmpLayer in scaleLayers) { ScaleLineOrBarAdornmentLayerViewModel newLayer = ScaleLineOrBarAdornmentLayerViewModel.CreateInstance(tmpLayer); ScaleLayers.Add(newLayer); } SelectedLayer = ScaleLayers.FirstOrDefault(); } }