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. : var pushpin = MyMapUserControl.MyMap.Children.First (p => (P. gatetype =) Typef (flowerpin) & amp; amp; ((fluffen) p) . == "Search Metallurator")); MyMapUserControl.MyMap.Children.Remove (pushpin);

My error:

  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.   

I include in:

  using System.Linq;   

Can anyone help me?

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.

There is a way that 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

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -