3

I'm trying to do some smart resizing of XAML elements when the software keyboard is opened in my WP8 app, and for some reason the InputPane.Showing/Hiding events are never getting called. Inside my OnNavigatedTo override, 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;
};

Putting breakpoints into the lambda expressions, I find that the code is never getting called. No exceptions are being thrown, and nothing else in the app seems to be malfunctioning. Does anyone know why these events would not be being triggered? The input pane is opened either when I tap a TextBox for data entry, or tap a TextBlock which then focuses the TextBox for that data entry.

4

2 回答 2

2

我在 Microsoft Connect 上添加了一个错误报告,如果您也有兴趣解决此问题,请点赞: https ://connect.microsoft.com/VisualStudio/feedback/details/814487/allow-inputpane-events-to-在非本机 Windows 电话 8 应用程序中触发

于 2014-01-23T10:45:24.443 回答
1

InputPane的文档声明它仅支持“仅本机应用程序”。为了确定何时显示虚拟键盘,您需要处理GotFocusLostFocus事件。

于 2013-10-18T15:36:49.480 回答