I have class Employee which is something like this.
class Emp
{
int EmpID;
string EmpName;
string ProjectName;
}
I have a list<employee> empList
populated and want to show it inside the list box.
I set the itemsource property of the listbox to the empList
and my XAML code is as follows
<ListBox Name="lbEmpList">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<Label Content="{Binding Path=EmpID}"></Label>
<Label Content="{Binding Path=EmpName}"></Label>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
needless to say this does not work...any pointers to as what i am doing wrong would be helpful.. thank you in advance