Ethan Allen
Ethan Allen

Reputation: 14835

How do I remove all objects in a List<string> 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.

Upvotes: 1

Views: 405

Answers (3)

JustinM
JustinM

Reputation: 1

Proper Clearing of a List Box

listName.Items.Clear(); listName.SelectedItem = null;

Upvotes: 0

robert tonnessen
robert tonnessen

Reputation: 39

I can think of three ways to do this,

  • myList.Clear();
  • myList = null;
  • myList = new List<yourType>();

Upvotes: 2

Jay
Jay

Reputation: 57959

You should be able to use:

myList.Clear()

Upvotes: 9

Related Questions