RssReader en Pure Xaml

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 Cry)

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>

Posted on 10/08/2007 13:40:00 by Togis

Permalink | Commentaires (0) | Post RSSRSS comment feed |

Categories: General | .NET 3.5 | WPF | Tips | Binding

Tags:

Actuellement noté 1.0 par 1 personne(s)

  • Currently 1/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Billets liés

Ajouter un commentaire


(Affichera votre icône Gravatar)  

  Country flag





Live preview

novembre 21. 2008 18:34