在WPF C#中将值从子级传递到父级窗口 [英] pass value from child to parent window in wpf C#

查看:494
本文介绍了在WPF C#中将值从子级传递到父级窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

项目从mainWindow开始,我单击历史记录"按钮,这将我带到另一个窗口,说"History.xaml".当我单击"history.xaml"的打开按钮时,我在那里做了一些操作,它必须返回到其先前的窗口,并显示对其的更改.

project starts with mainWindow i click on History Button which brings me to another window say History.xaml i do some operation there when i click on open button of history.xaml it must return to its previous window, and show changes to it.

推荐答案

我实际上建议您了解MVVM模式.使用此模式将极大地帮助您分离UI和背后的逻辑.

参见例如:
- http://msdn.microsoft.com/en-us/magazine/dd419663.aspx [ ^ ]
- WPF中的MVVM模式:面向初学者的简单教程 [逐步使用Model-View-ViewModel设计模式的WPF Twitter客户端 [
What I''d actually suggest is that you get to know MVVM pattern. Using this pattern would greatly help you to separate UI and the logic behind.

See for example:
- http://msdn.microsoft.com/en-us/magazine/dd419663.aspx[^]
- MVVM Pattern in WPF: A Simple Tutorial for Absolute Beginners[^]
- WPF Twitter Client with Model-View-ViewModel Design Pattern Step by Step[^]


这篇关于在WPF C#中将值从子级传递到父级窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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