I'm trying to move this WinForms code to WPF, but there is no Paint
event.
private void OnPaint(object sender, PaintEventArgs e)
{
var region = new Region(new Rectangle(0, 0, this.Width, this.Height));
var rectangle = new Rectangle(0, 0, 50, 50);
region.Xor(rectangle);
e.Graphics.FillRegion(Brushes.Black, region);
}