This question already has an answer here:
- Cannot convert lambda expression to type 'System.Delegate' 3 answers
I'm having a problem that I can't seem to figure out, although its kind of a standard question here on Stackoverflow.
I'm trying to update my Bing Maps asynchronously using the following code (mind you, this is from an old Silverlight project and does not seem to work in WPF)
_map.Dispatcher.BeginInvoke(() =>
{
_map.Children.Clear();
foreach (var projectedPin in pinsToAdd.Where(pin => PointIsVisibleInMap(pin.ScreenLocation, _map)))
{
_map.Children.Add(projectedPin.GetElement(ClusterTemplate));
}
});
What am I doing wrong?