Part 20: Implementing the Search Contract
- Posted: Oct 26, 2012 at 9:30 AM
- 8,984 Views
- 9 Comments
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Right click “Save as…”
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums,
or
Contact Us and let us know.
Follow the Discussion
Oops, something didn't work.
What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in. You need to be signed in to Channel 9 to use this feature.What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in and view them all on your notifications page.sign up for email notifications?
the app did not show result for finding sugar from outside the app i tried rebuilding the solution too
@ambar007: Hmm... After re-building, did you re-run the application, then close it, then search? I'm sure this is a timing / sequence of events issue.
Hello Sir , If you can help me to resolve errors due to which my App fails on windows app certification kit. Here are the details.
FAILED
I have posted this query on forum also but haven't got any replies yet.
If i talk about my App, It's almost the similar like this "Contoso Cookbook" difference is that it does have only functionality taught till this video( 3 Labs on Hands on Labs ).
And i am also facing error while searching from outside App. Search doesn't happen on the first try and after 1 try search result appears but when i click on item App restarts i just followed all steps shown on Lab of Search cotract and i dont find anything wrong in source code(have included event handler as shown in video). .
Event handler which defined is as below:
private void OnItemClick(object sender, ItemClickEventArgs e)
{
// Navigate to the page showing the animal that was clicked
this.Frame.Navigate(typeof(ItemDetailPage), ((AnimalDataItem)e.ClickedItem).UniqueId);
}
I think it may be the reason of failure of my App in 1st test as it restarts after clicking on item after search is made outside of App.
Thank you.
@nishant07: Just so you know, I've asked someone at Microsoft to see if they can comment further. I'm not familiar with this issue myself. Crossing my fingers for a speedy resolution.
ok.. Thank You
@nishant07: I have a reply from someone and I'll quote it: "I am not following this. Sorry ... Is the problem that "Search" is not working?? Or the problem with Certification Kit. I would tell them to download the camp in a box and try the solutions. It could be there is a bug on the labs, but I doubt it and sugar search just worked for me... Would that help them? If the problem is with WACK we would need their project."
It might help if you could provide more details about the exact sequence of events / a better / more thorough description of the problem you're having and the steps you've taken so far to diagnose the issue.
Thank you sir, I was facing problems with both WACK and search contract.
If i talk about search contract problem. When i try to search for Keyword from outside of app, search result appears perfectly but when i click to particular animal(item) ,app crashes and restarts. I followed your video and Hands On Labs. I found that the "OnSearchActivated method" in App.xaml.cs ,which i saw on this video has code which is different from the code in my project, but i didn't modify it , it is by default when i added search contract.
Let me paste it here:
protected async override void OnSearchActivated(Windows.ApplicationModel.Activation.SearchActivatedEventArgs args)
{
// Reinitialize the app if a new instance was launched for search
if (args.PreviousExecutionState == ApplicationExecutionState.NotRunning ||
args.PreviousExecutionState == ApplicationExecutionState.ClosedByUser ||
args.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
// Load recipe data
await AnimalDataSource.LoadLocalDataAsync();
// Register handler for SuggestionsRequested events from the search pane
SearchPane.GetForCurrentView().SuggestionsRequested +=OnSuggestionsRequested;
}
GoWild.SearchResultsPage.Activate(args.QueryText, args.PreviousExecutionState);
}
I would like to add that Search works perfectly while App is open , it doesn't happen only when i click on search result item when search is done outside of App.The code of event handler is pasted on previous comment.
Now i come to WACK problem...
I built this App on release preview and was also building packages on debug mode.But when i shifted to Windows 8 Pro and Visual Studio RTM version all test passed successfully without changing the code at all. So WACK issue has been fully resolved now. Thank you very much for helping.
But yet not finding any error in "Search contract" code. I dont think anything is wrong in code .But as this is my first app i am not sure
.Should i send you detailed code?or some file or anything you want . I just followed all steps shown on your video and as on Hands On Labs.
And also have one more question regarding sharing contract. When i share item and send a mail of it , the mail shows only description ,no image at all. does this happen or there is some mistake on code ? because result is fine and perfect as shown in video when i use "Share Target" sample app for sharing.
@nishant07: re: search contract ... admittedly, I had issues with this too. When I recompiled / rebooted / re-ran the app, it would work. I would just say that I think it's an assembly versioning issue, but I'm not really sure. What you see in the video took a couple of tried to get the right incantation.
re: sharing contract ... I've had the same experience. The mail program may not fully implement the share contract, I'm guessing. I didn't delve into it deeply enough to try and figure it out. Sorry I can't be more help ... you're as far along as I am at this point.
@BobTabor: ok sir. thank you very much...And i feel happy to tell you that despite of these issues my App got published on store yesterday and i would also like to quote that i would not have succeeded in doing that without going through this series . Thank you again for this wonderful series. I will be following your other series too.
Remove this comment
Remove this thread
close