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
Post a Comment