How do I darken all screen area and glow my opened window in WPF?

后端 未结 4 464
花落未央
花落未央 2020-12-31 17:00

In WPF, how do I darken all screen area when opening a new window?

Also after the window is closed, how do I revert the temporary effect?

4条回答
  •  感情败类
    2020-12-31 17:24

    easiest way:use XAML pop-up as described below

    
    
     
    

    For more details visit below link. http://www.c-sharpcorner.com/UploadFile/mahesh/using-xaml-popup-in-wpf/

    After this to blur the main grid on eventhandler for the event which shows the pop-up,set the opacity as shown in below C# code

    if (pop.IsOpen == false)    
    {    
    pop.IsOpen = true;    
    grdMain.Opacity = 0.4;    
    }    
    else    
    {    
    pop.isopen=false;    
    }    
    

提交回复
热议问题