Introduction to XAML

Here's the source code, based on the Sept CTP bits:
<StackPanel xmlns="https://schemas.microsoft.com/winfx/avalon/2005" xmlns:x="https://schemas.microsoft.com/winfx/xaml/2005" Margin="10">
<StackPanel.Resources>
<XmlDataSource x:Key="Blog" Source="https://blogs.msdn.com/tims/rss.aspx"/>
<DataTemplate x:Key="TitleTemplate">
<TextBlock TextContent="{Binding XPath=title}"/>
</DataTemplate>
</StackPanel.Resources>
<Label Content="{Binding Source={StaticResource Blog}, XPath=/rss/channel/title}" FontSize="24" FontWeight="Bold" />
<Label Content="{Binding Source={StaticResource Blog}, XPath=/rss/channel/description}" FontSize="18" />
<DockPanel DataContext="{Binding Source={StaticResource Blog}, XPath=/rss/channel/item}" >
<ListBox DockPanel.Dock="Left" ItemsSource="{Binding}" ItemTemplate="{StaticResource TitleTemplate}" IsSynchronizedWithCurrentItem="True" />
<TextBox Name="Contents" Text="{Binding XPath=description}" Wrap="True" Width="Auto" />
</DockPanel>
</StackPanel>
Tim,
After attending the PDC, I've installed the Sept CTP bits. I've copied your sample (above) and it doesn't work in XAMLPAD. Am I missing something?
Here's a couple keywords that its "upset" about:
XmlDataSource --> changed to XmlDataProvider
Wrap --> removed as it just won't work.
Then another quick question... What code could I add to this sample to automatically get new RSS content and have the lists automatically update? I was trying to do things declartively... I was trying to set the source of the XmlDataProvider to be bound to a TextBox. But to no avail. Do I need to revert to code behind?
Joe
We've experienced some pain trying to make the various demos we saw at PDC05 and on various tech evang blogs work on the PDC05 "The Goods" bits because of changes to the class libs/schemas since the WinFX Beta was released. With some effort it has been possible
to figure out the changes and/or find updated demos.
However, it would be helpful if the various tech evangelists were to post updated demos that work on the PDC05 bits.
Thanks!
Erik
I got it to work with the Feb CTP. See updated code below:
<StackPanel xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
Margin="10">
<StackPanel.Resources>
<XmlDataProvider x:Key="Blog" Source="https://blogs.msdn.com/tims/rss.aspx"/>
<DataTemplate x:Key="TitleTemplate">
<TextBlock Text="{Binding XPath=title}"/>
</DataTemplate>
</StackPanel.Resources>
<Label Content="{Binding Source={StaticResource Blog}, XPath=/rss/channel/title}" FontSize="24" FontWeight="Bold" />
<Label Content="{Binding Source={StaticResource Blog}, XPath=/rss/channel/description}" FontSize="18" />
<DockPanel DataContext="{Binding Source={StaticResource Blog}, XPath=/rss/channel/item}" >
<ListBox DockPanel.Dock="Left" ItemsSource="{Binding}" ItemTemplate="{StaticResource TitleTemplate}" IsSynchronizedWithCurrentItem="True" />
<TextBox Name="Contents" Text="{Binding XPath=description}" TextWrapping="Wrap" Width="Auto" />
</DockPanel>
</StackPanel>