title: WPF Loading Overlay using Adorners
body: <p>I want to create an easy-to-use Loading overlay. For this I wanted to use Adorners. The problem is: I want to show a progress-circle. For this I need a control.</p>
  
  <p>I tried to render the control, but I can't see anything:</p>
  
  <pre><code>        protected override void OnRender(DrawingContext drawingContext)
      {
          Size parentSize = this.AdornedElement.DesiredSize;
  
          drawingContext.DrawRectangle(new SolidColorBrush(Color.FromArgb((byte)(255 * 0.30), 0, 0, 0)), null,
              new Rect(0, 0, parentSize.Width, parentSize.Height));
  
          RenderTargetBitmap target = new RenderTargetBitmap(50, 50, 96, 96,
              PixelFormats.Pbgra32);
          target.Render(_ring);
          drawingContext.DrawImage(target,
              new Rect(parentSize.Width / 2 - target.Width / 2, parentSize.Height / 2 - target.Height / 2, target.Width, target.Height));
  
          double textUpperPos = parentSize.Height / 2 + target.Height / 2 + 10;
          target = new RenderTargetBitmap((int)parentSize.Width - 30, (int)parentSize.Height - (int)textUpperPos - 10, 96, 96,
              PixelFormats.Pbgra32);
          drawingContext.DrawImage(target,
              new Rect(parentSize.Width / 2 - target.Width / 2, textUpperPos, target.Width, target.Height));
      }
  </code></pre>
  
  <p>The gray background is visible, but none of the controls (TextBlock &amp; ProgressCircle). Is this even possible using this method? Is there a better way?</p>
  
  <p>I want an overlay which can be applied with max. 1-3 lines of code. Non-XAML.</p>
  
  <p>Thanks :)</p>