.xaml文件代码:
<window>
<window.resources>
<DataTemplate x:Key="backTemplate">
<Border BorderBrush="#55FFFFFF" Background="AliceBlue" BorderThickness="1" CornerRadius="5">
<GroupBox Name="mapgroup" Header="WPFMAP" Margin="12,27,241,12" VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch">
<Grid>
<my:GMapControl Name="MainMap"/>
</Grid>
</GroupBox>
</Border>
</DataTemplate>
</window.resources>
<Border Name="border">
<略写>
</Border>
</window>
.cs文件代码: private void Convertmap_Click(object sender, RoutedEventArgs e)
{
((GMapControl)border.FindName("MainMap")).Manager.Mode = AccessMode.ServerAndCache;
((GMapControl)border.FindName("MainMap")).DragButton = MouseButton.Left;//鼠标左击拖动地图
((GMapControl)border.FindName("MainMap")).MapProvider = GMapProviders.BingMap;
((GMapControl)border.FindName("MainMap")).Position = new PointLatLng(32.5149000, 118.78361500);
((GMapControl)border.FindName("MainMap")).MaxZoom = 24;
((GMapControl)border.FindName("MainMap")).MinZoom = 1;
((GMapControl)border.FindName("MainMap")).Zoom = 4;
}
这样写动态引用控件,哪里出问题了,怎么改???
红糖糍粑
慕无忌1623718
阿波罗的战车