Extraordinaire, une belle démonstration de la puissance du Binding sous WPF : un reader rss écris entièrement en xaml (de quoi dégouter tout le monde de mon tuto Acropolis
)
Voici le code : A tester !
<Grid xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid.Resources>
<XmlDataProvider x:Key="Blog"
Source="http://feeds.feedburner.com/SimonBoigelotWorld"/>
</Grid.Resources>
<DockPanel DataContext="{Binding Source={StaticResource Blog}, XPath=/rss/channel/item}" Width="800" Height="600">
<TextBox DockPanel.Dock="Top" Text="{Binding Source={StaticResource Blog}, BindsDirectlyToSource=true, Path=Source,
UpdateSourceTrigger=PropertyChanged}"/>
<TextBox DockPanel.Dock="Top" Text="{Binding XPath=/rss/channel/title}" FontSize="14" FontWeight="Bold"/
<TextBox DockPanel.Dock="Top" Text="{Binding XPath=/rss/channel/description}" FontSize="14" FontWeight="Bold"/>
<ListBox DockPanel.Dock="Left" DisplayMemberPath="title" ItemsSource="{Binding}" IsSynchronizedWithCurrentItem="True" Width="300"/>
<TextBox DockPanel.Dock="Top" Text="{Binding XPath=description}"/>
</DockPanel>
</Grid>