C# Windows Universal 10 TopMost Window

2019-03-05 17:38发布

I'm developing an Windows Universal 10 app.

Is there possible to set application as TopMost(always on top) ? like wpf or winform (TopMost property)

Thanks

3条回答
霸刀☆藐视天下
2楼-- · 2019-03-05 18:10

It's not possible UWP apps have some restrictions compared with WPF of Win32 apps(classic apps).

With uwp apps you need enable some capabilities to do something special in your app as you can see in the link uwp apps need ask for permission or they can't access or modify files directly.

https://msdn.microsoft.com/en-us/library/windows/apps/mt270968.aspx

Best Regards

查看更多
兄弟一词,经得起流年.
3楼-- · 2019-03-05 18:13

Short answer is no, there is no way as of today to make the application modal.

There is a petition going around asking for this functionality, which was requested last December but given the amount of votes it got (35 at the time this answer was written), it doesn't look like it will be taken into consideration anytime soon.

As mentioned in the comments, this functionality would be PC only so even if it was added, my assumption would be that it wouldn't work outside of the PC mode (so no tablet, mobile or surface family device support).

查看更多
聊天终结者
4楼-- · 2019-03-05 18:27

A feature called CompactOverlay mode was added in the Creators Update that supports this type of functionality. When an app window enters compact overlay mode it’ll be shown above other windows so it won’t get blocked. This allows users to continue to keep an eye on your app's content even when they are working with something else. The canonical example of an app taking advantage of this feature is a media player or a video chat app.

A blog post describing the feature can be found here

https://blogs.msdn.microsoft.com/universal-windows-app-model/2017/02/11/compactoverlay-mode-aka-picture-in-picture/

查看更多
登录 后发表回答