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

This entry was posted in WPF and tagged , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *