I would like to implement a custom zoom slider for a Bing Maps control in my silverlight application. I can set up the mechanics of it in a pretty straightforward way:
<Slider ... Value="{Binding ZoomLevel, Mode=TwoWay, ElementName=MyMap}"/>
However, I can't find a way to bind the Maximum and Minimum properties of the Slider to the maximum and minimum available zoomlevel for the map. I am using the default views (Road, Aerial) and no custom tilesets or anything fancy.
I've tried something like this:
Maximum="{Binding Path=Map.Mode.ZoomRange.To, Mode=TwoWay}"
Minimum="{Binding Path=Map.Mode.ZoomRange.From, Mode=TwoWay}"
But that doesn't work. When my map loads, the Minimum value is set to 0.0, and the Maximum value is set to 1.0. The actual values of Map.Mode.ZoomRange are 1.0 and 17.0 (for the particular location I am looking at now. The Max changes depending on where the map is centered).
How can I bind these properties to my new custom slider?