How do I make modal dialog for a Page in my WPF-application?

前端 未结 4 626
盖世英雄少女心
盖世英雄少女心 2020-11-29 20:35

I have a WPF Window which has a among other controls hosts a Frame. In that frame I display different pages. Is there way to make a dialog modal to only a page? When I\'m sh

4条回答
  •  囚心锁ツ
    2020-11-29 21:18

    I have a project on github which is a custom FrameworkElement that allows you to display modal content over the primary content.

    The control can be used like this:

    
        
                
            
        
    
        
            
        
    
    
    

    Features:

    • Displays arbitrary content.
    • Does not disable the primary content whilst the modal content is being displayed.
    • Disables mouse and keyboard access to the primary content whilst the modal content is displayed.
    • Is only modal to the content it is covering, not the entire application.
    • can be used in an MVVM friendly way by binding to the IsModal property.

提交回复
热议问题