Since V5 the context menu displays in random area at the top left corner of the map.
Anyone else facing this problem ?
...
ContextMenu menuOnMap = new ContextMenu("myContextMenu", 280);
ContextMenuItem infosItem = new ContextMenuItem("Infos ?");
infosItem.Click += new EventHandler<ContextMenuItemClickEventArgs>(infosItem_Click);
menuOnMap.MenuItems.Add(infosItem);
Map2.ContextMenu = menuOnMap;
...
private void infosItem_Click(object sender, ContextMenuItemClickEventArgs e)
{
CloudPopup popup;
if (!Map2.Popups.Contains("showPositionPopup"))
{
popup = new CloudPopup("showPositionPopup");
popup.AutoPan = true;
popup.AutoSize = true;
popup.HasCloseButton = true;
Map2.Popups.Add(popup);
}
else
{
popup = (CloudPopup)Map2.Popups["showPositionPopup"];
}
popup.ContentHtml = "<b><u>Coordonnées:</b></u>
X = " + e.Location.X.ToString() + "
Y = " + e.Location.Y.ToString() + "";
popup.Position = e.Location.GetCenterPoint();
popup.IsVisible = true;
}