c# - 为什么我无法覆盖 OnWindowCreated 并且看不到 ShowOnKeyBoardInput 属性?

标签 c# xaml microsoft-metro

 protected override void OnWindowCreated(WindowCreatedEventArgs args)
    {
        // Register QuerySubmitted handler for the window at window creation time and only registered once
        // so that the app can receive user queries at any time.
        SearchPane.GetForCurrentView().QuerySubmitted += new TypedEventHandler<SearchPane, SearchPaneQuerySubmittedEventArgs>(OnQuerySubmitted);
    }

似乎无法覆盖 onWindowCreated 我什至没有在 App.xaml.cs 的覆盖智能感知上看到它。我在这里错过了什么吗?我下载了一个示例搜索契约(Contract)应用程序。有人知道我错过了什么吗?

连这部分都不见了

        SearchPane.GetForCurrentView().ShowOnKeyboardInput = true;
        SearchPane.GetForCurrentView().ShowOnKeyboardInput = false;

ShowOnKeyboardInput 不存在。

为什么我不能覆盖 OnWindowCreated 并且看不到 ShowOnKeyBoardInput 属性

更新:http://code.msdn.microsoft.com/windowsapps/Search-app-contract-sample-118a92f5/view/Discussions

最佳答案

我已经找到问题所在了。

OnWindowCreated 方法在 Windows 8 RTM 版本中实现。因此,如果您仍然遇到此问题,请升级您的 Windows。

关于c# - 为什么我无法覆盖 OnWindowCreated 并且看不到 ShowOnKeyBoardInput 属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12134727/

相关文章:

c# - EF,更新不起作用,它表示自加载实体以来实体可能已被修改或删除。

c# - 使用自定义比较器调用 Distinct 时返回什么?

c# - 在 sqlite 中更新数据

c# - 用于替换字符串的正则表达式模式

c# - 为什么 Unity 会在此处抛出错误 CS0136 而 Visual Studio 2019 不会?

Windows7 上的 WPF 文本框边框

c# - 拉伸(stretch)不适用于 WPF 模板化按钮

c# - 在另一个程序集中引用 ResourceDictionary

uwp - broadFileSystemAccess UWP

installation - 在 Windows 8 上安装时如何防止应用程序出现在 Metro 上?