WPF中的TreeView与Button在MVVM中单击 [英] TreeView in WPF with Button Click in MVVM

查看:391
本文介绍了WPF中的TreeView与Button在MVVM中单击的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是WPF的初学者..

我对WPF有要求。请仔细阅读附图。



http://stackoverflow.com/questions/26709963/treeview-in-wpf-with-button-click-in-mvvm [ ^ ]



1.我有3个按钮,即Root,Child,GrandChild。当我单击Root时,应该创建Root节点。单击Child时,应在root下创建子节点。当我单击GrandChild时,GrandChild节点应该在Child下创建,依此类推。

2.创建的节点应该是可编辑的。

3.当每个节点同时创建另外1个文本框应该在文本框面板中创建(与节点绑定),我可以从树视图和文本框编辑节点名称,即从两个方向编辑。



**我是WPF的初学者。我正在努力,但我无法做到这一点。所以需要你的帮助。这应该在MVVM中完成。

**我已经开始使用basic了。但这是我的要求,不能避免这种情况。所以寻求帮助...

I am Beginner in WPF..
I have an requirement in WPF. Please go through the attached image.

http://stackoverflow.com/questions/26709963/treeview-in-wpf-with-button-click-in-mvvm[^]

1. I have 3 buttons, i.e Root, Child, GrandChild. When I click on Root, Root node should get created. When I click Child, Child node should get created under root. When I click GrandChild, GrandChild node should get created under Child, and so on.
2. The nodes which get created should be editable.
3. And when Each node get created same time 1 more textbox should get created in textbox panel (Which is binded with the node), and I can edit the Node name from tree view and also from the text box i.e from both the way.

** I am Beginner in WPF. I am trying my best but I am not able to do this. So need your help. This should be done in MVVM.
** I already started with basic. But this is a requirement I got, and cant avoid this. so seeking help...

推荐答案

我们不做你的功课:这是有原因的。它就是为了让你思考你被告知的事情,并试着理解它。它也在那里,以便您的导师可以识别您身体虚弱的区域,并将更多的注意力集中在补救措施上。



亲自尝试,你可能会发现它不是和你想的一样困难!
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!


这篇关于WPF中的TreeView与Button在MVVM中单击的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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