I've achieved it by using the Winform class SendKeys and its method SendWait.
In order to being able to use a Winform class in a WPF app, you first must enable WindowsForms in the project setup PropertyGroup, by adding the UseWindowsForms tag
<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>net6.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
then, create your click method in the code behind.
There, the first step is to pass the focus to the WebView2 element, so that the browser is the active element when the key simulation is performed.
this.browser.Focus();
And then, call the SendKeys.SendWait method with "{F3}" as argument
System.Windows.Forms.SendKeys.SendWait("{F3}");
So, the final look is this:
private void openSearch(object sender, RoutedEventArgs e)
{
this.browser.Focus();
System.Windows.Forms.SendKeys.SendWait("{F3}");
}
and that's it.
Create your button in wpp, add the above method to its click property, run the app and press it. The browser search feature will open.
See the sample below
screenshot