简体   繁体   English

WPF MVVM在父窗口顶部打开新窗口,并将父窗口设置为Childwindow的所有者

[英]WPF MVVM open new window on top of Parent Window and set parent window as Owner of Childwindow

My question is related to following article where you posted your answer. 我的问题与您发布答案的以下文章有关。

Ref: open child window inside a parent window in wpf using MVVM 参考: 使用MVVM在wpf的父窗口中打开子窗口

I am using MVVM framework and the technique you have mentioned in your following post 我正在使用MVVM框架以及您在以下文章中提到的技术

http://rachel53461.wordpress.com/2011/12/18/navigation-with-mvvm-2/ http://rachel53461.wordpress.com/2011/12/18/navigation-with-mvvm-2/

This is the same technique I am using to implement my WPF application. 这是我用来实现WPF应用程序的相同技术。 I am building new WPF application and want to use pure MVVM ie no code behind. 我正在构建新的WPF应用程序,并希望使用纯MVVM,即没有任何代码。 Now I want to open dialog window or Child Window on top of application window using a button click on current application window. 现在,我要使用单击当前应用程序窗口上的按钮来打开对话框窗口或应用程序窗口顶部的子窗口。 In that window I want to show some data in data grid and want to give facility to filer those data in grid to search specific data in grid and then want to give user a functionality where user can select specific row from grid and hit "OK" or "Cancel". 在该窗口中,我想显示数据网格中的一些数据,并希望提供过滤这些数据的功能以搜索网格中的特定数据,然后希望为用户提供一种功能,使用户可以从网格中选择特定的行并单击“确定”或“取消”。 Now my problem is How can I open this window on top of application window? 现在我的问题是如何在应用程序窗口顶部打开此窗口? How can I know that which record user have selected? 我怎么知道哪个记录用户选择了? and once user click "OK" or "Cancel" I want that window to go away and do some operation based on selection. 当用户单击“确定”或“取消”后,我希望该窗口消失并根据选择进行一些操作。

Do you have any sample for this scenario? 您对此场景有样本吗? Or could you give any sample for this scenario? 或者您可以为此情况提供任何示例吗? I can share my solution with you if you want. 如果您愿意,我可以与您分享我的解决方案。

Thanks in Advance. 提前致谢。

Mitesh. 米特什

It seems to me that you are at the start and need some input for learning. 在我看来,您刚开始,需要一些学习的投入。 Try the links in the following post that is marked as the answer: 尝试以下标记为答案的帖子中的链接:

MVVM: Tutorial from start to finish? MVVM:教程从头到尾?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM