InputPane.Showing / Hiding never called

I am trying to do a sensible resizing of XAML elements when the software keyboard opens in my WP8 app and for some reason the InputPane.Showing / Hiding events are never called. Inside my override OnNavigatedTo

, I have the following:

InputPane inputPane = InputPane.GetForCurrentView();
inputPane.Showing += (InputPane sender, InputPaneVisibilityEventArgs args) =>
{
    outputTextScroller.Height -= args.OccludedRect.Height;
};

inputPane.Hiding += (InputPane sender, InputPaneVisibilityEventArgs args) =>
{
    outputTextScroller.Height += args.OccludedRect.Height;
};

      

By placing breakpoints in lambda expressions, I found that the code was never called. No exceptions are thrown and nothing else in the application works. Does anyone know why these events won't fire? The input panel opens either when the TextBox is clicked for data input, or when the TextBlock is clicked, which then focuses the TextBox for that data input.

+3


source to share


2 answers


I have added a bug report to Microsoft Connect, please promote it if you are also interested in solving this problem: https://connect.microsoft.com/VisualStudio/feedback/details/814487/allow-inputpane-events-to-be -triggered-in-non-native-windows-phone-8-applications



+2


source


The documentation for InputPane states that it is only supported by "native applications". To detect when the virtual keyboard is shown you need to handle GotFocus and LostFocus .



+1


source







All Articles