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

c - Calling a function within a loop -

vb.net - Unbound DataGridView add row with checkbox error -

How i fill combobox items in Radgridview manually using in vb.net -