C# Windows Universal 10 TopMost Window

后端 未结 3 945
一个人的身影
一个人的身影 2021-01-19 07:00

I\'m developing a Windows 10 Universal app (UWP).

Is it possible to set application as TopMost (always on top)? Like WPF or Winforms<

相关标签:
3条回答
  • 2021-01-19 07:40

    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/

    0 讨论(0)
  • 2021-01-19 07:45

    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).

    0 讨论(0)
  • 2021-01-19 07:48

    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

    0 讨论(0)
提交回复
热议问题