private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam, IntPtr lParam, ref bool handled) { // handle the message for DWM when the aero glass is turned on or off if (msg == WM_DWMCOMPOSITIONCHANGED) { if (GlassHelper.IsGlassEnabled) { // Extend glass Rect bounds = VisualTreeHelper.GetContentBounds(listView1); GlassHelper.ExtendGlassFrame(this, new Thickness(bounds.Left, bounds.Top, bounds.Right, bounds.Bottom)); } else { // turn off glass... GlassHelper.DisableGlassFrame(this); } handled = true; } return(IntPtr.Zero); }
void Window1_SourceInitialized(object sender, EventArgs e) { Rect bounds = VisualTreeHelper.GetContentBounds(listView1); GlassHelper.ExtendGlassFrame(this, new Thickness(bounds.Left, bounds.Top, bounds.Right, bounds.Bottom)); }