Thursday, December 13, 2012

Windows store App : enable type-to-search feature in other page


In your xaml code u bind these to events to page::


    Loaded="pageRoot_Loaded_1"
    Unloaded="pageRoot_Unloaded_1"


and inside these methods u have to bind and unbind ur events for keydown or keypress ::


    private void pageRoot_Loaded_1(object sender, RoutedEventArgs e)
    {
        SearchPane.GetForCurrentView().ShowOnKeyboardInput = true;
    }



This is enough for enabling for type tp search

if there is a some requirement u can also use the following by setting it to false


    private void pageRoot_Unloaded_1(object sender, RoutedEventArgs e)
    {
        SearchPane.GetForCurrentView().ShowOnKeyboardInput = false;
    }