WinRT Launch from Search Charm

Topics: Bootstrappers & IoC, Framework Services
Dec 17, 2012 at 1:39 AM

Hi Guys,

We're running into an issue when users launch our WinRT app from the search charm. When our app is running and the users uses the search charm, there's no problem. The OnSearchActivated override in App.xaml.cs is fired and we can use the container to get an instance of the navigation service and send the user to our search results page.

However, if they use the search charm and select our app as the search target when it's not already running, there's a problem. The OnSearchActivated method is still called, however it appears that none of the normal Caliburn bootstrapping code has been run. The container itself is null and even if we directly call the Configure override to buildup the container, it still can't resolve things like the INavigationService.

Do you know why that might be and if there's anything we can do to support this scenario?

Thanks,

Kevin Kuebler

Dec 17, 2012 at 4:05 PM

I think you have to call Initialise() instead of Configure().

On WinRT Caliburn.Micro is not doing any bootstrapping before you call DisplayRootViewFor() or DisplayRootView().
In the HelloWinRT sample it is shown in OnShareTargetActivated().

Hope this helps.

Dec 19, 2012 at 3:16 AM

Thanks. It was actually the call to DisplayRootViewFor that I was missing. I was trying to just get a reference to the navigation service and navigating with that. That doesn't work, which makes sense now that I think about it, since no root view has been displayed at that point.