1

I'm using Caliburn-Micro to build my Windows Store App, but I can't seem to find an example on how to implement the Search contract using this Library.

How can I do this?

Any help is appreciated.

Thanks.

4

1 回答 1

2

Nigel from compileexperience.com pointed out to me that Caliburn Micro has a sample with Search implemented. For those searching for this here's the solution:

On App.xaml.cs file, add the following method:

protected override void OnSearchActivated(SearchActivatedEventArgs args)
{
    DisplayRootView<SearchView>(args.QueryText);
}

Where the SearchView is your xaml created view for displaying the results. Also, on the Configure method (still on the App.xaml.cs) don't forget to register the SearchViewModel on the Container.

Create your SearchViewModel with a Parameter property. That will have your query string when you search. And voilá. It's done. Just implement or call the proper search method on the ViewModel.

You can see the sample on the Caliburn Micro code, here.

于 2013-05-02T13:44:56.443 回答