Windows phone 7 windows phone 8长列表选择器重新绑定图像
我正在访问google books api,以便在我的应用程序的图书结果页面中显示缩略图。我想做的事情是,当用户立即访问图书列表时,我想显示从图像文件夹“加载”的png图像,因为从google books api加载缩略图需要一些时间。然后一个接一个的原始缩略图图像将加载到加载的图像上,给用户带来良好的体验。问题是,如何重新绑定图像(即在加载图像后,我希望加载真实的缩略图)?。这是相关代码。你知道我该怎么做吗 如果使用转换器,我不确定如何确定何时显示哪个图像Windows phone 7 windows phone 8长列表选择器重新绑定图像,windows-phone-7,windows-phone-8,windows-phone,Windows Phone 7,Windows Phone 8,Windows Phone,我正在访问google books api,以便在我的应用程序的图书结果页面中显示缩略图。我想做的事情是,当用户立即访问图书列表时,我想显示从图像文件夹“加载”的png图像,因为从google books api加载缩略图需要一些时间。然后一个接一个的原始缩略图图像将加载到加载的图像上,给用户带来良好的体验。问题是,如何重新绑定图像(即在加载图像后,我希望加载真实的缩略图)?。这是相关代码。你知道我该怎么做吗 如果使用转换器,我不确定如何确定何时显示哪个图像 <DataTempla
<DataTemplate x:Key="BooksItemTemplate">
<Grid Margin="{StaticResource PhoneTouchTargetOverhang}" Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Button Click="Button_Click_1" />
<Image Source="Images/loading.jpg" Height="150" Width="150"/>
<StackPanel Grid.Column="1" VerticalAlignment="Top">
<TextBlock Text="{Binding BookTitle}" Style="{StaticResource PhoneTextNormalStyle}" TextWrapping="Wrap" FontFamily="{StaticResource PhoneFontFamilySemiBold}"/>
<TextBlock Text="{Binding Identificationno}" Style="{StaticResource PhoneTextNormalStyle}" TextWrapping="Wrap" FontFamily="{StaticResource PhoneFontFamilySemiLight}"/>
</StackPanel>
</Grid>
</DataTemplate>
<phone:LongListSelector x:Name="bookslist"
Background="Transparent"
IsGroupingEnabled="False"
ItemTemplate="{StaticResource BooksItemTemplate}"/>
public BookCategoriesViewModel bookcategoriesvm;
public BooksListing()
{
InitializeComponent();
bookcategoriesvm = new BookCategoriesViewModel();
}
protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
base.OnNavigatedTo(e);
string categoryid = string.Empty;
if (NavigationContext.QueryString.TryGetValue("catid", out categoryid))
{
bookcategoriesvm.GetBookcategories(Convert.ToInt64(categoryid));
}
bookslist.ItemsSource = bookcategoriesvm.BooksCategoriesList;
}
PublicBookCategoriesViewModelBookCategoriesVM;
公共图书目录()
{
初始化组件();
bookcategoriesvm=新建BookCategoriesViewModel();
}
受保护的覆盖无效OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
基地。导航到(e);
string categoryid=string.Empty;
if(NavigationContext.QueryString.TryGetValue(“catid”,out categoryid))
{
bookcategoriesvm.GetBookcategories(转换为64(categoryid));
}
bookslist.ItemsSource=bookcategoriesvm.BooksCategoriesList;
}
最简单的方法可能是将两个图像放在一起(底部是“加载图像”),就像这样每当缩略图下载完毕,它就会隐藏加载的图像。