I have a WPF Window with WindowStyle set to none. Is there some way I can force this window to drop a shadow (like the one you get when WindowStyle is not none)? I don’t want to set AllowTransparency to true, because it affects the performance. And I also don’t want to disable hardware rendering (I read somewhere that transparency performs better with it disabled).
Share
I have written a little utility class that is able to do exactly what you want: drop a standard shadow over a borderless
Windowbut havingAllowsTransparencyset tofalse.You just have to call the
DropShadowToWindow(Window window)method. It is preferred that you make this call just after the window’s constructor’sInitializeComponent(), but it will work even if you call it after the window is shown.