如何获取ContentItem.Value? [英] How to get ContentItem.Value?

查看:92
本文介绍了如何获取ContentItem.Value?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 

我有一个ContentItemPresenter.ContentItem = myContentItem. myContentItem.View是一个TextBox.用户更改后如何获取TextBox.Text?

I have a ContentItemPresenter.ContentItem = myContentItem. myContentItem.View is a TextBox. How can I get the TextBox.Text when the user change it?

请注意,我只能通过ContentItemPresenter.ContentItem对象访问它.

Please note that I can access it only through ContentItemPresenter.ContentItem object.

推荐答案

您可以将内容项转换为INotifyPropertyChanged,然后侦听当StringValue属性更改时.然后获取StringValue的值,这将是在文本框"控件中输入的文本.
You can cast the content item to INotifyPropertyChanged and then listen for when the StringValue property changes. Then get the value of StringValue and that will be the text that was entered into the Text Box control.


这篇关于如何获取ContentItem.Value?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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