PRISM是否可以在单独的UI线程中调用WPF表单(或视图) [英] Is it possible from PRISM to invoke a WPF form (or a view) within a Separate UI Threads

查看:148
本文介绍了PRISM是否可以在单独的UI线程中调用WPF表单(或视图)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要有关如何从Prism 4-WPF应用程序打开新窗口到新线程的信息.

I need information on how to open a new window from Prism 4 - WPF application into a new thread.

推荐答案

您无法在新表单上打开表单线程.它们必须驻留在UI线程上,否则所有事情都会中断.我假设您必须在不同的线程上进行处理-这里的窍门是将View绑定到ViewModel,并让ViewModel在后台线程上执行处理,然后将结果调用回View(位于View上). UI线程).
You can''t open forms onto new threads. They must reside on the UI thread otherwise all sorts of things break. I assume that you have processing that must occur on a different thread - the trick here is to bind your View to a ViewModel, and have that ViewModel perform the processing on a background thread, invoking the results back to the View (which resides on the UI thread).


这篇关于PRISM是否可以在单独的UI线程中调用WPF表单(或视图)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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