Class IconElement
Represents the base class for an icon UI element.
[TypeConverter(typeof(IconElementConverter))]
public abstract class IconElement : FrameworkElement, IAnimatable, IFrameworkInputElement, IInputElement, ISupportInitialize, IQueryAmbient
- Inheritance
-
IconElement
- Implements
- Derived
- Inherited Members
Fields
ForegroundProperty
Identifies the Foreground dependency property.
public static readonly DependencyProperty ForegroundProperty
Field Value
Properties
Foreground
Gets or sets a brush that describes the foreground color.
[Bindable(true)]
public Brush Foreground { get; set; }
Property Value
- Brush
The brush that paints the foreground of the control. The default value is the system dialog font color.
VisualChildrenCount
Gets the number of visual child elements within this element.
protected override int VisualChildrenCount { get; }
Property Value
- int
The number of visual child elements for this element.
Methods
ArrangeOverride(Size)
When overridden in a derived class, positions child elements and determines a size for a FrameworkElement derived class.
protected override Size ArrangeOverride(Size finalSize)
Parameters
finalSize
SizeThe final area within the parent that this element should use to arrange itself and its children.
Returns
- Size
The actual size used.
Coerce(DependencyObject, object?)
Coerces the value of an Icon dependency property, allowing the use of either IconElement or IconSourceElement.
public static object? Coerce(DependencyObject _, object? baseValue)
Parameters
_
DependencyObjectThe dependency object (unused).
baseValue
objectThe value to be coerced.
Returns
- object
An IconElement, either directly or derived from an IconSourceElement.
GetVisualChild(int)
Overrides GetVisualChild(int), and returns a child at the specified index from a collection of child elements.
protected override Visual GetVisualChild(int index)
Parameters
index
intThe zero-based index of the requested child element in the collection.
Returns
- Visual
The requested child element. This should not return null; if the provided index is out of range, an exception is thrown.
InitializeChildren()
protected abstract UIElement InitializeChildren()
Returns
MeasureOverride(Size)
When overridden in a derived class, measures the size in layout required for child elements and determines a size for the FrameworkElement-derived class.
protected override Size MeasureOverride(Size availableSize)
Parameters
availableSize
SizeThe available size that this element can give to child elements. Infinity can be specified as a value to indicate that the element will size to whatever content is available.
Returns
- Size
The size that this element determines it needs during layout, based on its calculations of child element sizes.
OnForegroundChanged(DependencyPropertyChangedEventArgs)
protected virtual void OnForegroundChanged(DependencyPropertyChangedEventArgs args)