[UWP]从不同的线程获取ApplicationView /从不同的线程切换到全屏; [英] [UWP] Get ApplicationView from different thread / switching to fullscreen from different thread;
本文介绍了[UWP]从不同的线程获取ApplicationView /从不同的线程切换到全屏;的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
你好,
有没有办法从主应用程序线程以外的地方访问ApllicationView?  ; $
Windows :: UI :: ViewManagement :: ApplicationView :: GetForCurrentView();总是导致"找不到元素"错误,即使在"alt-enter"时也是如此。在应用程序主线程中定义的全屏切换功能完美无缺。
Best,Radek
解决方案
CoreApplicationView提供的属性可以返回应用程序的MainView或返回所有应用程序视图的集合。
获得View后即可使用其Dispatcher属性来编组一个函数,以便在视图的调度程序线程上运行。
Hallo,
Is there any way to get to the ApllicationView from other than the main app thread?
Windows::UI::ViewManagement::ApplicationView::GetForCurrentView(); always causes "element not found" error, even when the "alt-enter" fullscreen switch function defined in the main thread of the app works perfect.
Best, Radek
解决方案
The CoreApplicationView provides properties to return the app's MainView or to return a collection of all of the app's Views.
Once you have the View you can use its Dispatcher property to marshal a function to run on the view's dispatcher thread.
这篇关于[UWP]从不同的线程获取ApplicationView /从不同的线程切换到全屏;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文