I want to add a standard Slider control (System.Windows.Controls.Slider) as an overlay control in the active map view. My code is quite simple, but nothing is added to the map view and no exception is raised. Here's the code:
var sliderControl = new Slider
{
Minimum = 1,
Maximum = 10,
Width = 400,
Value = 1,
Height = 40,
Visibility = System.Windows.Visibility.Visible
};
var mapViewOverlayControl = new MapViewOverlayControl(sliderControl, true, false, false, OverlayControlRelativePosition.BottomCenter, .5, .8);
MapView.Active.AddOverlayControl(_mapViewOverlayControl);
Not sure what I'm doing wrong. Any help would be greatly appreciated.
Regards
Carsten
Solved! Go to Solution.
Hi,
You have global variable _mapViewOverlayControl (with underscore) which is null, I think. So change it to:
MapView.Active.AddOverlayControl(mapViewOverlayControl);
Without underscore it works fine
Hi,
You have global variable _mapViewOverlayControl (with underscore) which is null, I think. So change it to:
MapView.Active.AddOverlayControl(mapViewOverlayControl);
Without underscore it works fine
Of course. How could I miss that?! Thanks a lot 🙂