Exemplo n.º 1
0
        private void Legend_Refreshed(object sender, Legend.RefreshedEventArgs e)
        {
            LayerItemViewModel removeLayerItemVM = null;

            // If a map layer has sublayers, iterate through them.
            if (e.LayerItem.LayerItems != null)
            {
                // Iterate through all the sublayer items.
                foreach (LayerItemViewModel layerItemVM in e.LayerItem.LayerItems)
                {
                    // Collapse all sublayers in the legend.
                    if (layerItemVM.IsExpanded)
                    {
                        layerItemVM.IsExpanded = false;
                    }

                    // Remove the sublayer named "states" from the legend.  The layer remains visible in the map.
                    if (layerItemVM.Label == "states")
                    {
                        removeLayerItemVM = layerItemVM;
                    }
                }

                if (removeLayerItemVM != null)
                {
                    e.LayerItem.LayerItems.Remove(removeLayerItemVM);
                }
            }
            else
            {
                // Collapse all map layers in the legend.
                e.LayerItem.IsExpanded = false;
            }
        }
Exemplo n.º 2
0
        private void Legend_Refreshed(object sender, Legend.RefreshedEventArgs e)
        {
            LayerItemViewModel removeLayerItemVM = null;

            if (e.LayerItem.LayerItems != null)
            {
                foreach (LayerItemViewModel layerItemVM in e.LayerItem.LayerItems)
                {
                    if (layerItemVM.IsExpanded)
                    {
                        layerItemVM.IsExpanded = false;
                    }

                    if (layerItemVM.Label == "states")
                    {
                        removeLayerItemVM = layerItemVM;
                    }
                }

                if (removeLayerItemVM != null)
                {
                    e.LayerItem.LayerItems.Remove(removeLayerItemVM);
                }
            }
            else
            {
                e.LayerItem.IsExpanded = false;
            }
        }
 private void Legend_Refreshed(object sender, Legend.RefreshedEventArgs e)
 {
     // Clear the sub items from the basemap layer.
     if (e.LayerItem.Layer == _worldTopographicBasemap)
     {
         e.LayerItem.LayerItems.Clear();
     }
 }
Exemplo n.º 4
0
        internal void OnRefreshed(object sender, Legend.RefreshedEventArgs args)
        {
            EventHandler <Legend.RefreshedEventArgs> refreshed = Refreshed;

            if (refreshed != null)
            {
                refreshed(sender, args);
            }
        }
Exemplo n.º 5
0
 private void Legend_Refreshed(object sender, Legend.RefreshedEventArgs e)
 {
     if (e.LayerItem.LayerItems != null)
     {
         foreach (LayerItemViewModel layerItemVM in e.LayerItem.LayerItems)
         {
             if (layerItemVM.IsExpanded)
             {
                 layerItemVM.IsExpanded = false;
             }
         }
     }
 }
 void AssociatedObject_Refreshed(object sender, Legend.RefreshedEventArgs e)
 {
     CorrectLegendImages(e.LayerItem);
     CorrectRendererNodes(e.LayerItem);
 }