所以我有一个小的 WPF XAML,它可以获取我的 RSS 提要的标题并将它们放在一个 ListBox 中。
但是,加载大约需要 2 秒。
在数据存在之前,如何在 ListBox 中放置某种 AJAXy 旋转图形?
这是代码:
<Window x:Class="WpfApplication5.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300">
<StackPanel>
<StackPanel.Resources>
<XmlDataProvider x:Key="ExternalColors" Source="http://www.tanguay.info/web/rss" XPath="/"/>
</StackPanel.Resources>
<TextBlock Text="RSS Feeds:"/>
<ListBox Name="lbColor" Height="200" IsSynchronizedWithCurrentItem="True" ItemsSource="{Binding Source={StaticResource ExternalColors}, XPath=//item/title}"/>
<TextBlock Text="You selected this feed:"/>
<TextBox
Text="{Binding ElementName=lbColor, Path=SelectedValue}"
Background="{Binding ElementName=lbColor, Path=SelectedValue}">
</TextBox>
</StackPanel>
</Window>