adorner

Does Adorner breaks MVVM?

I'm developing a WPF app using MVVM. Most of my views have only xaml markup and nothing (except default boilerplate) on code behind. All except one view that I use adorners to "blacken" the screen when I want to make the whole screen disabled. private void Window_Loaded(object sender, RoutedEventArgs e) { //todo: transf...

WPF: Adorner Hit Testing / MouseDown Event

Hello, I have an Adorner which adornes a Border (please see screenshot below). The MouseDown Event for the Adorner is however only raised, when clicking on an element in the adorner. I need the MouseDown Event to be raised, when clicking on any place in the adorner above the adorned element. How can this be done? Do I have to add an tra...

When should I use adorners?

Hi all! WPF is great because there are many things to achieve own goals. By example, for 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 additional element. So, my question is: when should I prefer adorners to a more complex ...

Expanding adornerlayers beyond the window boundaries

Is there a way to expand the adornerlayer beyond the window boundaries? I need to create an adorner for a control that will be shown outside of the window edge. ...

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 always be available. But when I create an instance of my UserControl in code, there is n...

WPF Template: AdornedElement not showing!

I want to add some elements to a TextBox by using a Template with the extra elements and the original TextBox inserted in the right spot. I'm trying to use the AdornedElementPlaceholder just like you would do when making a Validation.ErrorTemplate But the AdornedElement is not showing up. I have simplified the example as much as possible...

WPF: Adorner not receiving any keyboard events

Hello, I have an Adorner and I want that Adorner to be able to receive keyboard events, but I'm having problems with those whole focus stuff. Can somebody please tell, what has to be done to make an adorner able to receive keyboard events? Thank you very much for any help! ...

No events passed to WPF adorner layer

I am trying to make a nice "drag and drop zone" in WPF that is displayed in the adorner layer when something is being dragged into the main application. The problem is that I do not get any events from my adorner, even though it according to documentation should receive all input events since it is in a higher z-order. To debug my probl...

AdornedElement Properties in a Trigger

I have an Adorner in XAML that I'm using for ErrorValidation. Basically I have a grid that I want to display on two conditions (if the "AdornedElement" IsFocused or IsMouseOver). Below is a code snippet where I'm binding - successfully - to the IsFocused of the AdornedElement, but as you can tell that only solves 1/2 the conditions. N...

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 ); AdornerLayer al = AdornerLayer.GetAdornerLayer( background ); al.Add( deleteBrush )...

How to give error feedback during a drag operation?

I am trying to give some visual feedback to the user during a drag/drop operation. The feedback I'm struggling with is in the case where the drag target is somehow invalid for the type of data being dragged. I'd like there to be some feedback (during the drag) which displays a small message as to why the drag would be invalid. I am tr...

WPF: Adorning a ViewModel?

I have these ViewModels: RecordViewModel, ComponentViewModel where RecordViewModel essentially is a container for several ComponentViewModels. The display of these ViewModels is currently handled by DataTemplates that look something like this: <DataTemplate DataType="{x:Type vm:RecordViewModel}" > <ItemsControl ItemsSource={Binding...

How Can I remove all adorners of a listview?

How Can I remove all adorners of a listview? I mean all adorners related to all columns ...

WPF Moving Adorner outside the AdornerLayer or Window

I have an adorner which is moving along with the mouse cursor. However as soon as the mouse moves outside the window the adorner gets cut off. Is it possible to expand the adorner layer to the whole screen or create a new adorner layer. ...

Should I be using AdornerLayer to avoid clipping my adorner off-screen?

I'm writing some WPF code involving Adorners. I'm using Josh Smith's UIElementAdorner.cs (found in the project on his Infragistics Blog). I'm adorning with a blurb of information text. I need to place my adorner smartly, so that it does not clip off the screen. What's the best way to find out if I'm going to clip? I'm using the ...

Error Adorner in a Scrollviewer

I'm trying to ensure that my error adorners don't get clipped by my scrollviewer's bounds. I have a series of textboxes that are at the edge of a fixed width scrollviewer (no horizontal scrolling, only vertical). I then have adorners that flag textboxes with errors. The problem is that the adorners get clipped at the edge of the scroll...

Hook into the moment when the Collection is filled and removing then the Loading Adorner?

Hello, I am grouping data in a WPF DataGrid. that takes very long so I want to show a Loading bar/adorner. I am using MVVM. How would you remove/fade out the loading bar/adorner when the datagrid has finished the grouping. How do I get the moment when the Data is grouped 100% ? Can this somehow be set in xaml or retrieved etc... ? ...

WPF: Validation.ErrorTemplate not hidden when adorned control (TextBox) hidden

I have a TextBox that gets hidden depending on whether an item is selected in a ComboBox. This part works fine. However, it also has ValidatesOnDataErrors set and if the TextBox has an error present, then when the TextBox gets hidden, the ErrorTemplate (in the Adorner layer) remains. I think I understand that because the ErrorTemplat...

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 at liberty to remove this behavior. This is implemented using an adorner containing a Rect...

WPF adorner fails

Cannot add logical and visual child to Adorner class. Blockquote I have a WPF application.Infragistics grid and xamtext boxes are using. I implement the concept of history.ie when user is click on the cell or textbox, a suggestion box is being shown which contains the previous values.Sample screen shot is attaching. Blockquote ...