私はこのエラーメッセージを持っています:
統合参照比較の可能性。値の比較を取得するには、左側を文字列型にキャストします
問題 :
((Pushpin)p).Tag == "locationPushpin"));
============================
double Dlat = Convert.ToDouble(g_strLat);
double Dlon = Convert.ToDouble(g_strLon);
this.map1.Center = new GeoCoordinate(Dlat, Dlon);
if (this.map1.Children.Count != 0)
{
var pushpin = map1.Children.FirstOrDefault(p => (p.GetType() == typeof(Pushpin) && ((Pushpin)p).Tag == "locationPushpin"));
if (押しピン != null)
{
this.map1.Children.Remove(押しピン);
}
}
画鋲の場所Pushpin = new Pushpin();
//---画鋲の位置を設定する---
locationPushpin.Tag = "locationPushpin";
locationPushpin.Location = new GeoCoordinate(Dlat, Dlon);
locationPushpin.Content = new Ellipse()
{
Fill = new SolidColorBrush(Colors.Orange),
//不透明度 = .8,
高さ = 40、
幅 = 30
};
locationPushpin.Width = 60;
locationPushpin.Height = 100;
this.map1.Center = new GeoCoordinate(Dlat, Dlon);
this.map1.Children.Add(locationPushpin);
this.map1.ZoomLevel = 13;
助けていただければ幸いです。ありがとう