Class FrameworkElement
Provides a framework of common APIs for objects that participate in UI and
programmatic layout. FrameworkElement also defines APIs related to data binding,
object tree, and object lifetime feature areas.
Inheritance
System.Object
FrameworkElement
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: OpenSilver.dll
Syntax
public abstract class FrameworkElement : UIElement
Constructors
|
Improve this Doc
View Source
FrameworkElement()
Provides base class initialization behavior for FrameworkElement-derived
classes.
Declaration
public FrameworkElement()
Fields
|
Improve this Doc
View Source
ActualHeightProperty
Declaration
public static readonly DependencyProperty ActualHeightProperty
Field Value
|
Improve this Doc
View Source
ActualWidthProperty
Declaration
public static readonly DependencyProperty ActualWidthProperty
Field Value
|
Improve this Doc
View Source
Declaration
public static readonly DependencyProperty ContextMenuProperty
Field Value
|
Improve this Doc
View Source
CursorProperty
Identifies the Cursor dependency
property.
Declaration
public static readonly DependencyProperty CursorProperty
Field Value
|
Improve this Doc
View Source
CustomLayoutProperty
Declaration
public static readonly DependencyProperty CustomLayoutProperty
Field Value
|
Improve this Doc
View Source
DataContextProperty
Declaration
public static readonly DependencyProperty DataContextProperty
Field Value
|
Improve this Doc
View Source
DefaultStyleKeyProperty
Declaration
public static readonly DependencyProperty DefaultStyleKeyProperty
Field Value
|
Improve this Doc
View Source
FlowDirectionProperty
Declaration
[NotImplemented]
public static readonly DependencyProperty FlowDirectionProperty
Field Value
|
Improve this Doc
View Source
HeightProperty
Identifies the Height dependency
property.
Declaration
public static readonly DependencyProperty HeightProperty
Field Value
|
Improve this Doc
View Source
HorizontalAlignmentProperty
Declaration
public static readonly DependencyProperty HorizontalAlignmentProperty
Field Value
|
Improve this Doc
View Source
INTERNAL_DoNotApplyStyle
Derived classes can set this flag in their constructor to prevent the "Style" property from being applied.
Declaration
protected bool INTERNAL_DoNotApplyStyle
Field Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsAutoHeightOnCustomLayoutProperty
Declaration
public static readonly DependencyProperty IsAutoHeightOnCustomLayoutProperty
Field Value
|
Improve this Doc
View Source
IsAutoWidthOnCustomLayoutProperty
Declaration
public static readonly DependencyProperty IsAutoWidthOnCustomLayoutProperty
Field Value
|
Improve this Doc
View Source
IsEnabledProperty
Identifies the IsEnabled dependency
property.
Declaration
public static readonly DependencyProperty IsEnabledProperty
Field Value
|
Improve this Doc
View Source
LanguageProperty
Identifies the Language dependency property.
Declaration
public static readonly DependencyProperty LanguageProperty
Field Value
|
Improve this Doc
View Source
LoadedEvent
Declaration
public static readonly RoutedEvent LoadedEvent
Field Value
|
Improve this Doc
View Source
MarginProperty
Identifies the Margin dependency property.
Declaration
public static readonly DependencyProperty MarginProperty
Field Value
|
Improve this Doc
View Source
MaxHeightProperty
Identifies the MaxHeight dependency
property.
Declaration
public static readonly DependencyProperty MaxHeightProperty
Field Value
|
Improve this Doc
View Source
MaxWidthProperty
Identifies the MaxWidth dependency
property.
Declaration
public static readonly DependencyProperty MaxWidthProperty
Field Value
|
Improve this Doc
View Source
MinHeightProperty
Identifies the MinHeight dependency
property.
Declaration
public static readonly DependencyProperty MinHeightProperty
Field Value
|
Improve this Doc
View Source
MinWidthProperty
Identifies the MinWidth dependency
property.
Declaration
public static readonly DependencyProperty MinWidthProperty
Field Value
|
Improve this Doc
View Source
NameProperty
Identifies the Name dependency property.
Declaration
public static readonly DependencyProperty NameProperty
Field Value
|
Improve this Doc
View Source
StyleProperty
Identifies the Style dependency property.
Declaration
public static readonly DependencyProperty StyleProperty
Field Value
|
Improve this Doc
View Source
TagProperty
Identifies the Tag dependency property.
Declaration
public static readonly DependencyProperty TagProperty
Field Value
|
Improve this Doc
View Source
VerticalAlignmentProperty
Declaration
public static readonly DependencyProperty VerticalAlignmentProperty
Field Value
|
Improve this Doc
View Source
WidthProperty
Identifies the Width dependency property.
Declaration
public static readonly DependencyProperty WidthProperty
Field Value
Properties
|
Improve this Doc
View Source
ActualHeight
Gets the rendered height of a FrameworkElement. The FrameworkElement must be in the visual tree,
otherwise this property will return 0.
Declaration
public double ActualHeight { get; }
Property Value
Type |
Description |
System.Double |
|
|
Improve this Doc
View Source
ActualSize
Gets the rendered size of a FrameworkElement.
Declaration
public Size ActualSize { get; }
Property Value
|
Improve this Doc
View Source
ActualWidth
Gets the rendered width of a FrameworkElement. The FrameworkElement must be in the visual tree,
otherwise this property will return 0.
Declaration
public double ActualWidth { get; }
Property Value
Type |
Description |
System.Double |
|
|
Improve this Doc
View Source
Gets or sets the context menu element that should appear whenever the context menu is requested through user interface (UI) from within this element.
Declaration
public ContextMenu ContextMenu { get; set; }
Property Value
|
Improve this Doc
View Source
Cursor
Gets or sets the cursor that displays when the mouse pointer is over this
element.
Declaration
public Cursor Cursor { get; set; }
Property Value
|
Improve this Doc
View Source
CustomLayout
Enable or disable measure/arrange layout system in a sub part
Declaration
public bool CustomLayout { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
DataContext
Gets or sets the data context for a FrameworkElement when it participates
in data binding.
Declaration
public object DataContext { get; set; }
Property Value
Type |
Description |
System.Object |
|
|
Improve this Doc
View Source
DefaultStyleKey
Gets or sets the key that references the default style for the control.
Declaration
protected object DefaultStyleKey { get; set; }
Property Value
Type |
Description |
System.Object |
|
|
Improve this Doc
View Source
FlowDirection
Gets or sets the direction that text and other user interface
elements flow within any parent element that controls their layout.
Declaration
[NotImplemented]
public FlowDirection FlowDirection { get; set; }
Property Value
Type |
Description |
FlowDirection |
The direction that text and other UI elements flow within their
parent element, as a value of the enumeration. The default value
is LeftToRight.
|
|
Improve this Doc
View Source
Height
Gets or sets the suggested height of a FrameworkElement.
Declaration
public double Height { get; set; }
Property Value
Type |
Description |
System.Double |
|
|
Improve this Doc
View Source
HorizontalAlignment
Gets or sets the horizontal alignment characteristics that are applied to
a FrameworkElement when it is composed in a layout parent, such as a panel
or items control.
Declaration
public HorizontalAlignment HorizontalAlignment { get; set; }
Property Value
|
Improve this Doc
View Source
IsAutoHeightOnCustomLayout
Gets or sets the Auto Height to the root of CustomLayout
Declaration
public bool? IsAutoHeightOnCustomLayout { get; set; }
Property Value
Type |
Description |
System.Nullable<System.Boolean> |
|
|
Improve this Doc
View Source
IsAutoWidthOnCustomLayout
Gets or sets the Auto Width to the root of CustomLayout
Declaration
public bool? IsAutoWidthOnCustomLayout { get; set; }
Property Value
Type |
Description |
System.Nullable<System.Boolean> |
|
|
Improve this Doc
View Source
IsEnabled
Gets or sets a value indicating whether the user can interact with the control.
Declaration
public bool IsEnabled { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
IsLoaded
Gets a value that indicates whether this element is in the Visual Tree, that is, if it has been loaded for presentation.
Declaration
public bool IsLoaded { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Language
Gets or sets localization/globalization language information that applies to
a FrameworkElement.
Declaration
[TypeConverter(typeof(XmlLanguageConverter))]
public XmlLanguage Language { get; set; }
Property Value
|
Improve this Doc
View Source
Margin
Gets or sets the outer margin of a FrameworkElement.
Declaration
public Thickness Margin { get; set; }
Property Value
|
Improve this Doc
View Source
MaxHeight
Gets or sets the maximum height constraint of a FrameworkElement.
Declaration
public double MaxHeight { get; set; }
Property Value
Type |
Description |
System.Double |
|
|
Improve this Doc
View Source
MaxWidth
Gets or sets the maximum width constraint of a FrameworkElement.
Declaration
public double MaxWidth { get; set; }
Property Value
Type |
Description |
System.Double |
|
|
Improve this Doc
View Source
MinHeight
Gets or sets the minimum height constraint of a FrameworkElement.
Declaration
public double MinHeight { get; set; }
Property Value
Type |
Description |
System.Double |
|
|
Improve this Doc
View Source
MinWidth
Gets or sets the minimum width constraint of a FrameworkElement.
Declaration
public double MinWidth { get; set; }
Property Value
Type |
Description |
System.Double |
|
|
Improve this Doc
View Source
Name
Gets or sets the identifying name of the object. When a XAML processor creates
the object tree from XAML markup, run-time code can refer to the XAML-declared
object by this name.
Declaration
public string Name { get; set; }
Property Value
Type |
Description |
System.String |
|
|
Improve this Doc
View Source
Parent
Gets the parent object of this FrameworkElement in the object tree.
Declaration
public DependencyObject Parent { get; }
Property Value
|
Improve this Doc
View Source
Resources
Gets the locally defined resource dictionary. In XAML, you can establish
resource items as child object elements of a frameworkElement.Resources property
element, through XAML implicit collection syntax.
Declaration
public ResourceDictionary Resources { get; set; }
Property Value
|
Improve this Doc
View Source
Style
Gets or sets an instance Style that is applied for this object during rendering.
Declaration
public Style Style { get; set; }
Property Value
|
Improve this Doc
View Source
Tag
Gets or sets an arbitrary object value that can be used to store custom information
about this object.
Declaration
public object Tag { get; set; }
Property Value
Type |
Description |
System.Object |
|
|
Improve this Doc
View Source
Triggers
Gets the collection of triggers for animations that are defined for a FrameworkElement.
Declaration
public TriggerCollection Triggers { get; }
Property Value
Type |
Description |
TriggerCollection |
The collection of triggers for animations that are defined for this object.
|
|
Improve this Doc
View Source
VerticalAlignment
Gets or sets the vertical alignment characteristics that are applied to a
FrameworkElement when it is composed in a parent object such as a panel or
items control.
Declaration
public VerticalAlignment VerticalAlignment { get; set; }
Property Value
|
Improve this Doc
View Source
Width
Gets or sets the width of a FrameworkElement.
Declaration
public double Width { get; set; }
Property Value
Type |
Description |
System.Double |
|
Methods
|
Improve this Doc
View Source
ArrangeOverride(Size)
Declaration
protected virtual Size ArrangeOverride(Size finalSize)
Parameters
Type |
Name |
Description |
Size |
finalSize |
|
Returns
|
Improve this Doc
View Source
CreateDomElement(Object, out Object)
Provides a base implementation for creating the dom elements designed to represent an instance of a FrameworkElement and defines the place where its child(ren) will be added.
Declaration
public override object CreateDomElement(object parentRef, out object domElementWhereToPlaceChildren)
Parameters
Type |
Name |
Description |
System.Object |
parentRef |
The parent of the FrameworkElement
|
System.Object |
domElementWhereToPlaceChildren |
The dom element where the FrameworkElement's children will be added.
|
Returns
Type |
Description |
System.Object |
The "root" dom element of the FrameworkElement.
|
Overrides
|
Improve this Doc
View Source
CreateDomElement_WorkaroundBridgeInheritanceBug(Object, out Object)
Declaration
public object CreateDomElement_WorkaroundBridgeInheritanceBug(object parentRef, out object domElementWhereToPlaceChildren)
Parameters
Type |
Name |
Description |
System.Object |
parentRef |
|
System.Object |
domElementWhereToPlaceChildren |
|
Returns
Type |
Description |
System.Object |
|
|
Improve this Doc
View Source
FindName(String)
Retrieves an object that has the specified identifier name.
Declaration
public object FindName(string name)
Parameters
Type |
Name |
Description |
System.String |
name |
The name of the requested object.
|
Returns
Type |
Description |
System.Object |
The requested object. This can be null if no matching object was found in the
current XAML namescope.
|
|
Improve this Doc
View Source
GetBindingExpression(DependencyProperty)
Declaration
public BindingExpression GetBindingExpression(DependencyProperty dp)
Parameters
Returns
|
Improve this Doc
View Source
INTERNAL_OnAttachedToVisualTree()
Declaration
protected override void INTERNAL_OnAttachedToVisualTree()
Overrides
|
Improve this Doc
View Source
INTERNAL_OnDetachedFromVisualTree()
Declaration
protected override void INTERNAL_OnDetachedFromVisualTree()
Overrides
|
Improve this Doc
View Source
ManageIsEnabled(Boolean)
Declaration
protected virtual void ManageIsEnabled(bool isEnabled)
Parameters
Type |
Name |
Description |
System.Boolean |
isEnabled |
|
|
Improve this Doc
View Source
MeasureOverride(Size)
Declaration
protected virtual Size MeasureOverride(Size availableSize)
Parameters
Type |
Name |
Description |
Size |
availableSize |
|
Returns
|
Improve this Doc
View Source
OnAfterApplyHorizontalAlignmentAndWidth()
Declaration
protected virtual void OnAfterApplyHorizontalAlignmentAndWidth()
|
Improve this Doc
View Source
OnAfterApplyVerticalAlignmentAndWidth()
Declaration
protected virtual void OnAfterApplyVerticalAlignmentAndWidth()
|
Improve this Doc
View Source
OnApplyTemplate()
Invoked whenever application code or internal processes (such as a rebuilding
layout pass) call ApplyTemplate. In simplest terms, this means the method
is called just before a UI element displays in your app. Override this method
to influence the default post-template logic of a class.
Declaration
public virtual void OnApplyTemplate()
|
Improve this Doc
View Source
OnLayoutUpdated()
Declaration
protected override void OnLayoutUpdated()
Overrides
|
Improve this Doc
View Source
SetBinding(DependencyProperty, Binding)
Attaches a binding to a FrameworkElement, using the provided binding object.
Declaration
public BindingExpression SetBinding(DependencyProperty dependencyProperty, Binding binding)
Parameters
Type |
Name |
Description |
DependencyProperty |
dependencyProperty |
The dependency property identifier of the property that is data bound.
|
Binding |
binding |
The binding to use for the property.
|
Returns
Events
|
Improve this Doc
View Source
BindingValidationError
Occurs when a data validation error is reported by a binding source.
Declaration
public event EventHandler<ValidationErrorEventArgs> BindingValidationError
Event Type
|
Improve this Doc
View Source
Occurs when any context menu on the element is opened.
Declaration
public event ContextMenuEventHandler ContextMenuOpening
Event Type
|
Improve this Doc
View Source
DataContextChanged
Occurs when the data context for this element changes.
Declaration
public event DependencyPropertyChangedEventHandler DataContextChanged
Event Type
|
Improve this Doc
View Source
IsEnabledChanged
Occurs when the IsEnabled property changes.
Declaration
public event DependencyPropertyChangedEventHandler IsEnabledChanged
Event Type
|
Improve this Doc
View Source
LayoutUpdated
Declaration
public event EventHandler LayoutUpdated
Event Type
Type |
Description |
System.EventHandler |
|
|
Improve this Doc
View Source
Loaded
Occurs when a FrameworkElement has been constructed and added to the object tree.
Declaration
public event RoutedEventHandler Loaded
Event Type
|
Improve this Doc
View Source
SizeChanged
Declaration
public event SizeChangedEventHandler SizeChanged
Event Type
|
Improve this Doc
View Source
Unloaded
Occurs when this object is no longer connected to the main object tree.
Declaration
public event RoutedEventHandler Unloaded
Event Type
Extension Methods