Windows Phone 7中的图钉点击事件错误?

时间:2012-06-14 06:11:10

标签: windows-phone-7 windows-phone-7.1

private void Pushpin_Tap(object sender, 
        System.Windows.Input.GestureEventArgs e)
    {
        var _ppmodel = sender as Pushpin;
        ContextMenu contextMenu = 
            ContextMenuService.GetContextMenu(_ppmodel);
        contextMenu.DataContext = _viewModel.Pushpins.Where
            (c => (c.Location 
                == _ppmodel.Location)).FirstOrDefault();
        if (contextMenu.Parent == null)
        {
            contextMenu.IsOpen = true;
        }
    }

这里的情况我得到的错误就像“没有定义”。请告诉我

1 个答案:

答案 0 :(得分:2)

确保文件中包含正确的using语句

using System.Linq;