Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How are Adorners implemented in UWP?

Tags:

wpf

uwp

How are adorners implement in UWP apps? If they are implemented the same as in standard WPF what is the namespace / assembly that should be used?

like image 896
David Schmidlin Avatar asked Nov 24 '16 06:11

David Schmidlin


1 Answers

Adorners are not implemented in UWP.

An Adorner is a custom FrameworkElement that is bound to a UIElement. Adorners are rendered in an AdornerLayer, which is a rendering surface that is always on top of the adorned element or a collection of adorned elements. Rendering of an adorner is independent from rendering of the UIElement that the adorner is bound to. An adorner is typically positioned relative to the element to which it is bound, using the standard 2-D coordinate origin located at the upper-left of the adorned element.

However, AdornerLayer is not existed in UWP, we can't use Adorner in UWP apps. One alternative way in UWP might be using Popup. Popup is a general purpose container for hosting UIElements on top of existing content. Similar to Adorner, Popup is rendered in PopupRoot, which is a layer that is always on top of other elements.

For more info, please see An alternative way to create Adorner Layers in Windows 8 App. Although this article is written for Windows 8 Apps, but it should also work in UWP apps.

like image 102
Jay Zuo Avatar answered Oct 10 '22 02:10

Jay Zuo