Closed befoley1960 closed 6 years ago
The Silverlight legend wasn't really a legend, but was actually a table of contents control with a legend for each layer inside each item.
In the .NET SDK this has been more clearly distinguished to allow more control. The legend is just a legend. It renders the legend for a layer. You can use an ItemsControl
bound to the Layers
collection. In the item template put your checkbox bound to IsVisible, and a Legend bound to the layer.
Also see the LegendsInTreeView
sample:
https://github.com/Esri/arcgis-toolkit-dotnet/tree/master/samples/WinDesktop/ArcGISRuntime.Toolkit.Samples/Legend
Morten, thanks for your reply. I was able to tweak the LegendItemViewModel.cs to get the legend to work the way I wanted it to in the WPF Desktop Application. Now, when I copied the code over to my WPF Browser Application, I can’t get the legend class to instantiate. You would think that the code would work on both platforms.
Morten, do you have a private email that I could use to correspond with you ?
Another question I have is at what point does the Legend class get invoked ? I am setting it up in the UserControl.Resources section of my control, within a HierarchicalDataTemplate.
We're working on entirely new design for legend and ToC controls for v100.x
I am re-writing an existing ArcGIS Silverlight application to a .net solution. I am trying to create a legend using the toolkit, but am having some difficulty. I want my legend to look and behave exactly like the Silverlight legend. The Silverlight legend was so simple, all layers and sub-layers displayed easily. I had checkboxes to turn on/off individual sub-layers with no extra coding needed. The new .net solution requires a good bit of coding on my part to give the same functionality. This is slowing me down considerably.