I created a WPF dialog box for Bing maps and would like to programmatically adjust the center and scale. I tried to use SetValue(), but I did not find the right to transfer it.
Here is the XAML for my Bing Maps dialog:
<Window
x:Class="RAPMkI.BingMapsDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:m="clr-namespace:Microsoft.Maps.MapControl.WPF;assembly=Microsoft.Maps.MapControl.WPF"
Title="BingMapsDialog" Height="378" Width="467">
<Grid>
<m:Map CredentialsProvider="Haha, nice try."/>
<Button Content="Locate" Margin="0,0,0,0" Name="button1" HorizontalAlignment="Right" Width="Auto" Height="Auto" VerticalAlignment="Top" />
</Grid>
</Window>
The encoding is as follows:
namespace RAPMkI
{
public partial class BingMapsDialog : Window
{
public BingMapsDialog(Location center, int zoom)
{
InitializeComponent();
}
}
}
Is there a way to set the center and zoom level of my dialog box during initialization, using the Locationzoom that I went through?
source
share