I am trying to use the SearchBox control introduced in Windows 8.1, but I cannot figure out how to display the image in the result sentences. Suggestions will appear, but the space in which the image should be remains empty:

Here is my xaml:
<SearchBox SuggestionsRequested="SearchBox_SuggestionsRequested" />
And my code is:
private async void SearchBox_SuggestionsRequested(SearchBox sender, SearchBoxSuggestionsRequestedEventArgs args) { var deferral = args.Request.GetDeferral(); try { var imageUri = new Uri("ms-appx:///test.png"); var imageRef = await StorageFile.GetFileFromApplicationUriAsync(imageUri); args.Request.SearchSuggestionCollection.AppendQuerySuggestion("test"); args.Request.SearchSuggestionCollection.AppendSearchSeparator("Foo Bar"); args.Request.SearchSuggestionCollection.AppendResultSuggestion("foo", "Details", "foo", imageRef, "Result"); args.Request.SearchSuggestionCollection.AppendResultSuggestion("bar", "Details", "bar", imageRef, "Result"); args.Request.SearchSuggestionCollection.AppendResultSuggestion("baz", "Details", "baz", imageRef, "Result"); } finally { deferral.Complete(); } }
Did I miss something?
Additional information:
I tried debugging it using XAML Spy; each ListViewItem clause has its own Content for the Windows.ApplicationModel.Search.Core.SearchSuggestion instance. On these SearchSuggestion objects SearchSuggestion I noticed that the Text , Tag , DetailText and ImageAlternateText set to their correct value, but the Image property is null ...
EDIT: Thus, it is obvious that AppendResultSuggestion accepts only an instance of RandomAccessStreamReference , and not any other implementation of IRandomAccessStreamReference . I think this is a mistake because it is incompatible with the fact that the method signature is passed. I submitted it to Connect , vote for it if you want it to be fixed!
source share