如何从一个打开的窗口将数据发送回其在WPF开门红 [英] How to send data from an opened window back to its opener in WPF

查看:223
本文介绍了如何从一个打开的窗口将数据发送回其在WPF开门红的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在WPF我有一个窗口中打开,允许发生的一些数据选择第二个窗口。一旦选择后,然后我要提交/关闭第二/子窗口,并有数据推回开/父窗口。

In WPF I have one window opening a second window that allows some data selections to occur on. Once the selections have been made I then want to submit/close the second/sub window and have the data pushed back to the opening/parent window.

我可以把数据到从父通过公共属性的子窗口中,但还没有制定出如何把它找回来的其他方式。 ?谁能帮助,请

I can push data into the sub window from the parent via public properties, but have not worked out how to get it back the other way. Can anyone help please?

我使用的打开窗口,并设置一些属性的代码具有如下:

The code I am using to open the window and set some properties is has follows:

Dim wdwContacts As New appContacts()
wdwContacts.selClientID = selClientID
wdwContacts.selEmailToCCType = selEmailToCCType
wdwContacts.pullToAddresses = txEmailTo.Text
wdwContacts.pullCCAddresses = txEmailCC.Text
wdwContacts.Owner = Me
wdwContacts.WindowStartupLocation = Windows.WindowStartupLocation.CenterOwner
wdwContacts.Show()

的依据是,我的第一个窗口作为有一个按钮,点击时会弹出电子邮件联系人列表的电子邮件撰写页面。它带来了从第一窗口中的任何先前选定的电子邮件地址,并自动选择它们的子窗口/邮件列表。如果进一步的选择是在邮件列表中,当运算点击,进行上所做/提交/关闭按钮它推新的选择列表返回到第一/父窗口上的相关文本框。

The basis is that I have the first window as an email composition page that has a button that when clicked brings up a list of email contacts. It brings through any previously selected email addresses from the first window and auto selects them on the sub window/email list. If further selections are made on the email list, when the op clicks the done/submit/close button it pushes the new selection list back into the relevant TextBox on the first/parent window.

感谢

推荐答案

您可以设置 appContacts 属性的类,那么处理窗口的关闭事件,并读出在揭幕战中窗口的属性。

You can set properties in appContacts class, then handle the window's Close event and read those properties in the opener window.

这篇关于如何从一个打开的窗口将数据发送回其在WPF开门红的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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