WPF MVVM Modal Overlay Dialog only over a View (not Window)

前端 未结 3 1599
旧巷少年郎
旧巷少年郎 2020-12-07 12:07

I\'m pretty much new to the MVVM architecture design...

I was struggling lately to find a suitable control already written for such a purpose but had no luck, so I r

3条回答
  •  [愿得一人]
    2020-12-07 12:16

    I have a custom open source FrameworkElement on my GitHub page 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.

提交回复
热议问题