C# 如何在bing地图图钉中显示多行文本?
我正在将带有foreach循环的图钉添加到地图中,如下所示:C# 如何在bing地图图钉中显示多行文本?,c#,wpf,xaml,bing-maps,C#,Wpf,Xaml,Bing Maps,我正在将带有foreach循环的图钉添加到地图中,如下所示: Pushpin p = new Pushpin() { Location = new Microsoft.Maps.MapControl.WPF.Location { Latitude = n.latitude, Longitude = n.longtitude} }; public class Address { public int ID { get; set; } public string companyNa
Pushpin p = new Pushpin() { Location = new Microsoft.Maps.MapControl.WPF.Location { Latitude = n.latitude, Longitude = n.longtitude} };
public class Address
{
public int ID { get; set; }
public string companyName { get; set; }
public string address { get; set; }
public string street { get; set; }
public string houseNumber { get; set; }
public double longtitude { get; set; }
public double latitude { get; set; }
}
我的班级是这样的:
Pushpin p = new Pushpin() { Location = new Microsoft.Maps.MapControl.WPF.Location { Latitude = n.latitude, Longitude = n.longtitude} };
public class Address
{
public int ID { get; set; }
public string companyName { get; set; }
public string address { get; set; }
public string street { get; set; }
public string houseNumber { get; set; }
public double longtitude { get; set; }
public double latitude { get; set; }
}
如何将Address类中的其他数据添加到图钉中,使其看起来像这样?
您链接到的图像是一个信息框。我建议您创建一个定制的UIControl,它看起来像您想要的那样,然后将其添加到地图中,而不是尝试破解图钉类。下面是一个代码示例:
尝试使用带有背景色的网格开始并添加文本字段 Pushpin是一个ContentControl,所以您可以只设置一个适当的ContentTemplate。