I have a WPF project with only these changes from an empty project:
<TargetPlatformVersion>8.0</TargetPlatformVersion>
Windows
SearchPane.GetForCurrentView().Show("test");
When I click the button, I have an exception when calling .GetForCurrentView()
:
Element not found. (Exception from HRESULT: 0x80070490)
What can I do to diagnose it and make it work?
Details:
Note that I have no breakpoints, I'm running on Windows 8.1 and I already tried:
await BackgroundExecutionManager.RequestAccessAsync();
before;System.Runtime
, System.Runtime.WindowsRuntime
and System.Runtime.InteropServices.WindowsRuntime
I know I can use SendKeys to send Win
+ S
+ (query)
, but this is exactly what I'm trying to replace since at the moment I try to open the search charm, the Ctrl
key will be down (launched by a shortcut).
Even though some WinRT API functions can be used in a desktop app, SearchPane
cannot.
MSDN pages show whether each individual API function can be used or not in Desktop apps: http://msdn.microsoft.com/en-us/library/windows.applicationmodel.search.searchpane.aspx