UIElement on top of everything else
I'm trying to address a common use case of having an element render on top of everything else (think tooltip, tutorial, button prompt, etc.)
What's the best and easiest way to achieve this? I understand there's a z index property, but that doesn't work well with nested hierarchies. Googling has lead me to some Adorner stuff but I'm really lost as to how to proceed with that. Basically, I have all the behavior I need set up and working as expected, the only problem is that tooltip-like objects are sometimes obstructed by other UI elements.
Is there a way to achieve something like this with an attached property? Something like
What's the best and easiest way to achieve this? I understand there's a z index property, but that doesn't work well with nested hierarchies. Googling has lead me to some Adorner stuff but I'm really lost as to how to proceed with that. Basically, I have all the behavior I need set up and working as expected, the only problem is that tooltip-like objects are sometimes obstructed by other UI elements.
Is there a way to achieve something like this with an attached property? Something like
Code: Select all
noesis:RenderAfterEverything="{Binding IsTooltip}"
-
sfernandez
Site Admin
- Posts: 3109
- Joined:
Re: UIElement on top of everything else
Popups are rendered on top of everything else, this is how default ToolTips are implemented. So placing some UI inside a Popup element will make it show on top of everything else.
Regarding adorners, they are added to the AdornerLayer defined in the root of the Noesis View. An Adorner is usually associated with a target element (the adorner is positioned and sized as the target element) to decorate that target. For example, if you want to show some selection rectangle and info when you click something.
Hope this helps.
Code: Select all
<Grid>
...
<Popup IsOpen="{Binding ShowToolTip}">
<Border>...tooltip contents...</Border>
</Popup>
</Grid>
Code: Select all
Ptr<MyAdorner> myAdorner = MakePtr<MyAdorner>(targetElement);
AdornerLayer* layer = GetAdornerLayer(targetElement);
layer->Add(myAdorner);
Who is online
Users browsing this forum: Ahrefs [Bot], Google [Bot] and 1 guest