RaisePropertyChanged(字符串属性名称,T oldValue,T newValue,bool 广播)
我试图让 RaisePropertyChanged
正常工作,但无法正常工作。
我并没有在任何现实场景中实现它,只是为了学习它。如果我以通常的方式进行广播,那么它就会起作用 Messenger.Default.Send
所以我想知道我缺少什么使用 RaisePropertyChanged
提前致谢。
问候 拉吉
I was trying to get the RaisePropertyChanged<T>(string propertyName, T oldValue, T newValue, bool broadcast)
working but could not get it to work.
I am not implementing it in any real world scenario but just for learning it. If I raise broadcast the usual way only then it worksMessenger.Default.Send<PropertyUpdateeMessage>(new PropertyUpdateeMessage("test"));
So i am wondering what am i missing to use RaisePropertyChanged<T>(string propertyName, T oldValue, T newValue, bool broadcast)
Thanks in advance.
Regards
Raki
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这也花了我一些时间才弄清楚。基本上,您必须将您正在注册的消息与您正在发送的消息进行协调,但关于它的文档并不多。
我有一个完整的工作示例此处,但以下是简而言之:
首先,注册 PropertyChangedMessage,指定总线上正在发生的类型
然后在主 VM 的属性更改时发送消息
在发送消息并注册以收听消息时,您可以使用一些消歧选项,但这就是方法基础工作有效。
This took me a bit to figure out too. Basically you have to coordinate the message you're registering with the message you're sending, but there isn't a lot of documentation about it.
I have a full working sample here, but here's the info in a nutshell:
First, register for the PropertyChangedMessage specifying the type that's going on the bus
Then send the message out when the main VM's property changes
There are some disambiguation options you can use when sending out the message and registering to hear it, but this is how the basics work.