扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:陶刚编译 来源:天极网 2007年11月4日
关键字:
<StackPanel> <TextBlock DockPanel.Dock="Left" FontSize="18" FontWeight="Bold" Margin="10" HorizontalAlignment="Left"> Titles </TextBlock> <ListBox HorizontalAlignment="Left" Margin="10,0,10,10" Width="300" Background="LightYellow" ItemsSource="{Binding Source={StaticResource RSSData}, XPath=item}" ItemTemplate="{StaticResource RSSTemplate}" SelectionChanged="TitleChanged" /> </StackPanel> |
<StackPanel> <TextBlock DockPanel.Dock="Left" FontSize="18" FontWeight="Bold" Margin="10" HorizontalAlignment="Left"> Description </TextBlock> <DockPanel HorizontalAlignment="Left" Name="dpDescription" Width="500"> <TextBlock Name="txtDescription" DockPanel.Dock="Top" FontSize="Small" HorizontalAlignment="Left" TextWrap="wrap" Margin="10,0,10,10" Background="Black" Foreground="White" TextContent="{Binding XPath=description}" /> </DockPanel> <DockPanel HorizontalAlignment="Left" Name="dpURL" Width="500" > <TextBlock Name="txtURL" DockPanel.Dock="Top" FontSize="Small" HorizontalAlignment="Left" TextWrap="wrap" TextContent="{Binding XPath=link}" Margin="10,10,10,10" Foreground="Blue"/> </DockPanel> </StackPanel> </DockPanel> </Page> |
图4:显示详细描述信息。被选中的RSS项的描述信息和 |
Partial Public Class Page1 Inherits Page Private Sub TitleChanged(ByVal sender As Object, _ ByVal args As SelectionChangedEventArgs) Dim lstbox As ListBox = sender If lstbox.SelectedItem IsNot Nothing Then dpDescription.DataContext = lstbox.SelectedItem dpURL.DataContext = lstbox.SelectedItem End If End Sub End Class |
<XmlDataSource x:Key="RSSData" Source="RSS.xml" XPath="/rss/channel" /> |
<XmlDataSource x:Key="RSSData" Source="http://services.devx.com/outgoing/devxfeed.xml" XPath="/rss/channel" /> |
濡傛灉鎮ㄩ潪甯歌揩鍒囩殑鎯充簡瑙T棰嗗煙鏈€鏂颁骇鍝佷笌鎶€鏈俊鎭紝閭d箞璁㈤槄鑷抽《缃戞妧鏈偖浠跺皢鏄偍鐨勬渶浣抽€斿緞涔嬩竴銆�