I have been trying to learn Visaul C#. Lately, I have been focusing on WPF. Here is the link to the tutorial I have been working on:
http://msdn.microsoft.com/en-us/library/vstudio/ms752299(v=vs.110).aspx
The application should let you view a person's expenses if you select their name and click the View button. Unfortunately, the expenses are not displayed. I keep getting this error message:
System.Windows.Data Error: 50 : XmlDataProvider has inline XML that does not explicitly set its XmlNamespace (xmlns="").
I thought that xmlns needed to be left blank, so the app could navigate down the XAML. Here is the code for Grid resource that I made:
<Grid.Resources>
<!-- Expense Report Data -->
<XmlDataProvider x:Key="ExpenseDataSource" XPath="Expenses">
<x:XData>
<Expenses xmlns="">
<Person Name="Mike" Department="Legal">
<Expense ExpenseType="Lunch" ExpenseAmount="50" />
<Expense ExpenseType="Transportation" ExpenseAmount="50" />
</Person>
<Person Name="Lisa" Department="Marketing">
<Expense ExpenseType="Document Printing" ExpenseAmount="50" />
<Expense ExpenseType="Gift" ExpenseAmount="125" />
</Person>
<Person Name="John" Department="Engineering">
<Expense ExpenseType="Magazine Subscription" ExpenseAmount="50" />
<Expense ExpenseType="New Machine" ExpenseAmount="600" />
<Expense ExpenseType="Software" ExpenseAmount="500" />
</Person>
<Person Name="Mary" Department="Finance">
<Expense ExpenseType="Dinner" ExpenseAmount="100" />
</Person>
</Expenses>
</x:XData>
</XmlDataProvider>
<!-- Name item template -->
<DataTemplate x:Key="nameItemTemplate">
<Label Content="{Binding XPath=@Name}"/>
</DataTemplate>
</Grid.Resources>
Can anyone give me any hint about what is going wrong?
Thanks