/// <summary> /// 启用毛玻璃 /// </summary> protected void ActiveBlur(bool flag) { if (flag) { if (!IsInitialized) { SourceInitialized += YT_Window_SourceInitialized; } else { YT_Window_SourceInitialized(null, null); } } else { BlurEffect.EnableBlur(HandleHelper.GetVisualHandle(this), AccentState.ACCENT_DISABLED); } }
private void YT_Window_SourceInitialized(object sender, EventArgs e) { BlurEffect.EnableBlur(HandleHelper.GetVisualHandle(this), AccentState.ACCENT_ENABLE_BLURBEHIND); }