Drawing Adorner of a UserControl without clipping but over controls below

395 Views Asked by At

I have fields in a document that are displayed as UserControls in a WPF Window (inside tabs).

I needed to make an autosearching feature that displays results below the field.

I went with a adorner containing controls inside (a list).

The first problem is that I could not access the adorner layer for a control inside a UserControl.

I went with finding the AdornerLayer of the Window. Unfortunately if I put the adorner inside it I would not see it anywhere.

The next attempt was to put an AdornerDecorator inside the UserControl.

This worked fine if I was drawing the adorner above the control:

Above

However if I was to put the adorner under the text field the controls below would be drawn above the Adorner:

enter image description here

Is there a way to make this second "below" case work properly?

1

There are 1 best solutions below

0
Spongebrot On

Have you tried using a Popup already? Popup is also what the ComboBox uses afaik, so i think thats pretty much what you are looking for.

I guess you will not get the decorator to work as long as you add the below items after the textbox, so the will always have a higher zindex. Maybe setting Panel.ZIndex property works, but i think thats a pretty dirty solution.