문제

I am building a WPF application in C#.NET and I would like to grey out the window and display a StackPanel in the centre, if a condition is true, like the glass pane in Java. I will be selling my application so I would prefer not that have to ship another licence with it, and it really needs to be free.

Is there any code to let me do this?

도움이 되었습니까?

해결책

Just apply a MonochromeEffect from the WPF Shader Effect Library whenever you popup a dialog:

When opening a dialog:

Application.Current.MainWindow.Effect = new MonochromeEffect() { FilterColor = Color.FromArgb(255, 90, 90, 90) };

When closing a dialog:

Application.Current.MainWindow.Effect = null;
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top