This exact same code displays correctly in the Visual Studio 2010 WPF designer but it doesn't work in the VS 2013 designer.
<Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="200" Width="300">
<Window.Resources>
<XmlDataProvider x:Key="xdata" XPath="root" IsInitialLoadEnabled="True" IsAsynchronous="False">
<x:XData>
<root xmlns="">
<item value="one" />
<item value="two" />
<item value="three" />
</root>
</x:XData>
</XmlDataProvider>
</Window.Resources>
<Grid>
<ListBox ItemsSource="{Binding Source={StaticResource xdata}, XPath=*}">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding XPath=@value}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Grid>
The VS 2010 designer correctly shows the list box with the items "one", "two", and "three". But the VS 2013 designer shows only an empty list box.
If I set the XmlDataProvider's Source property to an xml file that's part of the project, then it does display in the 2013 designer, but changes to the xml file aren't reflected in the designer until the project is rebuilt. However, in VS 2010, changes to the inline xml in the x:XData tag are immediately reflected in the designer.
What am I doing wrong? Or did Microsoft remove this behavior in 2013, expecting people to use Blend for design-time data in xaml?