收款计数 [英] Collection Count

查看:75
本文介绍了收款计数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定我是在尝试做一些无法完成的事情,还是(可能是)我做错了.

我有一个包含框架,按钮和文本框的窗口.当我单击按钮时,将框架导航到页面.我在后面的代码中执行此操作,因为我想将一些数据(集合)传递到页面中.集合更改时是否可以更新窗口"上的文本框?例如,如果该窗口包含一个Employee类,并且当我单击该按钮时,我导航到一个包含该雇员的电话号码集合的页面,那么文本框是否可以指示我已向该集合中添加了新的电话号码?

谢谢.

解决方案

有一个名为INotifyPropertyChanged的接口,请尝试实现它.

因此,当对集合进行更改时,将触发该事件,您可以更新要在代码中进行的更改.

我想这应该有助于实现您想要的东西.

 


I am not sure if I am trying to do something that cannot be done or (more likely) I am doing it wrong.

I have a Window which contains a frame, buttons and textboxes.  When I click the button I navigate the frame to a page.  I am doing this in the code behind because I want to pass some data (a collection) into the page.  Is it possible to update the textbox on the Window when the collection changes?  For example, if the window contains an Employee class and when I click the button I navigate to a page containing a collection of phone numbers for that employee, can the textbox indicate that I have added a new phone number to the collection?

Thanks.

解决方案

There is a Interface called INotifyPropertyChanged try implementing it . 

So when a change is done to the collection the event will be fired you can update the changes you want to make in the code. 

I guess this should help achive what you want .

 


这篇关于收款计数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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