none
wpf NavigationWindow禁止键盘导航 RRS feed

答案

全部回复

  • 你好,

    可以禁用的。请参考:

    yourNavigationWindow.Navigating += OnNavigating;
    
    // ...
    
    void OnNavigating(object sender, NavigatingCancelEventArgs e)
    {
        if(e.NavigationMode == NavigationMode.Refresh)
            e.Cancel = true;
    }  
    谢谢!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2014年8月15日 6:00
    版主
  • 你好,

    可以禁用的。请参考:

    yourNavigationWindow.Navigating += OnNavigating;
    
    // ...
    
    void OnNavigating(object sender, NavigatingCancelEventArgs e)
    {
        if(e.NavigationMode == NavigationMode.Refresh)
            e.Cancel = true;
    }  
    谢谢!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    是的,我也是这样做的,但是这样做我就无法在代码中使用NavigationService.Goback()了

    2014年8月17日 10:14
  • 你好,

    请参考下: http://msdn.microsoft.com/zh-cn/library/system.windows.navigation.navigationmode(v=vs.110).aspx

    我想你应该把 NavigationMode.Back 也禁用了吧。如果上述内容无法帮助到你,建议提供一下你的实现代码。

    谢谢!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    2014年8月18日 2:52
    版主