c# - Error: System.Windows.Controls.UIElementCollection' does not contain a definition for 'OfType' -


i want delete ellipses wpf canvas. used method :

public void clearcircle() {     var circles = cvssurface.children.oftype<ellipse>().tolist();     foreach (var c in circles)     {         cvssurface.children.remove(c);     } } 

but, error on .oftype :

'system.windows.controls.uielementcollection' not contain definition 'oftype' , no extension method 'oftype' accepting first argument of type 'system.windows.controls.uielementcollection' found.

do need include something? i'm using .net 4.5

do need include something?....

yes, need include system.linq namespace explained here.


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -