后退键的意外行为 [英] Unexpected behaviour of back key

查看:80
本文介绍了后退键的意外行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的应用程序中发现了一个奇怪的问题,我不确定它是否是一个问题或者是什么功能。

I found a weird problem in my app and i'm not sure if it is a problem or a feature ofWPF.

我在主页面上有一个文本框,用于介绍ID并转到另一个页面,其中包含有关该人的信息。如果数据库中不存在该ID,则会显示一条消息,询问您是否要添加该ID。好吧,如果遵循接下来的步骤,当我按后退键时,页面会从主
页面跳转到信息页面。

I have a textbox on the main page to introduce an ID and get to another page with the info about that person. If the ID doesn't exist in the DB, a message appears asking if you want to add it. Well, if the next steps are followed the page jump from the main page to the info page when I press the back key.

- 首先,我在下面介绍一个有效的ID TextBox然后按Enter键,然后按"Navigate(new InformationPage());"信息页面已打开。

-First, I introduce a valid ID at the TextBox and press enter, then through "Navigate(new InformationPage());" the info page is opened.

- 按下按钮我将返回带有导航功能的主页面。

-Pressing a button I return to the main page with the Navigate function.

- 我写了一个无效的ID,消息窗口出现询问我是否 我想创建一个具有该ID的新人。

-I write an invalid ID, the message windows appear asking me if  I want to create a new Person with that ID.

- 我按否并在主页面继续。

-I press no and continue in the main page.

- 否则,没有焦点文本框我按后退键,然后页面切换到第一步患者的信息页面。

-Now, without focus the textbox I press the back key and then the page switch to the info page of the patient of the first step.

我还没有实现对后退键的任何行为,所以我不知道为什么会产生这种效果。

I haven't implemented any behaviour to the back key, so I don't have idea why is producing this effect.

干杯,

Adrian。

推荐答案

嗨Adrian,

Hi Adrian,

你说你导航按主菜单的另一个页面按回车键,然后输入退格键返回第一页。

You said that you navigate another page from main page by press enter key, and you enter backspace key to return the first page.

要按BackSpace键,我认为它是WPF页面或框架的功能,对于此链接,您可以看到NavigationService具有Goback或GoForward方法:

For pressing BackSpace key, I think it is a feature for WPF page or Frame, for this link, you can see NavigationService has Goback or GoForward method:

https://msdn.microsoft.com/en-us/library/system.windows.navigation .navigationservice_members(v = vs.90).aspx

最好的问候,

Cherry


这篇关于后退键的意外行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆