AdornerUIManager.Click Event
Fires when a user clicks any element owned by this Adorner Manager.
Namespace: DevExpress.Utils.VisualEffects
Assembly: DevExpress.Utils.v24.1.dll
NuGet Packages: DevExpress.Utils, DevExpress.Wpf.Core
Declaration
Event Data
The Click event's data class is MouseEventArgs. The following properties provide information specific to this event:
Property | Description |
---|---|
Button | Gets which mouse button was pressed. |
Clicks | Gets the number of times the mouse button was pressed and released. |
Delta | Gets a signed count of the number of detents the mouse wheel has rotated, multiplied by the WHEEL_DELTA constant. A detent is one notch of the mouse wheel. |
Location | Gets the location of the mouse during the generating mouse event. |
X | Gets the x-coordinate of the mouse during the generating mouse event. |
Y | Gets the y-coordinate of the mouse during the generating mouse event. |
Remarks
The code snippet below utilizes the CalcHitInfo method to identify the clicked element, and hides this element if it is “badge1”.
private void AdornerUIManager1_Click(object sender, MouseEventArgs e) {
AdornerUIManager manager = sender as AdornerUIManager;
var hitInfo = manager.CalcHitInfo(e.Location);
if (hitInfo.Element==badge1)
badge1.Visible = false;
}
Important
In Ribbon and Toolbars, users see links of BarItem objects at runtime. If the TargetElement of an Adorner Element is a Bar Item, the Adorner Manager creates shadow copies of this Element for each of the Item Links associated with this Bar Item. For this reason, the hitInfo.Element
property returns an object that differs from the source Adorner Element. To avoid confusion, we recommend that you handle the Click
event of a specific Element instead of the parent manager’s Click
event.