如何在wpf中清除另一个xaml文件的文本字段? [英] how to clear the text fields of another xaml file in wpf ?

查看:51
本文介绍了如何在wpf中清除另一个xaml文件的文本字段?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有2个表单,LoginInfo和CreditCardInfo。



我想在用户点击Loginfo中的OK按钮后清除CreditCardInfo中的字段。我怎么能这样做?

I have 2 forms, LoginInfo and CreditCardInfo.

I would like to clear the fields from CreditCardInfo once the user clicks the OK button that resides in Loginfo. How can I do this ?

推荐答案

你有权使用医生吗?如果是,请在用户单击按钮时使用介体从loginfo屏幕向CrediatCardInfo屏幕发送消息。 

do you have access to a medaitor. If yes, use the mediator to send a message from the loginfo screen to the CrediatCardInfo screen when a user clicks the button. 

信用卡屏幕应该"处理"消息并清除字段。

The Creditcard screen should "handle" the message and clear the fields.

如果您使用mvvm灯,棱镜那里已有一个,否则试试这个 -

If your using mvvm light, prism there is one in there already otherwise try this -

https://sachabarbs.wordpress.com/2009/03/16/mvvm-mediator-pattern/

https://sachabarbs.wordpress.com/2009/03/16/mvvm-mediator-pattern/

 


这篇关于如何在wpf中清除另一个xaml文件的文本字段?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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