ILT – How to Create a Simple ArrayList Within XAML

25-09-2012

Following is a sample to create a simple ArrayList in XAML. This most of the time serves as a simple straightforward data-source to test your controls.

<col:ArrayList>
   <sys:String>one</sys:String>
   <sys:String>two</sys:String>
   <sys:String>three</sys:String>
</col:ArrayList>

If you wondered like I did, Following is the definition of col and sys namespaces. Add these lines to the main tag (Window, UserControl, etc.) of your XAML code.

  xmlns:col="clr-namespace:System.Collections;assembly=mscorlib"
  xmlns:sys="clr-namespace:System;assembly=mscorlib"

Menol
ILT

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: