mvvm和c#中的命令 [英] Commands in mvvm and c#

查看:114
本文介绍了mvvm和c#中的命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个只有键盘可用的项目(没有鼠标),所以我不能使用像按钮这样的控件。我遇到的问题是我可以使用命令在main_view_model上浏览我的视图。但是,当我加载我的视图时,我必须使用相同的键盘在子视图上执行操作。任何想法?

I am working on a project where only keypad is available(no mouse), so I cannot use controls like buttons. The problem i am having is I can use commands to navigate through my views on the "main_view_model". However, when I load my views, I have to use the same keypad to do stuff on the child view. Any Ideas?

推荐答案

我的理解是什么。你试图在不使用鼠标的情况下开发网站。



这样,如果你在文本框中输入任何文本并想要搜索任何值(假设),那么你需要点击一个按钮来点开活动。



就这样。据我所知,你应该使用jQuery按钮代码。您可能知道点击的按钮可以通过jQuery代码识别。


下面的
只是输入键按下文本搜索的一个例子。

What I understood is. you are trying to develope a website without using the mouse.

In this way if you enter any text in textbox and want to search any value(Assumed) then you need a button to click to fire the event.

so in this way. in my knowledge you should use jQuery button codes. as you might know that the buttons clicked can be identified by jQuery code.

below is just an example of enter key pressing on text search.


' #txtSearchProdAssign')。keypress(function(e){
var key = e.which;
if (key == 13 // < span class =code-comment>输入密钥代码
{
('#txtSearchProdAssign').keypress(function (e) { var key = e.which; if(key == 13) // the enter key code {


' < span class =code-string> input [name = butAssignProd]')。click();
return false ;
}
});
('input[name = butAssignProd]').click(); return false; } });





所以关键== 13对于Enter,这样你可以找到其他键

使用这个 LINK 用于关键参考,并输入If条件并制作自己的命令。



希望这有帮助



so key==13 is for Enter, in this way you can find for other keys
use this LINK for key reference and put the If condition and make your own commands.

Hope this helps


这篇关于mvvm和c#中的命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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