Show / Hide Table of Contents

Class DependencyObject

Represents an object that participates in the Silverlight dependency property system. DependencyObject is the immediate base class of several other important Silverlight classes, such as UIElement, Geometry, FrameworkTemplate, Style, and ResourceDictionary.

Inheritance
System.Object
DependencyObject
ComparisonCondition
ConditionalExpression
AssemblyPart
AutomationPeer
DataGridColumn
DefinitionBase
MultiScaleSubImage
TextSearch
CollectionViewSource
DependencyObjectCollection<T>
Deployment
ExternalPart
FrameworkTemplate
Icon
InBrowserSettings
DrawingAttributes
Stroke
TouchDevice
TouchPoint
Behavior
TriggerAction
TriggerBase
BooleanKeyFrame
ByteKeyFrame
CharKeyFrame
ColorKeyFrame
DecimalKeyFrame
DoubleKeyFrame
EasingFunctionBase
Int16KeyFrame
Int32KeyFrame
Int64KeyFrame
KeySpline
MatrixKeyFrame
ObjectKeyFrame
PointKeyFrame
RectKeyFrame
SingleKeyFrame
SizeKeyFrame
StringKeyFrame
ThicknessKeyFrame
Timeline
VectorKeyFrame
Brush
CacheMode
Effect
PixelShader
GeneralTransform
Geometry
GradientStop
ImageSource
MultiScaleTileSource
PathFigure
PathSegment
Projection
TimelineMarker
NotificationWindow
OutOfBrowserSettings
PresentationFrameworkCollection<T>
PrintDocument
PropertyPath
ResourceDictionary
SecuritySettings
SetterBase
Style
TriggerAction
TriggerBase
UIElement
VisualState
VisualStateGroup
VisualStateManager
VisualTransition
WindowSettings
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()
Namespace: System.Windows
Assembly: OpenSilver.dll
Syntax
public class DependencyObject : IDependencyObject

Constructors

| Improve this Doc View Source

DependencyObject()

Initializes a new instance of the DependencyObject class.

Declaration
public DependencyObject()

Properties

| Improve this Doc View Source

Dispatcher

Gets the Dispatcher this object is associated with.

Declaration
public Dispatcher Dispatcher { get; }
Property Value
Type Description
Dispatcher

The Dispatcher this object is associated with.

Methods

| Improve this Doc View Source

CheckAccess()

Determines whether the calling thread has access to this object.

Declaration
[NotImplemented]
public bool CheckAccess()
Returns
Type Description
System.Boolean

true if the calling thread has access to this object; otherwise, false.

| Improve this Doc View Source

ClearValue(DependencyProperty)

Clears the local value of a dependency property.

Declaration
public void ClearValue(DependencyProperty dp)
Parameters
Type Name Description
DependencyProperty dp

The DependencyProperty identifier of the property to clear the value for.

Exceptions
Type Condition
System.ArgumentNullException

dp is null.

| Improve this Doc View Source

ClearValue(DependencyPropertyKey)

Clears the local value of a read-only property. The property to be cleared is specified by a DependencyPropertyKey.

Declaration
public void ClearValue(DependencyPropertyKey key)
Parameters
Type Name Description
DependencyPropertyKey key

The key for the dependency property to be cleared.

Exceptions
Type Condition
System.ArgumentNullException

key is null.

| Improve this Doc View Source

CoerceValue(DependencyProperty)

Coerces the value of the specified dependency property. This is accomplished by invoking any CoerceValueCallback function specified in property metadata for the dependency property as it exists on the calling DependencyObject.

Declaration
public void CoerceValue(DependencyProperty dp)
Parameters
Type Name Description
DependencyProperty dp

The identifier for the dependency property to coerce.

Exceptions
Type Condition
System.ArgumentNullException

dp is null.

| Improve this Doc View Source

GetAnimationBaseValue(DependencyProperty)

Returns any base value established for a Silverlight dependency property, which would apply in cases where an animation is not active.

Declaration
public object GetAnimationBaseValue(DependencyProperty dp)
Parameters
Type Name Description
DependencyProperty dp

The identifier for the desired dependency property.

Returns
Type Description
System.Object

The returned base value.

Exceptions
Type Condition
System.ArgumentNullException

dp is null.

| Improve this Doc View Source

GetValue(DependencyProperty)

Returns the current effective value of a dependency property from a DependencyObject.

Declaration
public object GetValue(DependencyProperty dependencyProperty)
Parameters
Type Name Description
DependencyProperty dependencyProperty

The DependencyProperty identifier of the property to retrieve the value for.

Returns
Type Description
System.Object

Returns the current effective value.

Exceptions
Type Condition
System.ArgumentNullException

dependencyProperty is null.

| Improve this Doc View Source

INTERNAL_OnAttachedToVisualTree()

Declaration
protected virtual void INTERNAL_OnAttachedToVisualTree()
| Improve this Doc View Source

INTERNAL_OnDetachedFromVisualTree()

Declaration
protected virtual void INTERNAL_OnDetachedFromVisualTree()
| Improve this Doc View Source

OnPropertyChanged(DependencyPropertyChangedEventArgs)

Invoked whenever the effective value of any dependency property on this DependencyObject has been updated. The specific dependency property that changed is reported in the event data.

Declaration
protected virtual void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type Name Description
DependencyPropertyChangedEventArgs e

Event data that will contain the dependency property identifier of interest, the property metadata for the type, and old and new values.

| Improve this Doc View Source

ReadLocalValue(DependencyProperty)

Returns the local value of a dependency property, if a local value is set.

Declaration
public object ReadLocalValue(DependencyProperty dp)
Parameters
Type Name Description
DependencyProperty dp

The DependencyProperty identifier of the property for which to retrieve the local value.

Returns
Type Description
System.Object

Returns the local value, or returns the sentinel value UnsetValue if no local value is set.

| Improve this Doc View Source

SetCurrentValue(DependencyProperty, Object)

Sets the value of a dependency property without changing its value source.

Declaration
public void SetCurrentValue(DependencyProperty dp, object value)
Parameters
Type Name Description
DependencyProperty dp

The identifier of the dependency property to set.

System.Object value

The new local value.

Exceptions
Type Condition
System.ArgumentNullException

dp is null.

System.ArgumentException

value was not the correct type as registered for the dp property.

| Improve this Doc View Source

SetValue(DependencyProperty, Object)

Sets the local value of a dependency property on a DependencyObject.

Declaration
public void SetValue(DependencyProperty dp, object value)
Parameters
Type Name Description
DependencyProperty dp

The identifier of the dependency property to set.

System.Object value

The new local value.

Exceptions
Type Condition
System.ArgumentNullException

dp is null.

System.ArgumentException

value was not the correct type as registered for the dp property.

| Improve this Doc View Source

SetValue(DependencyPropertyKey, Object)

Sets the local value of a read-only dependency property on a DependencyObject.

Declaration
public void SetValue(DependencyPropertyKey key, object value)
Parameters
Type Name Description
DependencyPropertyKey key

The DependencyPropertyKey identifier of the property to set.

System.Object value

The new local value.

Exceptions
Type Condition
System.ArgumentNullException

key is null.

System.ArgumentException

value was not the correct type as registered for the property.

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestorsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualChildren(DependencyObject)
VisualTreeExtensions.GetVisualChildrenAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualDescendants(DependencyObject)
VisualTreeExtensions.GetVisualDescendantsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualSiblings(DependencyObject)
VisualTreeExtensions.GetVisualSiblingsAndSelf(DependencyObject)
  • Improve this Doc
  • View Source