How to make a WPF window be on top of all other windows of my app (not system wide)?

后端 未结 19 3028
南笙
南笙 2020-12-14 05:42

I want my window to be on top of all other windows in my application only. If I set the TopMost property of a window, it becomes on top of all windows of al

19条回答
  •  南笙
    南笙 (楼主)
    2020-12-14 05:56

    Simple to do it in XAML, and surprised that nobody posted this answer yet. In the following example, the Window is defined in a ResourceLibrary (notice the x:Key), but you can also use this XAML binding on a standalone Page-style WPF resource.

    
        
    
    

提交回复
热议问题