如果在创建图片时指定了对齐,则对齐WPF Bing地图无效:
var element = new Image()
{
Source = ResourceManager.VesselIcon,
Opacity = 0.9,
Stretch = System.Windows.Media.Stretch.None,
VerticalAlignment = System.Windows.VerticalAlignment.Center, // Is not working
HorizontalAlignment = System.Windows.HorizontalAlignment.Center
};
Fortunatley WPF Bing Maps API确实提供了“PositionOrigin”结构。因此,可以在添加形状以指定自身时指定对齐:
Location location = Helper.SomeLocation();
this.mapLayer.AddChild(element, location, PositionOrigin.Center);
希望它会帮助某人
答案 0 :(得分:0)
Fortunatley WPF Bing Maps API确实提供了“PositionOrigin”结构。因此,可以在添加形状以指定自身时指定对齐:
Location location = Helper.SomeLocation();
this.mapLayer.AddChild(element, location, PositionOrigin.Center);