// Here we load all the nodes on the left from xml file.
        private void InitializetionDataCategories()
        {
            var xDoc     = XDocument.Load(MapSuiteSampleHelper.GetValueFromConfiguration("CategoryFilePath"));
            var elements = from category in xDoc.Element("DemographicMap").Elements("Category")
                           select category;

            foreach (var element in elements)
            {
                DataCategoryViewModel category = null;
                string title = element.Attribute("name").Value;
                category               = title != "Custom Data" ? new DataCategoryViewModel() : new CustomDataCategoryViewModel();
                category.Title         = title;
                category.CategoryImage = new BitmapImage(new Uri(string.Format(CultureInfo.InvariantCulture, "{0}{1}", "pack://application:,,,/MapSuiteUSDemographicMap;component/", element.Attribute("icon").Value), UriKind.RelativeOrAbsolute));

                foreach (var item in element.Elements("item"))
                {
                    ColumnViewModel categoryItem = new ColumnViewModel();
                    categoryItem.Parent      = category;
                    categoryItem.ColumnName  = item.Element("columnName").Value;
                    categoryItem.Alias       = item.Element("alias").Value;
                    categoryItem.LegendTitle = item.Element("legendTitle").Value;
                    category.Columns.Add(categoryItem);
                }
                category.CanUsePieView = category.Columns.Count >= 2;
                CategoryList.Add(category);
            }
        }
        private void InitializeMap()
        {
            mapControl.MapTools.Logo.IsEnabled                      = true;
            mapControl.MapTools.Logo.Margin                         = new Thickness(0, 0, 10, 5);
            mapControl.MapTools.MouseCoordinate.IsEnabled           = true;
            mapControl.MapTools.MouseCoordinate.Visibility          = Visibility.Hidden;
            mapControl.MapTools.MouseCoordinate.Margin              = new Thickness(0, 0, 100, 5);
            mapControl.MapTools.MouseCoordinate.MouseCoordinateType = MouseCoordinateType.Custom;

            mapControl.Overlays.Add(new WorldMapKitWmsWpfOverlay());

            censusStateFeatureLayer = new ShapeFileFeatureLayer(MapSuiteSampleHelper.GetValueFromConfiguration("UsShapefilePath"));
            censusStateFeatureLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;

            demographicLayerOverlay          = new LayerOverlay();
            demographicLayerOverlay.TileType = TileType.SingleTile;
            mapControl.Overlays.Add(demographicLayerOverlay);

            highlightOverlay = new HighlightOverlay();
            mapControl.Overlays.Add(highlightOverlay);

            legendAdornmentLayer          = new LegendAdornmentLayer();
            legendAdornmentLayer.Location = AdornmentLocation.LowerLeft;
            legendAdornmentLayer.Title    = new LegendItem();
            legendAdornmentLayer.Title.ImageJustificationMode = LegendImageJustificationMode.JustifyImageRight;
            legendAdornmentLayer.Title.TopPadding             = 10;
            legendAdornmentLayer.Title.BottomPadding          = 10;
            legendAdornmentLayer.Title.TextStyle = new TextStyle("Population", new GeoFont("Segoe UI", 12), new GeoSolidBrush(GeoColor.SimpleColors.Black));
            mapControl.AdornmentOverlay.Layers.Add(legendAdornmentLayer);

            DefaultFeatureLayer = censusStateFeatureLayer;

            MapControl.CurrentExtent = globeExtent;
        }