Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在bing地图图钉中显示多行文本?_C#_Wpf_Xaml_Bing Maps - Fatal编程技术网

C# 如何在bing地图图钉中显示多行文本?

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

我正在将带有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 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。