/// <summary> /// 窗口状态改变 /// </summary> private void Window_StateChanged(object sender, EventArgs e) { if (WindowState != WindowState.Minimized) { if (WindowState == WindowState.Maximized) { WindowState = WindowState.Normal; return; } int nStyle = GlassHelper.GetWindowLong(Hwnd, -16); nStyle &= ~0x00C00000; GlassHelper.SetWindowLong(Hwnd, -16, nStyle); } GlassHelper.EnableBlurBehindWindow(ContainerB, this); }
/// <summary> /// 改变窗口大小 /// </summary> private void ContentWnd_SizeChanged(object sender, SizeChangedEventArgs e) { ContentPresenter cp = sender as ContentPresenter; Rectangle sn = Template.FindName("shadowN", this) as Rectangle; sn.Width = cp.ActualWidth + 3; Rectangle ss = Template.FindName("shadowS", this) as Rectangle; ss.Width = cp.ActualWidth + 3; Rectangle se = Template.FindName("shadowE", this) as Rectangle; se.Height = cp.ActualHeight + 3; Rectangle sw = Template.FindName("shadowW", this) as Rectangle; sw.Height = cp.ActualHeight + 3; GlassHelper.EnableBlurBehindWindow(ContainerB, this); GC.Collect(2, GCCollectionMode.Optimized); }