c# - Cannot using Linq function with Bing API sdk on Winforms -
I am using a large API SDK on a Winform application (Winform and not WPF!).
I am able to add pushpins. I would like to remove some pushpins.
I saw some Linux method, but I am not able to compile because "first" is not found. : My error: I include in: Can anyone help me? There is a way that var pushpin = MyMapUserControl.MyMap.Children.First (p => (P. gatetype =) Typef (flowerpin) & amp; amp; ((fluffen) p) . == "Search Metallurator")); MyMapUserControl.MyMap.Children.Remove (pushpin);
There is no definition for 'first' in 'System.Windows.Controls.UIElementCollection' and no extension method 'first' 'System.Windows.Controls.UIElementCollection' has been found for the first argument.
using System.Linq;
implements the system .windows.Controls.UIElementCollection
IEnumerable but not
IEnumerable & lt; UIElement & gt; , therefore Linq methods do not apply directly because they only work on
IEnumerable & lt; T & gt; Example.
PushPin s is a
IEnumerable & lt; PushPin & gt; as "Remove" ofType :
var pushpin = MyMapUserControl.MyMap Children OFTIP & lt; Pushpin & gt; (). First (p = & gt; p tag == "FindMeLater");
Comments
Post a Comment