Monday, October 8, 2012

How do I remove all objects in a List on Windows Phone 7 Silverlight C#?

How do I remove all objects in a List on Windows Phone 7 Silverlight C#?

How do I remove all objects in a List on Windows Phone 7 Silverlight C# (latest SDK)?

The method myList.RemoveAll() does not exist.

Thanks.

Answers & Comments...

Answer: 1

You should be able to use:

myList.Clear() 
by : Jayhttp://stackoverflow.com/users/114994

Answer: 2

I can think of three ways to do this,

  • myList.Clear();
  • myList = null;
  • myList = new List<yourType>();
by : robert tonnessenhttp://stackoverflow.com/users/1018442




No comments:

Post a Comment

Send us your comment related to the topic mentioned on the blog