I am loading in a shapefile into a GeographicShapeSeries and use a checkbox to control if the series is displayed or hidden on the xamGeographicMap by removing or adding the series from/to the xamGeoMap based on the state of the checkbox. I only set the series' outline color and when series is displayed, the shapes represented (in this case, US state boundaries) are filled in with a gray background. If I remove the series from the xamGeoMap and re-add it VIA the checkbox, the gray background disappears. It seems a default background color is used even if the series' "Brush" property is set to null, but that "default" goes away if the series is removed and then re-added. What can be done to prevent the use of a default fill bush when adding/removing series? Attached is an example program.
I ended up manually setting the brush and that takes care of the issue. I also ended up setting visibility instead of removing the layers once I fixed another bug that was pointed out on another thread.
Thanks!
Hello Gary,
Just checking in, did you have any other questions or concerns on this matter?
Sincerely,AndrewAssociate DeveloperInfragistics Inc.www.infragistics.com/support
Thank you for your post.
While I am not entirely sure as to why the background color is not being retained when removing and re-adding the series, I also see that in your code, you do not set the series.Brush property anywhere. This tells me that it is somehow getting reset after the initial rendering, and it is not being retained. If you set the series.Brush property in your AddGeographicShapeSeries method, you will be able to retain the background color on the states, and you will also have the ability to customize it further. One thing to note, you will want to add an opacity value less than 1 to the brush that you assign to this property, because you will not be able to see the state labels or roads otherwise.
Alternatively, if you are keeping the checkbox in your layers area after the series has been removed, why not consider setting the Visibility property on the series instead? This will retain the background color without having to set it.
Please let me know if you have any other questions or concerns on this matter.