Created
July 5, 2012 04:11
-
-
Save karlin/3051281 to your computer and use it in GitHub Desktop.
Window Overlay Adorner Overrides
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private static readonly Brush screenBrush_ = new SolidColorBrush(Color.FromArgb(0x7f, 0x7f, 0x7f, 0x7f)); | |
protected override void OnRender(DrawingContext drawingContext) | |
{ | |
drawingContext.DrawRectangle(screenBrush_, null, WindowRect()); | |
base.OnRender(drawingContext); | |
} | |
protected override Geometry GetLayoutClip(Size layoutSlotSize) | |
{ | |
// Add a group that includes the whole window except the adorned control | |
GeometryGroup grp = new GeometryGroup(); | |
grp.Children.Add(new RectangleGeometry(WindowRect())); | |
grp.Children.Add(new RectangleGeometry(new Rect(layoutSlotSize))); | |
return grp; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment