private void AddPieGraphLegendItems(LegendAdornmentLayer legendAdornmentLayer)
        {
            PieZedGraphStyle zedGraphStyle = (PieZedGraphStyle)currentStyleBuilder.GetStyles(currentFeatureLayer.FeatureSource)[0];

            foreach (KeyValuePair <string, GeoColor> item in zedGraphStyle.PieSlices)
            {
                LegendItem legendItem = new LegendItem();
                legendItem.ImageWidth       = 20;
                legendItem.TextRightPadding = 5;
                legendItem.RightPadding     = 5;
                legendItem.ImageStyle       = new AreaStyle(new GeoSolidBrush(item.Value));
                legendItem.TextStyle        = new TextStyle(item.Key, new GeoFont("Segoe UI", 10), new GeoSolidBrush(GeoColor.SimpleColors.Black));
                legendAdornmentLayer.LegendItems.Add(legendItem);
            }
        }
        private void UpdateMap(DemographicStyleBuilder styleBuilder)
        {
            if (!avoidUpdatingMap)
            {
                Collection <Style> activeStyles = styleBuilder.GetStyles(currentFeatureLayer.FeatureSource);
                currentFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Clear();
                foreach (Style activeStyle in activeStyles)
                {
                    currentFeatureLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(activeStyle);
                }

                LegendAdornmentLayer legendAdornmentLayer = (LegendAdornmentLayer)map.AdornmentOverlay.Layers[0];
                UpdateLegend(currentStyleBuilder, legendAdornmentLayer);
                map.Refresh();
            }
        }