You will need to determine the type of container in the first place: -
using System.Collections.ObjectModel;
...
public class People : ObservableCollection<Person> { }
Then you need to add the namespace in which your People / Person classes are present in a line typical of Xaml that would look like this: -
<Application xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:SilverlightApplication1"
x:Class="SilverlightApplication1.App"
>
Just replace "SilverlightApplication1" with the application namespace.
Now you can: -
<Application.Resources>
<People x:Name="People">
<Person Age="2" Name="Sam" />
<Person Age="11" Name="Jane" />
</People>
</Application.Resources>
source
share