Questions tagged [adorner]

Abstract class that represents a FrameworkElement that decorates a UIElement.

Official site.

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.

Common applications for adorners include:

  • Adding functional handles to a UIElement that enable a user to manipulate the element in some way (resize, rotate, reposition, etc.).

  • Provide visual feedback to indicate various states, or in response to various events.

  • Overlay visual decorations on a UIElement.

  • Visually mask or override part or all of a UIElement.

Windows Presentation Foundation (WPF) provides a basic framework for adorning visual elements. The following table lists the primary types used when adorning objects, and their purpose

207 questions
56
votes
1 answer

When should I use adorners?

WPF is great because there are many ways to achieve your goals. For example, from what I understand, adorners can add some controls to a UI element, but I think that the same behavior can be achieved through a custom control that contains the…
fra
  • 3,488
  • 5
  • 38
  • 61
22
votes
1 answer

WPF: Ignore mouse clicks on overlay/adorner, but handle MouseEnter event

What I really want is a version of IsHitTestVisible that ignores mouse click events but still traps mouse enter and leave events. Background: An informational overlay pops up under the control with focus whenever. This is a requirement, so I'm not…
stone
  • 8,422
  • 5
  • 54
  • 66
20
votes
1 answer

WPF Adorner Layer Outside Window

I have a WPF window with a textbox control. The control has an adorner that is made visible when the textbox has keyboardfocus. As you can see in the screenshot below, the adorner is limited to the bounds of the window. How can I make it so that the…
David Ward
  • 3,739
  • 10
  • 44
  • 66
19
votes
2 answers

Why does my adorner not re-render when the element it's applied to changes?

In a UI I'm building, I want to adorn a panel whenever one of the controls in the panel has the focus. So I handle the IsKeyboardFocusWithinChanged event, and add an adorner to the element when it gains the focus and remove the adorner when it…
Robert Rossney
  • 94,622
  • 24
  • 146
  • 218
12
votes
4 answers

GetAdornerLayer mysteriously returning null

I've been using the same bit of code for several versions of my app with no problems, but I'm now mysteriously receiving NullRerefenceExceptions with the following: this.Loaded += delegate { deleteBrush = new DeleteBrushAdorner( background ); …
devios1
  • 36,899
  • 45
  • 162
  • 260
10
votes
2 answers

How to display a progress bar on top of a control in WPF

In a WPF UserControl, I have to make to call to a WebService. I am making this call on a separate thread but I want to inform the user that the call may take some time. The WebMethod returns me a collection of objects and I bind it to a ListBox in…
Martin
  • 39,309
  • 62
  • 192
  • 278
10
votes
2 answers

When does a WPF adorner layer first become available?

I'm trying to add an overlay effect to my UserControl and I know that's what adorners are used for in WPF. But I'm a bit confused about how they supposedly work. I figured that adorner layer is implicitly handled by WPF runtime, and as such, should…
aoven
  • 2,248
  • 2
  • 25
  • 36
10
votes
3 answers

WPF Adorner Clipping

I have an ItemsControl in a ScrollViewer. The items in the ItemsControl are expanded to a DataTemplate which basically consists of an Adorner. Now the problem is, when scrolling, the Visual Children of the Adorner are visible outside the…
Andrej
  • 981
  • 8
  • 17
9
votes
2 answers

Possible to clear an adorner layer?

I might be misunderstanding the concept of adorner layers in WPF but I've managed to add a TextBlock to a StackPanel's adorner layer. How would I clear an adorner layer? So the StackPanel no longer has a TextBlock in it's adorner layer for example?
user1017882
8
votes
3 answers

WPF Drag and Drop Source Code

Almost all the questions on stackoverflow dealing with drag and drop in WPF refer back to this article. However, the source code for the article is missing. Does anyone have a copy or know where to find a copy? P.S. My main concern is this line from…
Nathan Hillyer
  • 1,959
  • 1
  • 18
  • 22
7
votes
2 answers

WPF Validation Control Template overlapping

I've got a user control with a control template to show validation errors, validation template:
hyp
  • 1,370
  • 1
  • 9
  • 21
7
votes
2 answers

Animation inside an adorner (calling OnRender)

I'm using an Adorner in .NET 3.5, and I'm able to draw by overriding OnRender, but I need the ability to redraw the adorner to change its appearance. Essentially I'm looking for a way to clear the drawing context and call OnRender again. What's the…
Jason Anderson
  • 9,003
  • 5
  • 30
  • 25
7
votes
2 answers

How to show 'Loading...' overlay while the View Model reloads the bound data

I want to do something that sounds extremely simple, yet I find it very hard to achieve. Let's assume I have some content which is bound to a slow-loading operation. For example, an observable list which is retrieved from a local SQL and takes a few…
hyankov
  • 4,049
  • 1
  • 29
  • 46
7
votes
2 answers

How can I create a custom image adorner add-in for numerical arrays in Visual Studio 2010?

I work with a lot of floating-point images, and would find it extremely useful to have an image-based representation of my arrays. I'd like to create a WPF UserControl that renders the data array (as shown below) as an image, instead of a scrollable…
lightw8
  • 3,262
  • 2
  • 25
  • 35
7
votes
4 answers

Display an Adorner over a WebBrowser control

I'm using the System.Windows.Controls.WebBrowser for various things in my app and I've noticed that adorners are cut off when they are supposed to appear over a WebBrowser. I realize that the WebBrowser control is really a wrapper around a COM…
Anderson Imes
  • 25,500
  • 4
  • 67
  • 82
1
2 3
13 14