private static extern void DwmEnableBlurBehindWindow(IntPtr hWnd, ref BLURBEHIND pBlurBehind);
public static void EnableBlurBehind(this Window window, bool enable, IntPtr region, bool transition) { var blurBehind = new BLURBEHIND { Flags = (BlurBehindOptions.Enable | BlurBehindOptions.TransitionOnMaximized), Enable = enable, TransitionOnMaximized = transition }; if (enable && IntPtr.Zero != region) { blurBehind.Flags |= BlurBehindOptions.BlurRegion; blurBehind.RegionBlur = region; } DwmEnableBlurBehindWindow(new WindowInteropHelper(window).Handle, ref blurBehind); }