值转换器可以在不同的线程上执行吗?
如果我的 Binding.IsAsync = true,那么为什么我的 ValueConverter 不在同一个“假定非 UI”线程上执行?
有任何方法让它在该线程上执行吗?
If my Binding.IsAsync = true, then why doesn't my ValueConverter execute on the same "supposingly non-UI" thread?
Is there any way to make it execute on that thread?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
IsAsync 的文档建议只有您的属性访问器才会被异步调用。我能找到的没有提到转换器。我不完全确定这是否是因为技术上不可能在 BG 线程上调用转换器,或者可能它被忽略了。在我看来,这应该是可能的。
作为解决方法,您可以将转换器执行的任何繁重逻辑移至该属性中,或者完全移至一个单独的属性中吗?
The documentation for
IsAsync
suggests that only your property accessors will be called asynchronously. No mention of converters is made that I can find. I'm not entirely sure whether this is because it's technically not possible to call the converter on the BG thread, or perhaps it was overlooked. It seems to me that it should be possible.As a workaround, can you move any heavy logic being performed by your converter into the property, or perhaps into a separate property altogether?