RadElement
Represents the fundamental building block of the Telerik Presentation Framework (TPF), serving as the base class for all visual and logical elements that compose Telerik controls.
Definition
Namespace:Telerik.WinControls
Assembly:Telerik.WinControls.dll
Syntax:
public class RadElement : RadObject, IDisposable, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IStylableNode
Inheritance: objectDisposableObjectRadObjectRadElement
Derived Classes:
Implements:
Inherited Members
Constructors
public RadElement()
Fields
public static RadProperty AlignmentProperty
public static RadProperty AngleTransformProperty
public static RadProperty AutoSizeModeProperty
public static RadProperty AutoSizeProperty
public static RadProperty BackgroundShapePaintModeProperty
public static RadProperty BackgroundShapeProperty
public static RadProperty BorderThicknessProperty
Tunnels when bounds changed in order to notify any children that should take special actions in this case - like RadHostItem.
public static RoutedEvent BoundsChangedEvent
public static RadProperty BoundsProperty
public static RadProperty CanFocusProperty
Routed event key for ChildElementAdded event. Bubbles when element is added
public static RoutedEvent ChildElementAddedEvent
public static RadProperty ClassProperty
public static RadProperty ClickModeProperty
public static RadProperty ClipDrawingProperty
public static RadProperty ContainsFocusProperty
public static RadProperty ContainsMouseProperty
Tunnels when the winforms control has been changed.
public static RoutedEvent ControlChangedEvent
Tunnels when the Enabled property changes in order to notify any children that should take special actions.
public static RoutedEvent EnabledChangedEvent
public static RadProperty EnabledProperty
public static RadProperty FitToSizeModeProperty
GetPropertyValueCommand
GetPropertyValueCommand
public static readonly GetPropertyValueCommand GetPropertyValueCommand
public static RadProperty IsFocusedProperty
public static RadProperty IsItemFocusedProperty
public static RadProperty IsMouseDownProperty
public static RadProperty IsMouseOverElementProperty
public static RadProperty IsMouseOverProperty
public static RadProperty MarginProperty
Get or sets the maximum size to apply on an element when layout is calculated.
public static RadProperty MaxSizeProperty
public static RadProperty MinSizeProperty
Tunnels and bubbles on MouseClick on current element
public static RoutedEvent MouseClickedEvent
Tunnels and bubbles on MouseDoubleClick on current element
public static RoutedEvent MouseDoubleClickedEvent
Tunnels and bubbles on MouseDown on current element
public static RoutedEvent MouseDownEvent
Tunnels and bubbles on MouseUp on current element
public static RoutedEvent MouseUpEvent
Tunnels and bubbles on MouseWheel on current element
public static RoutedEvent MouseWheelEvent
public static RadProperty NameProperty
public static RadProperty PaddingProperty
protected bool? paintSystemSkin
Routed event key for ParentChanged event. Tunnels when element parent changes
public static RoutedEvent ParentChangedEvent
public static RadProperty PositionOffsetProperty
public static RadProperty RightToLeftProperty
public static RadProperty ScaleTransformProperty
SetPropertyValueCommand
SetPropertyValueCommand
public static readonly SetPropertyValueCommand SetPropertyValueCommand
public static RadProperty ShapeProperty
public static readonly RadProperty ShouldPaintProperty
public static readonly RadProperty StretchHorizontallyProperty
public static readonly RadProperty StretchVerticallyProperty
public static RadProperty StyleProperty
protected int styleVersion
public static readonly RadProperty TagProperty
public static RadProperty UseCompatibleTextRenderingProperty
Tunnels and bubbles when changes the current element
public static RoutedEvent VisibilityChangingEvent
public static RadProperty VisibilityProperty
Property key of the ZIndex Property.
public static RadProperty ZIndexProperty
Properties
Gets or sets the preferred location of the element if its size is less than its parent size.
public virtual ContentAlignment Alignment { get; set; }
Gets or sets the rotation transform angle used when painting the element and its children.
public virtual float AngleTransform { get; set; }
protected virtual int AutoNumberKeyTip { get; set; }
Gets or sets a value indicating whether the element size will be calculated automatically by the layout system. Value of false indicates that the element's size will not be changed when calculating the layout.
public virtual bool AutoSize { get; set; }
public virtual bool AutoToolTip { get; set; }
Gets or sets the RadImageShape that describes the background of the element.
[Browsable(false)]
[VsbBrowsable(true)]
public RadImageShape BackgroundShape { get; set; }
Gets or sets a value indiicating when to paint the BackgroundShape.
[Browsable(false)]
[VsbBrowsable(true)]
public BackgroundShapePaintMode BackgroundShapePaintMode { get; set; }
Gets or sets the border thickness of the element. This thickness is included into the element's bounding rectangle.
public virtual Padding BorderThickness { get; set; }
Represents the rectangle which surrounds the element bounds after the rotation caused by setting the AngleTransform property to some degree. The rectangle is in parent element's coordinates.
public virtual Rectangle BoundingRectangle { get; }
Gets or sets a value corresponding to the bounding rectangle of the element. Location and/or Size portions of the bounds may be calculated automatically based on the current AutoSize and AutoSizeMode settings.
public virtual Rectangle Bounds { get; set; }
[Browsable(false)]
public bool BypassLayoutPolicies { get; set; }
Gets or sets a value indicating whether the element can receive input focus.
public virtual bool CanFocus { get; set; }
Gets a value indicating whether the element can have its own style with style conditions.
[Browsable(false)]
public virtual bool CanHaveOwnStyle { get; }
Determines whether mouse will be captured upon MouseDown event.
[Browsable(false)]
public bool CaptureOnMouseDown { get; set; }
Gets the collection of elements that are child elements in the element tree.
[Browsable(false)]
public virtual RadElementCollection Children { get; }
ChildrenHierarchy
IEnumerable<RadElement>
Enumerates entire subtree of elements (using depth-first approach), starting from this one as a root.
[Browsable(false)]
public IEnumerable<RadElement> ChildrenHierarchy { get; }
Gets or sets a string value indicating the element visual class name. It's used when a stylesheet has been applied to this element.
[StyleBuilderReadOnly]
public string Class { get; set; }
Style sheets contain groups of property settings categorized by element type and/or class, thus element "class" is used to determine whether certain style rule would be applied over an element. Generally this property is assigned by the control developer but it can be changed design time or runtime if certain element is decided to have different style class.
Specifies when the Click event should fire.
[Bindable(true)]
[SettingsBindable(true)]
public ClickMode ClickMode { get; set; }
Indicates whether the painting of the element and its children should be restricted to its bounds.
public bool ClipDrawing { get; set; }
Determines whether the element or one of its descendants currently contains the keyboard focus.
[Browsable(false)]
public bool ContainsFocus { get; }
Determines whether the element or one of its descendants currently contains the mouse.
[Browsable(false)]
public bool ContainsMouse { get; set; }
Represents the rectangle which surrounds the element bounds after the rotation caused by setting the AngleTransform property to some degree. The rectangle is in control coordinates.
public virtual Rectangle ControlBoundingRectangle { get; }
Gets the element desired size.
public SizeF DesiredSize { get; }
Gets or sets a value indicating whether the DoubleClick event will fire for this item.
[Browsable(false)]
public virtual bool DoubleClickEnabled { get; set; }
Gets or sets the DPI scale factor for the element.
public SizeF DpiScaleFactor { get; protected set; }
Gets the current state of the element.
[Browsable(false)]
public ElementState ElementState { get; }
Gets a reference to the tree object, that contains information about the scene where the element is currently visualized.
[Browsable(false)]
public virtual ComponentThemableElementTree ElementTree { get; }
Gets or sets a value indicating whether the element can respond to user interaction.
public virtual bool Enabled { get; set; }
By default, if element is currently selected when Enabled set to false, next element would be selected. Values inherits from Parent.Enabled. When a scrollable control is disabled, the scroll bars are also disabled. For example, a disabled multiline textbox is unable to scroll to display all the lines of text.
Gets or sets a value indicating the way element will fill its available size when parent element is calculating element size and location.
public virtual RadFitToSizeMode FitToSizeMode { get; set; }
Provide for use within TelerikLayoutEngine.
[Browsable(false)]
public virtual bool InvalidateChildrenOnChildChanged { get; set; }
Gets a value indicating whether the element can respond to mouse input and has input focus.
protected bool IsAbleToRespondToMouseEvents { get; }
[Browsable(false)]
public bool IsArrangeValid { get; }
Gets a value indicating if the element is visible.
[Browsable(false)]
public virtual bool IsElementVisible { get; }
Gets a value indicating whether the element has input focus.
[Browsable(false)]
public bool IsFocused { get; }
protected virtual bool IsItemHovered { get; }
Gets a value indicating whether the layout is suspended or not.
public bool IsLayoutSuspended { get; }
[Browsable(false)]
public bool IsMeasureValid { get; }
Gets or sets a value indicating whether the mouse button has been pressed when inside the bounds of the element.
[Browsable(false)]
public bool IsMouseDown { get; set; }
Gets or sets a value indicating whether the mouse has entered the bounds of the element or any of its sibling elements in the parent RadItem.
[Browsable(false)]
public bool IsMouseOver { get; set; }
Gets or sets a value indicating whether the mouse has entered the bounds of the element.
[Browsable(false)]
public bool IsMouseOverElement { get; set; }
Gets a value indicating if theme finished applying
[Browsable(false)]
public bool IsThemeApplied { get; }
Gets the count of all elements, which visibility is not Collapsed.
[Browsable(false)]
public int LayoutableChildrenCount { get; }
Gets or sets the location of the element based on the element parent rectangle. Corresponds to Bounds.Location
[Browsable(true)]
public virtual Point Location { get; set; }
Gets or sets a value corresponding to the margins of the element. Margins are not included into the element's bounding rectangle.
public virtual Padding Margin { get; set; }
Get or sets the maximum size to apply on an element when layout is calculated.
public virtual Size MaxSize { get; set; }
Get or sets the minimum size to apply on an element when layout is calculated.
public virtual Size MinSize { get; set; }
Represents the element unique name.
[Browsable(false)]
[StyleBuilderReadOnly]
public virtual string Name { get; set; }
Gets or sets a value indicating whether the element should pass the handled mouse event to the first parent element which has the ShouldHandleMouseInput property set to true.
[Browsable(false)]
public virtual bool NotifyParentOnMouseInput { get; set; }
Gets or sets the padding sizes of the element. The paddings are included into the element's bounding rectangle.
public virtual Padding Padding { get; set; }
Gets a reference to the parent element in the visual element tree.
[Browsable(false)]
public RadElement Parent { get; }
Gets or sets the offset of the origin of the coordinate system used when painting the element and its children.
public virtual SizeF PositionOffset { get; set; }
TrnslateTransform of the graphics is used prior to painting the element and after painting element children, to reset the transformation
Defines whether stylesheet rules should be applied for this element and its children, or only for this element
[Browsable(false)]
public virtual bool PropagateStyleToChildren { get; }
Gets or sets a value indicating maximum rendered frames per second.
public static int RenderingMaxFramerate { get; set; }
Gets or sets the direction of flow of the elements and whether elements are aligned to support locales using right-to-left fonts.
public virtual bool RightToLeft { get; set; }
Gets the routed event behaviors collection for this element.
[Browsable(false)]
public RoutedEventBehaviorCollection RoutedEventBehaviors { get; }
Gets or sets a value indicating the scale transform factors, when painting the element and its children.
public virtual SizeF ScaleTransform { get; set; }
[TypeConverter(typeof(RadFilteredPropertiesConverter))]
public virtual RadScreenTipElement ScreenTip { get; set; }
Gets or sets whether the children of this element should be serialized
[Browsable(true)]
public virtual bool SerializeChildren { get; set; }
Gets or sets whether the element should be serialized in designer
[Browsable(false)]
public virtual bool SerializeElement { get; set; }
Gets or sets whether the properties of this element should be serialized
[Browsable(true)]
public virtual bool SerializeProperties { get; set; }
Gets or sets an instance of the Shape object of an element. The shape of the element is both responsible for clipping the element's children and for providing its' border(s) with custom shape.
[TypeConverter(typeof(ElementShapeConverter))]
public virtual ElementShape Shape { get; set; }
Value of null (or Nothing in VisualBasic.Net) indicates that element has rectangular (or no) shape. Shape is an object that defines the bounding graphics path of an element. Graphics clip is always applied when an element has shape. Shape is considered when painting the border element, and when hit-testing an element. Some predefined shapes are available, like RoundRectShape or EllipseShape. CustomShape offers a way to specify element's shape with a sequence of points and curves using code or the design time ElementShapeEditor UITypeEditor.
Gets a value indicating if a theme should be applied
[Browsable(false)]
public virtual bool ShouldApplyTheme { get; set; }
Specifies whether the Item should handle MouseOver, MouseMove and related mouse events.
[Browsable(false)]
public virtual bool ShouldHandleMouseInput { get; set; }
By default only elements that inherit RadItem can process mouse input.
Gets or sets a value indicating whether the element should be painted.
public virtual bool ShouldPaint { get; set; }
Children visibility is not be affected.
protected virtual bool ShouldPaintUsingParentShape { get; }
Gets or sets the size of the element which is the height and width of the visual rectangle that would contain the graphics of the element. Size corresponds to element's Bounds.Size. When the AutoSize property is set to true setting the Size property to some value has no effect.
[Browsable(true)]
public virtual Size Size { get; set; }
public virtual bool StretchHorizontally { get; set; }
public virtual bool StretchVertically { get; set; }
Gets or sets the stylesheet associated with the element.
[Browsable(false)]
[TypeConverter(typeof(ComponentConverter))]
public StyleSheet Style { get; set; }
Implements:
Stylesheets provide dynamic property settings for elements' RadProperties organized into groups, each regarding a certain state of the element. State means a property has certain value. Style of an element can affect also element children. Generally element style is set through control theme, which is a holder for various styles for many controls.
[Bindable(true)]
[TypeConverter(typeof(StringConverter))]
public object Tag { get; set; }
protected virtual Type ThemeEffectiveType { get; }
public virtual string ToolTipText { get; set; }
[Browsable(false)]
[TypeConverter(typeof(ExpandableObjectConverter))]
public RadMatrix TotalTransform { get; }
[Browsable(false)]
[TypeConverter(typeof(ExpandableObjectConverter))]
public RadMatrix Transform { get; }
Gets the level of this element in the ElementTree it currently resides.
[Browsable(false)]
public byte TreeLevel { get; }
Gets a value indicating whether the AngleTransform should use the center of the object as origin for the transformation.
[Browsable(false)]
public bool UseCenteredAngleTransform { get; set; }
Determines whether to use compatible text rendering engine (GDI+) or not (GDI).
public virtual bool UseCompatibleTextRendering { get; set; }
Gets or sets the mode that describes the usage of system skinning (if available).
public virtual UseSystemSkinMode UseSystemSkin { get; set; }
Implements:
Gets or sets a value indicating element visibility.
public virtual ElementVisibility Visibility { get; set; }
Setting this property affects also the children of the element. Collapsed means the element and its children would not be painted and would not be
calculated in the layout.
This property has no effect in design-time on objects.
Gets of sets the order of painting an element compared to its sibling elements. Greater ZIndex means an element would be painted on top of other elements amongst its siblings. ZIndex changes the order of the elements in the list returned by GetChildren(ChildrenListOptions).
public virtual int ZIndex { get; set; }
Methods
Adds a property change behavior to the list of behaviors of the element.
public void AddBehavior(PropertyChangeBehavior behavior)
behavior instance - should not be null (or Nothing in VB.NET)
Behaviors can be used to specify how an element should respond when a certain element property changes. Behaviors are used internally by stylesheets when applying to an hierarchy of elements.
public void AddRangeBehavior(PropertyChangeBehaviorCollection behaviors)
list of behaviors
Registers a style setting for this instance.
protected override ValueUpdateResult AddStylePropertySetting(IPropertySetting setting)
Overrides:
Positions and sizes the element within the specified rectangular area.
public void Arrange(RectangleF finalRect)
The final rectangular area allocated for this element by its parent.
Exceptions:Thrown when finalRect contains infinity or NaN values.
Arrange is a core method in the two-pass layout system (Measure/Arrange). It is called by parent elements to position and size child elements after the Measure pass has determined the desired sizes.
This method handles layout suspension, visibility checks, arranges children through their layout panels, and ensures that layout operations are properly coordinated through the layout manager. It automatically triggers Measure if the element hasn't been measured or if measure data is invalid.
The method validates the finalRect for infinity and NaN values and respects element visibility settings. Collapsed elements skip arrangement but still record their final rectangle for reference.
Performs the core arrangement logic for the element within the specified final rectangle.
protected virtual void ArrangeCore(RectangleF finalRect)
The final rectangular area allocated for this element.
Arranges the RadElement to its final location. The element must call the Arrange method of each of its children.
protected virtual SizeF ArrangeOverride(SizeF finalSize)
The size that is available for element.
Returns:The rectangle occupied by the element. Usually finalSize. Should you return different size, the Layout system will restart measuring and rearranging the items. That could lead to infinite recursion.
In this method call to the Arrange method of each child must be made.
Sends this element at the end of its parent's z-ordered collection.
public void BringToFront()
Creates the child elements and sets their locally applied values as Default
protected virtual void CallCreateChildElements()
Determines whether the element can perform layout operation.
protected virtual bool CanExecuteLayoutOperation()
True if layout operations can be performed, false otherwise.
Determines whether the object can raise PropertyChanging and PropertyChanged notifications. Current implementation checks whether the object is disposing or is already disposed of.
protected override bool CanRaisePropertyChangeNotifications(RadPropertyValue propVal)
Overrides:
public void ClearBehaviors()
Composes a value which determines whether the element should use system skins when painting. This method will traverse the element and control tree and will end with the global UseSystemSkin property.
Called by the element when constructed. Allows inheritors to build the element tree.
protected virtual void CreateChildElements()
public void DisposeChildren()
Releases managed resources by clearing the property store and disposing value animators to prevent memory leaks.
protected override void DisposeManagedResources()
Overrides:
Called when the mouse button is pressed down over this element.
protected virtual void DoMouseDown(MouseEventArgs e)
The mouse event arguments.
Called when the mouse enters this element.
Called when the mouse hovers over this element.
Called when the mouse leaves this element.
Called when the mouse is moved over this element.
protected virtual void DoMouseMove(MouseEventArgs e)
The mouse event arguments.
Called when the mouse button is released over this element.
protected virtual void DoMouseUp(MouseEventArgs e)
The mouse event arguments.
Called when the DPI scale factor changes. Updates the scale factor and notifies child elements.
public virtual void DpiScaleChanged(SizeF scaleFactor)
The new DPI scale factor.
Provides flexible routine for traversing all descendants of this instance that match the provided filter.
public IEnumerable<RadElement> EnumDescendants(Filter filter, TreeTraversalMode traverseMode)
The filter that defines the match criteria.
traverseModeTreeTraversalModeThe mode used to traverse the subtree.
Returns:IEnumerable<RadElement>
An enumerable collection of descendant elements matching the filter.
Provides flexible routine for traversing all descendants of this instance that match the provided predicate.
public IEnumerable<RadElement> EnumDescendants(Predicate<RadElement> predicate, TreeTraversalMode traverseMode)
The filter that defines the match criteria.
traverseModeTreeTraversalModeThe mode used to traverse the subtree.
Returns:IEnumerable<RadElement>
An enumerable collection of descendant elements matching the predicate.
Provides flexible routine for traversing all descendants of this instance that match the provided predicate.
public IEnumerable<RadElement> EnumDescendants(TreeTraversalMode traverseMode)
The mode used to traverse the subtree.
Returns:IEnumerable<RadElement>
An enumerable collection of descendant elements.
Searches up the parent chain and returns the first parent of type T.
public T FindAncestor<T>() where T : RadElement
T
The first parent element of the specified type; otherwise, null.
Searches up the parent chain and returns the first parent with the provided ThemeEffectiveType.
public RadElement FindAncestorByThemeEffectiveType(Type themeEffectiveType)
The theme effective type to search for.
Returns:The first parent element with the specified theme effective type; otherwise, null.
Searches down the subtree of elements, using breadth-first approach, and returns the first descendant that matches the provided predicate.
public RadElement FindDescendant(Predicate<RadElement> criteria)
The predicate used to filter elements.
Returns:The first descendant element matching the criteria; otherwise, null.
Searches down the subtree of elements, using breadth-first approach, and returns the first descendant of the specified Type.
public RadElement FindDescendant(Type descendantType)
The type of descendant element to search for.
Returns:The first descendant element of the specified type; otherwise, null.
Searches down the subtree of elements, using breadth-first approach, and returns the first descendant of type T.
public T FindDescendant<T>() where T : RadElement
T
The first descendant element of the specified type; otherwise, null.
Attempts to set the keyboard focus to the element.
public virtual bool Focus()
True if the keyboard focus is successfully set to the element; otherwise, false.
Attempts to set the keyboard focus to the element, optionally setting parent control focus.
Provides a routine which enumerates all ancestors up in the parent chain of this element, which match the provided Filter.
public IEnumerable<RadElement> GetAncestors(Filter filter)
The filter used to match ancestor elements.
Returns:IEnumerable<RadElement>
An enumerable collection of ancestor elements matching the filter.
Provides a routine which enumerates all ancestors up in the parent chain of this element, which match the provided predicate.
public IEnumerable<RadElement> GetAncestors(Predicate<RadElement> predicate)
The predicate used to filter parents.
Returns:IEnumerable<RadElement>
An enumerable collection of ancestor elements matching the predicate.
Gets the arrange rectangle, valid for this element.
protected virtual RectangleF GetArrangeRect(RectangleF proposed)
The proposed rectangle.
Returns:The arrange rectangle for this element.
Gets the property change behaviors collection for this element.
public PropertyChangeBehaviorCollection GetBehaviors()
PropertyChangeBehaviorCollection
The collection of property change behaviors.
protected Padding GetBorderThickness(BorderPrimitive element)
Gets the rectangle which surrounds the rotated element (if having AngleTransform property set).
Allows enumerating of this element's children, using the specified options.
public IEnumerable<RadElement> GetChildren(ChildrenListOptions options)
The enumeration options to use.
Returns:IEnumerable<RadElement>
An enumerable collection of child elements based on the specified options.
Gets a list of child elements using the base type to filter the results.
public List<RadElement> GetChildrenByBaseType(Type type)
The base type to filter child elements by.
Returns:List<RadElement>
A list of child elements derived from the specified base type.
Gets a list of child elements using the type to filter the results.
public List<RadElement> GetChildrenByType(Type type)
The type to filter child elements by.
Returns:List<RadElement>
A list of child elements of the specified type.
protected virtual RectangleF GetClientRectangle(SizeF finalSize)
Gets a list with all the descendants that match the provided filter.
public List<RadElement> GetDescendants(Filter filter, TreeTraversalMode traverseMode)
The filter used to match descendant elements.
traverseModeTreeTraversalModeThe mode used to traverse the subtree.
Returns:List<RadElement>
A list of descendant elements matching the filter.
Gets a list with all the descendants that match the provided predicate.
public List<RadElement> GetDescendants(Predicate<RadElement> predicate, TreeTraversalMode traverseMode)
The predicate used to filter descendant elements.
traverseModeTreeTraversalModeThe mode used to traverse the subtree.
Returns:List<RadElement>
A list of descendant elements matching the predicate.
Returns the bounds of the area that should be invalidated when the element is invalidated.
protected RectangleF GetPatchedRect(RectangleF rect, float angle, SizeF scale)
Gets a registered routed event by name and class name.
Gets a registered routed event by name and owner type.
Gets a registered routed event by name for this element's type.
public RoutedEvent GetRegisterRoutedEvent(string eventName)
The name of the routed event.
Returns:The registered routed event if found; otherwise, null.
protected virtual IEnumerable<RadObject> GetStylableChildrenHierarchy()
IEnumerable<RadObject>
Gets the IFilter instance that may be used to filter the properties, treated as Stylable for this element.
Gets the rectangle where skin background should be painted. Defaults to BoundingRectangle.
protected virtual Rectangle GetSystemSkinPaintBounds()
The rectangle where skin background should be painted.
Retrieves the current effective value for the specified RadProperty, resolving through the property value composition hierarchy.
public override object GetValue(RadProperty property)
The RadProperty for which to retrieve the current value.
Returns:The current effective value of the property, which may come from local, style, inherited, or default value sources.
Overrides:
Gets the VisualStyleElement instance that describes the skin appearance for the element when the current OS is Windows Vista.
public virtual VisualStyleElement GetVistaVisualStyle()
The visual style element for Windows Vista.
Implements:
Gets the Visual Style Element instance that describes the skin appearance for the element when the current OS is Windows XP.
public virtual VisualStyleElement GetXPVisualStyle()
The visual style element for Windows XP.
Implements:
Determines whether there is an ancestor in this element tree that is not visible.
public bool HasInvisibleAncestor()
True if an invisible ancestor exists, false otherwise.
Hides the currently displayed screen tip.
protected virtual void HideScreenTip()
Initializes member fields to their default values. This method is called prior the CreateChildItems one and allows for initialization of members on which child elements depend.
protected virtual void InitializeFields()
Performs initialization when the element is first-time painted using system skin.
protected virtual void InitializeSystemSkinPaint()
Invalidates the element and schedules it for repainting.
public void Invalidate()
Invalidates the element and schedules it for repainting, optionally checking if layout is suspended.
public void Invalidate(bool checkSuspended)
True to check if layout is suspended before invalidating.
Invalidates the arrangement state of the element, causing it to be re-arranged during the next layout pass.
public void InvalidateArrange()
This overload calls InvalidateArrange(false), invalidating only this element. Use this method when the element's position or arrangement-affecting properties have changed.
Invalidates the arrangement state of the element and optionally its children, causing them to be re-arranged during the next layout pass.
public void InvalidateArrange(bool recursive)
True to invalidate this element and all its children; false for this element only.
InvalidateArrange marks the element as needing arrangement and adds it to the layout manager's arrange queue if layout is not currently suspended. This is typically called when properties that affect the element's position or size have changed.
The method respects the element's state and layout suspension. If layout is suspended, the invalidation is recorded but the element won't be queued for arrangement until layout is resumed.
Invalidates the measurement state of the element, causing it to be re-measured during the next layout pass.
public void InvalidateMeasure()
This overload calls InvalidateMeasure(false), invalidating only this element. Use this method when the element's content or measurement-affecting properties have changed.
Invalidates the measurement state of the element and optionally its children, causing them to be re-measured during the next layout pass.
public void InvalidateMeasure(bool recursive)
True to invalidate this element and all its children; false for this element only.
InvalidateMeasure marks the element as needing measurement and adds it to the layout manager's measure queue if layout is not currently suspended. This is typically called when properties that affect the element's desired size have changed.
The method respects the element's state and layout suspension. If layout is suspended, the invalidation is recorded but the element won't be queued for measurement until layout is resumed.
Gets a boolean value that determines whether a given element resides in the element hierarchy of this element.
public bool IsAncestorOf(RadElement element)
An instance of the RadElement class which is checked.
Returns:True if the element is a descendant of this element; otherwise, false.
Get a value indicating whether the element is a direct or indirect child of specified parent element
public bool IsChildOf(RadElement parent)
Parent to test
Returns:true if the element is child of parent, false otherwise
Determines whether a specific routed event is currently being processed.
public bool IsEventInProcess(RaisedRoutedEvent raisedEvent)
The routed event to check for processing status.
Returns:True if the event is currently being processed; otherwise, false.
Determines whether a key is an input key that should be handled by the element.
protected virtual bool IsInputKey(InputKeyEventArgs e)
The input key event arguments.
Returns:True if the key is an input key; otherwise, false.
Determines whether the element is currently in valid state. That is having a valid ElementTree reference and being in either Constructed or Loaded state.
Determines whether the specified property may be canceled.
protected override bool IsPropertyCancelable(RadPropertyMetadata metadata)
The metadata associated with the property change.
Returns:Overrides:
Removes keyboard focus from the element.
protected virtual void KillFocus()
Allows inheritors to provide custom load logic.
protected virtual void LoadCore()
Gets the location of this element in control coordinates.
Locks the bounds of the element to prevent changes during critical operations.
protected virtual void LockBounds()
Calculates the desired size of the element given the specified available space.
public void Measure(SizeF availableSize)
The available space that can be allocated to this element by its parent.
Exceptions:Thrown when availableSize contains NaN values.
Measure is the first pass of the two-pass layout system (Measure/Arrange). It determines how much space the element would like to occupy based on its content and the constraints provided by its parent.
This method handles layout suspension, validates the availableSize for NaN values, respects element visibility, and coordinates with the layout manager to ensure proper measurement sequencing. The calculated desired size becomes available through the DesiredSize property.
Collapsed elements are given zero desired size but still participate in the measurement process. The method is optimized to avoid redundant measurements when the available size hasn't changed.
Performs the core measurement logic for the element with the specified available size.
Measures the space required by the RadElement
Used by the layout system.
protected virtual SizeF MeasureOverride(SizeF availableSize)
The size that is available to the RadElement. The available size can be infinity (to take the full size of the element)
Returns:The minimum size required by the element to be completely visible. Cannot be infinity.
In this method call to the Measure method of each child must be made.
Converts mouse event arguments from control coordinates to element coordinates.
protected virtual MouseEventArgs MouseEventArgsFromControl(MouseEventArgs e)
The mouse event arguments to convert.
Returns:Mouse event arguments with coordinates relative to this element.
protected virtual void NotifyChildren(RadPropertyChangedEventArgs e)
protected virtual void NotifyInvalidate(RadElement invalidatedChild)
A callback used by the owning RadControl to notify the element for the beginning of a disposing process.
protected virtual void OnBeginDispose()
protected virtual void OnBoundsChanged(RadPropertyChangedEventArgs e)
Called when the bubble phase of a routed event occurs.
protected virtual void OnBubbleEvent(RadElement sender, RoutedEventArgs args)
The element that originally raised the event.
argsRoutedEventArgsThe routed event arguments.
Called when a child's desired size has changed.
protected virtual void OnChildDesiredSizeChanged(RadElement child)
The child element whose desired size changed.
protected virtual void OnChildrenChanged(RadElement child, ItemsChangeOperation changeOperation)
Raises the Click event.
protected virtual void OnDisplayPropertyChanged(RadPropertyChangedEventArgs e)
Raises the DoubleClick event.
The element gets notified for a change in its current ElementTree member.
protected virtual void OnElementTreeChanged(ComponentThemableElementTree previousTree)
The previous element tree instance.
protected virtual void OnEnabledChanged(RadPropertyChangedEventArgs e)
Called when a layout property has changed.
protected virtual void OnLayoutPropertyChanged(RadPropertyChangedEventArgs e)
The property changed event arguments.
A callback used by the owning RadControl to notify the element for a first-time screen visualization.
protected void OnLoad(bool recursive)
True to notify entire subtree for the load process, false otherwise.
Called when the element has been successfully loaded. That includes loading of all its children as well.
protected virtual void OnLoaded()
protected virtual void OnLocationChanged(RadPropertyChangedEventArgs e)
Raises the MouseWheel event.
protected virtual void OnMouseWheel(MouseEventArgs e)
The mouse event arguments.
Notifies for a change in the Parent value.
protected virtual void OnParentChanged(RadElement previousParent)
The previous parent element (if any)
protected virtual void OnParentEnabledChanged(RadPropertyChangedEventArgs e)
The object gets notified for a parent property change.
protected virtual void OnParentPropertyChanged(RadPropertyChangedEventArgs args)
Raises the RadPropertyChanged event and the standard .NET PropertyChanged event to notify subscribers of property value changes.
protected override void OnPropertyChanged(RadPropertyChangedEventArgs e)
The RadPropertyChangedEventArgs containing information about the property change.
Overrides:
Called when the render size of the element has changed.
protected virtual void OnRenderSizeChanged(SizeChangedInfo info)
The size change information.
Shows a screen tip.
protected virtual bool OnShowScreenTip(ComponentInputBehavior inputBehavior)
The input behavior.
Returns:A value indicating whether a screen tip is shown.
protected virtual void OnStyleChanged(RadPropertyChangedEventArgs e)
This method is executed when a property which affects the absolute position of the element has been changed.
protected virtual void OnTransformationInvalidated()
Called when the tunnel phase of a routed event occurs.
protected virtual void OnTunnelEvent(RadElement sender, RoutedEventArgs args)
The element that originally raised the event.
argsRoutedEventArgsThe routed event arguments.
Unloads the element if it was previously loaded on an element tree.
protected void OnUnload(ComponentThemableElementTree oldTree, bool recursive)
Reference to the element tree from which we are in a process of unload.
recursiveboolTrue to unload children recursively, false otherwise.
Notifies that the element has been successfully unloaded from an element tree. Allows inheritors to provide custom logic at this stage.
protected virtual void OnUnloaded(ComponentThemableElementTree oldTree)
Reference to the element tree from which the element has been unloaded.
The element gets notified for a change in the UseSystemSkin property. This method will recursively notify all descendants for the change.
Provides a routine to paint element's content when system skin appearance is desired.
Virtual layer between PaintChildren() and Paint(). Can be overridden to fully customize element hierarchy paint. Used for painting disabled items.
protected virtual void PaintOverride(IGraphics graphics, Rectangle clipRectangle, float angle, SizeF scale, bool useRelativeTransformation)
The graphics object.
clipRectangleRectangleThe rectangle which has been invalidated.
anglefloatThe angle (in degrees) to which the current element is rotated. This angle is a sum of all AngleTransform properties of this element's parents.
scaleSizeFuseRelativeTransformationboolprotected virtual void PaintShadow(RadElement child, IGraphics graphics)
Triggers the Click event for the element.
public virtual void PerformClick()
Performs the core resources release logic.
Retrieves a point in control coordinates taking as a parameter a point which is in element coordinates. The method takes into consideration the AngleTransform property applied on the element and rotates back the transformation. This means that the top left corner of the element is with coordinates (0, 0) no matter what is AngleTransform value.
Retrieves a point in control coordinates taking as a parameter a point which is in element coordinates. The method does not take into consideration the AngleTransform property applied on the element.
Retrieves a point in screen coordinates taking as a parameter a point which is in element coordinates (this means that the top left corner of the element is with coordinates 0, 0).
protected virtual void ProcessBehaviors(RadPropertyChangedEventArgs e)
Raises the bubble phase of a routed event, traveling up from the target element to the root.
public virtual void RaiseBubbleEvent(RadElement sender, RoutedEventArgs args)
The element that originally raised the event.
argsRoutedEventArgsThe routed event arguments.
Raises a routed event on the element, first tunneling down the element tree then bubbling back up.
public virtual void RaiseRoutedEvent(RadElement sender, RoutedEventArgs args)
The element that originally raised the event.
argsRoutedEventArgsThe routed event arguments.
Raises the tunnel phase of a routed event, traveling down from the root to the target element.
public virtual void RaiseTunnelEvent(RadElement sender, RoutedEventArgs args)
The element that originally raised the event.
argsRoutedEventArgsThe routed event arguments.
Retrieves a rectangle in screen coordinates taking as a parameter a rectangle which is in element coordinates (this means that the top left corner of the element is with coordinates 0, 0).
public void RemoveBehavior(PropertyChangeBehavior behavior)
public virtual void RemoveBehaviors(PropertyChangeBehavior behavior)
public virtual void RemoveRangeBehaviors(PropertyChangeBehaviorCollection propertyChangeBehaviorCollection)
public virtual void RemoveRangeRoutedEventBehaviors(RoutedEventBehaviorCollection routedEventBehaviorCollection)
Add the ElementTree property if we are in the context of RadControlSpy.
protected override PropertyDescriptorCollection ReplaceDefaultDescriptors(PropertyDescriptorCollection props)
Overrides:
Resets all layout related fields and puts the element in its initial layout state.
public void ResetLayout(bool recursive)
True to reset children recursively, false otherwise.
Resets the core layout properties and removes this element from layout queues.
protected virtual void ResetLayoutCore()
Resets the Style modifier for the specified property. Will reset all properties if null is passed.
public virtual void ResetStyleSettings(bool recursive, RadProperty property)
Resets the Style modifier of each registered property.
Resumes layout logic for the element and optionally for its children, with an option to force immediate layout.
public virtual void ResumeLayout(bool recursive, bool performLayout)
True to resume layout for this element and all its children; false for this element only.
performLayoutboolTrue to execute pending layout requests immediately; false to simply resume layout operations.
Layout operations are reference-counted, so each call to SuspendLayout must be matched with a corresponding call to ResumeLayout. When the suspend count reaches zero and the element is loaded, pending layout operations will be executed if performLayout is true. This method is essential for maintaining element tree layout consistency.
Resumes layout logic for the element with an option to force immediate layout.
public void ResumeLayout(bool performLayout)
True to execute pending layout requests immediately; false to simply resume layout operations.
This overload calls ResumeLayout(false, performLayout), resuming layout for this element only. Use this method after calling SuspendLayout to re-enable layout calculations.
Resumes the previously suspended UpdateReferences(ComponentThemableElementTree, bool, bool) method execution. Each call to SuspendReferenceUpdate() must be paired with a corresponding call to this method.
public void ResumeReferenceUpdate()
Sends this element to the beginning of its parent's z-ordered collection.
public void SendToBack()
Sets the bounds of the element to the specified rectangle (X, Y, width and height).
Sets the bounds of the element to the specified rectangle (locating and size).
public void SetBounds(Rectangle bounds)
The rectangle that represents the new location and size.
Sets the bounds of the element to the specified rectangle.
protected virtual void SetBoundsCore(Rectangle bounds)
The rectangle to set as bounds.
Sets the focused state of an element safely without recursion.
protected void SetFocusPropertySafe(bool isFocused)
The new focused state.
Applies the specified RadElement instance as parent of the current instance.
protected void SetParent(RadElement parent)
The parent element to set.
Used internally to support RadControl infrastructure. This method is not intended for use directly from your code.
Performs the core logic of updating property value.
protected override ValueUpdateResult SetValueCore(RadPropertyValue propVal, object propModifier, object newValue, ValueSource source)
The property value structure, holding property information.
propModifierobjectAdditional modifier, like IPropertySetting
newValueobjectThe actual new value to be set, valid for Local and DefaultValue sources.
sourceValueSourceSpecifies the source of the provided new value.
Returns:The result of the operation.
Overrides:
Gets a value indicating whether a child will be arranged during the ArrangeOverride(SizeF).
protected virtual bool ShouldArrangeChild(RadElement child)
The child element to check.
Returns:Whether the child will be arranged in ArrangeOverride.
Gets a value indicating, whether a child will be measured during the MeasureOverride.
protected virtual bool ShouldMeasureChild(RadElement child)
The child.
Returns:Whether the child will be measured in MeasureOverride.
Determines whether we should paint system skin.
Shows a screen tip for this element.
protected virtual void ShowScreenTip(ScreenTipNeededEventArgs args)
The screen tip event arguments.
Temporarily suspends layout operations upon this element.
public void SuspendLayout()
Temporarily suspends layout operations upon this element.
public virtual void SuspendLayout(bool recursive)
True to suspend children also, false otherwise.
Temporarily suspends the UpdateReferences(ComponentThemableElementTree, bool, bool) method execution. This is useful when modifying the element tree structure without triggering immediate reference updates.
public void SuspendReferenceUpdate()
protected virtual void UnapplyStyle()
Performs cleanup when system skin painting is no longer used.
protected virtual void UnitializeSystemSkinPaint()
Executes the core unload logic. Allows inheritors to perform additional action while the element is unloading itself.
protected virtual void UnloadCore(ComponentThemableElementTree oldTree)
Reference to the element tree from which we are in a process of unload.
Unlocks the bounds of the element after critical operations are complete.
protected virtual void UnlockBounds()
Updates the ContainsFocus property. The notification may be received from a child whose IsFocused property has changed.
protected virtual void UpdateContainsFocus(bool isFocused)
The current focused state.
Forces the element to update its layout by processing any pending measure and arrange operations.
public void UpdateLayout()
Updates the local references using the provided element tree.
protected virtual void UpdateReferences(ComponentThemableElementTree tree, bool updateInheritance, bool recursive)
The element tree to use for updating references.
updateInheritanceboolTrue to update inheritance chain, false otherwise.
recursiveboolTrue to update children also, false otherwise.
Events
Occurs when the children collection of the element is changed.
[Browsable(true)]
public event ChildrenChangedEventHandler ChildrenChanged
Occurs when the element is clicked.
[Browsable(true)]
public event EventHandler Click
Occurs when the element is double-clicked.
[Browsable(true)]
public virtual event EventHandler DoubleClick
Occurs when the enabled state of the element has changed.
public event EventHandler EnabledChanged
[Browsable(false)]
public event EventHandler LayoutUpdated
public event MouseEventHandler LostMouseCapture
Occurs when the mouse pointer is over the element and a mouse button is pressed.
[Browsable(true)]
public event MouseEventHandler MouseDown
Occurs when the mouse pointer enters the element.
[Browsable(false)]
public event EventHandler MouseEnter
Occurs when the mouse pointer rests on the element.
[Browsable(false)]
public event EventHandler MouseHover
Occurs when the mouse pointer leaves the element.
[Browsable(false)]
public event EventHandler MouseLeave
Occurs when the mouse pointer is moved over the element.
[Browsable(false)]
public event MouseEventHandler MouseMove
Occurs when the mouse pointer is over the element and a mouse button is released.
[Browsable(false)]
public event MouseEventHandler MouseUp
Occurs when the RadItem has focus and the user scrolls up or down the mouse wheel
[Browsable(true)]
public event MouseEventHandler MouseWheel