private LabelProperties GenerateLabelProperties(LabelListSetting listSetting) { LabelProperties labels = new LabelProperties(); if (listSetting != null) { listSetting.RelatedLabelProperties = labels; foreach (var setting in listSetting.LabelSettings) { var labelClass = new AttributeLabelClass { TextExpression = setting.TextExpression, LabelPlacement = setting.Placement, LabelPosition = setting.Position, IsVisible = setting.IsVisible, Symbol = new TextSymbol { Color = setting.LabelColor } }; labelClass.Symbol.Font.FontFamily = "微软雅黑"; labels.LabelClasses.Add(labelClass); setting.RelatedAttributeLabelClass = labelClass; } } return(labels); }
public LabelListSettingVm(LabelListSetting listSetting) { foreach (var setting in listSetting.LabelSettings) { //var vm = new LabelSettingVm(listSetting.RelatedLabelProperties.LabelClasses, setting.RelatedAttributeLabelClass, setting.Name); var vm = new LabelSettingVm(listSetting, setting); Labels.Add(vm); } }
private LabelListSetting GenerateDefaultLabelSetting() { var settings = new LabelListSetting(); //Name var setting = new LabelSetting { TextExpression = $"[{HydrologicAttributes.Name}]", Name = HydrologicAttributes.NameCn, IsVisible = false, Placement = LabelPlacement.PointAboveLeft //Position = LabelPosition.FixedPositionOrRemove }; settings.LabelSettings.Add(setting); //L setting = new LabelSetting { TextExpression = $"[{HydrologicAttributes.L}]", Name = HydrologicAttributes.LCn, IsVisible = false, Placement = LabelPlacement.PointBelowLeft //Position = LabelPosition.FixedPositionOrRemove }; settings.LabelSettings.Add(setting); //Wl1 setting = new LabelSetting { TextExpression = $"[{HydrologicAttributes.Wl1}]", Name = HydrologicAttributes.Wl1Cn, IsVisible = false, Placement = LabelPlacement.PointBelowRight, LabelColor = Colors.Brown //Position = LabelPosition.FixedPositionOrRemove }; settings.LabelSettings.Add(setting); //Type setting = new LabelSetting { TextExpression = $"[{HydrologicAttributes.Type}]", Name = HydrologicAttributes.TypeCn, IsVisible = false, Placement = LabelPlacement.PointAboveRight, LabelColor = Colors.Brown //Position = LabelPosition.FixedPositionOrRemove }; settings.LabelSettings.Add(setting); return(settings); }
private LabelListSetting GenerateDefaultLabelSetting() { var settings = new LabelListSetting(); //Name var setting = new LabelSetting { TextExpression = $"[Name]", IsVisible = true, Placement = LabelPlacement.PointAboveLeft, LabelColor = Colors.Black, Position = LabelPosition.RepositionOrRemove }; settings.LabelSettings.Add(setting); return(settings); }
public LabelSettingVm(LabelListSetting listSetting, LabelSetting setting) { this.listSetting = listSetting; this.labelSetting = setting; }