ContentElement Class (System.Windows)

Switch View :
ScriptFree
.NET Framework Class Library
ContentElement Class

Provides a WPF core-level base class for content elements. Content elements are designed for flow-style presentation, using an intuitive markup-oriented layout model and a deliberately simple object model.

Inheritance Hierarchy

System.Object
  System.Windows.Threading.DispatcherObject
    System.Windows.DependencyObject
      System.Windows.ContentElement
        System.Windows.FrameworkContentElement

Namespace:  System.Windows
Assembly:  PresentationCore (in PresentationCore.dll)
XMLNS for XAML: http://schemas.microsoft.com/winfx/2006/xaml/presentation, http://schemas.microsoft.com/netfx/2007/xaml/presentation
Syntax

Visual Basic
Public Class ContentElement _
	Inherits DependencyObject _
	Implements IInputElement, IAnimatable
C#
public class ContentElement : DependencyObject, 
	IInputElement, IAnimatable
Visual C++
public ref class ContentElement : public DependencyObject, 
	IInputElement, IAnimatable
F#
type ContentElement =  
    class
        inherit DependencyObject
        interface IInputElement
        interface IAnimatable
    end
XAML Object Element Usage
<ContentElement .../>

The ContentElement type exposes the following members.

Constructors

  Name Description
Public method ContentElement Initializes a new instance of the ContentElement class.
Top
Properties

  Name Description
Public property AllowDrop Gets or sets a value that indicates whether this element can be used as the target of a drag-and-drop operation.
Public property AreAnyTouchesCaptured Gets a value that indicates whether at least one touch is captured to this element.
Public property AreAnyTouchesCapturedWithin Gets a value that indicates whether at least one touch is captured to this element or to any child elements in its visual tree.
Public property AreAnyTouchesDirectlyOver Gets a value that indicates whether at least one touch is pressed over this element.
Public property AreAnyTouchesOver Gets a value that indicates whether at least one touch is pressed over this element or any child elements in its visual tree.
Public property CommandBindings Gets a collection of CommandBinding objects that are associated with this element.
Public property DependencyObjectType Gets the DependencyObjectType that wraps the CLR type of this instance.  (Inherited from DependencyObject.)
Public property Dispatcher Gets the Dispatcher this DispatcherObject is associated with. (Inherited from DispatcherObject.)
Public property Focusable Gets or sets a value that indicates whether the element can receive focus.
Public property HasAnimatedProperties Gets a value that indicates whether this element has any animated properties.
Public property InputBindings Gets the collection of input bindings that are associated with this element.
Public property IsEnabled Gets or sets a value that indicates whether this element is enabled in the user interface (UI).  
Protected property IsEnabledCore Gets a value that becomes the return value of IsEnabled in derived classes.
Public property IsFocused Gets a value that determines whether this element has logical focus.
Public property IsInputMethodEnabled Gets a value that indicates whether an input method system, such as an Input Method Editor (IME), is enabled for processing the input to this element.
Public property IsKeyboardFocused Gets a value that indicates whether this element has keyboard focus.
Public property IsKeyboardFocusWithin Gets a value that indicates whether keyboard focus is anywhere within the element or child elements.
Public property IsMouseCaptured Gets a value that indicates whether the mouse is captured by this element.
Public property IsMouseCaptureWithin Gets a value that determines whether mouse capture is held by this element or by child elements in its element tree.
Public property IsMouseDirectlyOver Gets a value that indicates whether the position of the mouse pointer corresponds to hit test results, which take element compositing into account.
Public property IsMouseOver Gets a value that indicates whether the mouse pointer is located over this element (including visual child elements, or its control compositing).
Public property IsSealed Gets a value that indicates whether this instance is currently sealed (read-only). (Inherited from DependencyObject.)
Public property IsStylusCaptured Gets a value that indicates whether the stylus is captured to this element.
Public property IsStylusCaptureWithin Gets a value that determines whether stylus capture is held by this element, including child elements and control compositing.
Public property IsStylusDirectlyOver Gets a value that indicates whether the stylus position corresponds to hit test results, which take element compositing into account.
Public property IsStylusOver Gets a value that indicates whether the stylus is located over this element (including visual child elements).
Public property TouchesCaptured Gets all touch devices that are captured to this element.
Public property TouchesCapturedWithin Gets all touch devices that are captured to this element or any child elements in its visual tree.
Public property TouchesDirectlyOver Gets all touch devices that are over this element.
Public property TouchesOver Gets all touch devices that are over this element or any child elements in its visual tree.
Top
Methods

  Name Description
Public method AddHandler(RoutedEvent, Delegate) Adds a routed event handler for a specified routed event, adding the handler to the handler collection on the current element.
Public method AddHandler(RoutedEvent, Delegate, Boolean) Adds a routed event handler for a specified routed event, adding the handler to the handler collection on the current element. Specify handledEventsToo as true to have the provided handler be invoked for routed event that had already been marked as handled by another element along the event route.
Public method AddToEventRoute Adds handlers to the specified EventRoute for the current ContentElement event handler collection.
Public method ApplyAnimationClock(DependencyProperty, AnimationClock) Applies an animation to a specified dependency property on this element. Any existing animations are stopped and replaced with the new animation.
Public method ApplyAnimationClock(DependencyProperty, AnimationClock, HandoffBehavior) Applies an animation to a specified dependency property on this element, with the ability to specify what happens if the property already has a running animation.
Public method BeginAnimation(DependencyProperty, AnimationTimeline) Starts an animation for a specified animated property on this element.
Public method BeginAnimation(DependencyProperty, AnimationTimeline, HandoffBehavior) Starts a specific animation for a specified animated property on this element, with the option of specifying what happens if the property already has a running animation.
Public method CaptureMouse Attempts to force capture of the mouse to this element.
Public method CaptureStylus Attempts to force capture of the stylus to this element.
Public method CaptureTouch Attempts to force capture of a touch to this element.
Public method CheckAccess Determines whether the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Public method ClearValue(DependencyProperty) Clears the local value of a property. The property to be cleared is specified by a DependencyProperty identifier. (Inherited from DependencyObject.)
Public method ClearValue(DependencyPropertyKey) Clears the local value of a read-only property. The property to be cleared is specified by a DependencyPropertyKey. (Inherited from DependencyObject.)
Public method CoerceValue 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. (Inherited from DependencyObject.)
Public method Equals Determines whether a provided DependencyObject is equivalent to the current DependencyObject. (Inherited from DependencyObject.)
Protected method Finalize Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public method Focus Attempts to set focus to this element.
Public method GetAnimationBaseValue Returns the base property value for the specified property on this element, disregarding any possible animated value from a running or stopped animation.
Public method GetHashCode Gets a hash code for this DependencyObject. (Inherited from DependencyObject.)
Public method GetLocalValueEnumerator Creates a specialized enumerator for determining which dependency properties have locally set values on this DependencyObject. (Inherited from DependencyObject.)
Public method GetType Gets the Type of the current instance. (Inherited from Object.)
Protected method GetUIParentCore When overridden in a derived class, returns an alternative user interface (UI) parent for this element if no visual parent exists.
Public method GetValue Returns the current effective value of a dependency property on this instance of a DependencyObject. (Inherited from DependencyObject.)
Public method InvalidateProperty Re-evaluates the effective value for the specified dependency property (Inherited from DependencyObject.)
Protected method MemberwiseClone Creates a shallow copy of the current Object. (Inherited from Object.)
Public method MoveFocus Attempts to move focus from this element to another element. The direction to move focus is specified by a guidance direction, which is interpreted within the organization of the visual parent for this element.
Protected method OnCreateAutomationPeer Returns class-specific AutomationPeer implementations for the Windows Presentation Foundation (WPF) infrastructure.
Protected method OnDragEnter Invoked when an unhandled DragDrop.DragEnter attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnDragLeave Invoked when an unhandled DragDrop.DragLeave attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnDragOver Invoked when an unhandled DragDrop.DragOver attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnDrop Invoked when an unhandled DragDrop.DragEnter attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnGiveFeedback Invoked when an unhandled DragDrop.GiveFeedback attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnGotFocus Raises the GotFocus routed event by using the event data provided.
Protected method OnGotKeyboardFocus Invoked when an unhandled Keyboard.GotKeyboardFocus attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnGotMouseCapture Invoked when an unhandled Mouse.GotMouseCapture attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnGotStylusCapture Invoked when an unhandled Stylus.GotStylusCapture attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnGotTouchCapture Provides class handling for the GotTouchCapture routed event that occurs when a touch is captured to this element.
Protected method OnIsKeyboardFocusedChanged Invoked when an unhandled IsKeyboardFocusedChanged event is raised on this element. Implement this method to add class handling for this event.
Protected method OnIsKeyboardFocusWithinChanged Invoked just before the IsKeyboardFocusWithinChanged event is raised by this element. Implement this method to add class handling for this event.
Protected method OnIsMouseCapturedChanged Invoked when an unhandled IsMouseCapturedChanged event is raised on this element. Implement this method to add class handling for this event.
Protected method OnIsMouseCaptureWithinChanged Invoked when an unhandled IsMouseCaptureWithinChanged event is raised on this element. Implement this method to add class handling for this event.
Protected method OnIsMouseDirectlyOverChanged Invoked when an unhandled IsMouseDirectlyOverChanged event is raised on this element. Implement this method to add class handling for this event.
Protected method OnIsStylusCapturedChanged Invoked when an unhandled IsStylusCapturedChanged event is raised on this element. Implement this method to add class handling for this event.
Protected method OnIsStylusCaptureWithinChanged Invoked when an unhandled IsStylusCaptureWithinChanged event is raised on this element. Implement this method to add class handling for this event.
Protected method OnIsStylusDirectlyOverChanged Invoked when an unhandled IsStylusDirectlyOverChanged event is raised on this element. Implement this method to add class handling for this event.
Protected method OnKeyDown Invoked when an unhandled Keyboard.KeyDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnKeyUp Invoked when an unhandled Keyboard.KeyUp attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnLostFocus Raises the LostFocus routed event by using the event data that is provided.
Protected method OnLostKeyboardFocus Invoked when an unhandled Keyboard.LostKeyboardFocus attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnLostMouseCapture Invoked when an unhandled Mouse.LostMouseCapture attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnLostStylusCapture Invoked when an unhandled Stylus.LostStylusCapture attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnLostTouchCapture Provides class handling for the LostTouchCapture routed event that occurs when this element loses a touch capture.
Protected method OnMouseDown Invoked when an unhandled Mouse.MouseDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnMouseEnter Invoked when an unhandled Mouse.MouseEnter attached event is raised on this element. Implement this method to add class handling for this event.
Protected method OnMouseLeave Invoked when an unhandled Mouse.MouseLeave attached event is raised on this element. Implement this method to add class handling for this event.
Protected method OnMouseLeftButtonDown Invoked when an unhandled MouseLeftButtonDown routed event is raised on this element. Implement this method to add class handling for this event.
Protected method OnMouseLeftButtonUp Invoked when an unhandled MouseLeftButtonUp routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnMouseMove Invoked when an unhandled Mouse.MouseMove attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnMouseRightButtonDown Invoked when an unhandled MouseRightButtonDown routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnMouseRightButtonUp Invoked when an unhandled MouseRightButtonUp routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnMouseUp Invoked when an unhandled Mouse.MouseUp routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnMouseWheel Invoked when an unhandled Mouse.MouseWheel attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewDragEnter Invoked when an unhandled DragDrop.PreviewDragEnter attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewDragLeave Invoked when an unhandled DragDrop.PreviewDragLeave attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewDragOver Invoked when an unhandled DragDrop.PreviewDragOver attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewDrop Invoked when an unhandled DragDrop.PreviewDrop attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewGiveFeedback Invoked when an unhandled DragDrop.PreviewGiveFeedback attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewGotKeyboardFocus Invoked when an unhandled Keyboard.PreviewGotKeyboardFocus attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewKeyDown Invoked when an unhandled Keyboard.PreviewKeyDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewKeyUp Invoked when an unhandled Keyboard.PreviewKeyUp attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewLostKeyboardFocus Invoked when an unhandled Keyboard.PreviewKeyDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewMouseDown Invoked when an unhandled Mouse.PreviewMouseDown attached routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewMouseLeftButtonDown Invoked when an unhandled PreviewMouseLeftButtonDown routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewMouseLeftButtonUp Invoked when an unhandled PreviewMouseLeftButtonUp routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewMouseMove Invoked when an unhandled Mouse.PreviewMouseMove attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewMouseRightButtonDown Invoked when an unhandled PreviewMouseRightButtonDown routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewMouseRightButtonUp Invoked when an unhandled PreviewMouseRightButtonUp routed event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewMouseUp Invoked when an unhandled Mouse.PreviewMouseUp attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewMouseWheel Invoked when an unhandled Mouse.PreviewMouseWheel attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewQueryContinueDrag Invoked when an unhandled DragDrop.PreviewQueryContinueDrag attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewStylusButtonDown Invoked when an unhandled Stylus.PreviewStylusButtonDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewStylusButtonUp Invoked when an unhandled Stylus.PreviewStylusButtonUp attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewStylusDown Invoked when an unhandled Stylus.PreviewStylusDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewStylusInAirMove Invoked when an unhandled Stylus.PreviewStylusInAirMove attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewStylusInRange Invoked when an unhandled Stylus.PreviewStylusInRange attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewStylusMove Invoked when an unhandled Stylus.PreviewStylusMove attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewStylusOutOfRange Invoked when an unhandled Stylus.PreviewStylusOutOfRange attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewStylusSystemGesture Invoked when an unhandled Stylus.PreviewStylusSystemGesture attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewStylusUp Invoked when an unhandled Stylus.PreviewStylusUp attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewTextInput Invoked when an unhandled TextCompositionManager.PreviewTextInput attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnPreviewTouchDown Provides class handling for the PreviewTouchDown routed event that occurs when a touch presses this element.
Protected method OnPreviewTouchMove Provides class handling for the PreviewTouchMove routed event that occurs when a touch moves while inside this element.
Protected method OnPreviewTouchUp Provides class handling for the PreviewTouchUp routed event that occurs when a touch is released inside this element.
Protected method OnPropertyChanged 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. (Inherited from DependencyObject.)
Protected method OnQueryContinueDrag Invoked when an unhandled DragDrop.QueryContinueDrag attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnQueryCursor Invoked when an unhandled Mouse.QueryCursor attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnStylusButtonDown Invoked when an unhandled Stylus.StylusButtonDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnStylusButtonUp Invoked when an unhandled Stylus.StylusButtonUp attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnStylusDown Invoked when an unhandled Stylus.StylusDown attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnStylusEnter Invoked when an unhandled Stylus.StylusEnter attached event is raised by this element. Implement this method to add class handling for this event.
Protected method OnStylusInAirMove Invoked when an unhandled Stylus.StylusInAirMove attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnStylusInRange Invoked when an unhandled Stylus.StylusInRange attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnStylusLeave Invoked when an unhandled Stylus.StylusLeave attached event is raised by this element. Implement this method to add class handling for this event.
Protected method OnStylusMove Invoked when an unhandled Stylus.StylusMove attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnStylusOutOfRange Invoked when an unhandled Stylus.StylusOutOfRange attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnStylusSystemGesture Invoked when an unhandled Stylus.StylusSystemGesture attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnStylusUp Invoked when an unhandled Stylus.StylusUp attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnTextInput Invoked when an unhandled TextCompositionManager.TextInput attached event reaches an element in its route that is derived from this class. Implement this method to add class handling for this event.
Protected method OnTouchDown Provides class handling for the TouchDown routed event that occurs when a touch presses inside this element.
Protected method OnTouchEnter Provides class handling for the TouchEnter routed event that occurs when a touch moves from outside to inside the bounds of this element.
Protected method OnTouchLeave Provides class handling for the TouchLeave routed event that occurs when a touch moves from inside to outside the bounds of this element.
Protected method OnTouchMove Provides class handling for the TouchMove routed event that occurs when a touch moves while inside this element.
Protected method OnTouchUp Provides class handling for the TouchUp routed event that occurs when a touch is released inside this element.
Public method PredictFocus When overridden in a derived class, returns the element that would receive focus for a specified focus traversal direction, without actually moving focus to that element.
Public method RaiseEvent Raises a specific routed event. The RoutedEvent to be raised is identified within the RoutedEventArgs instance that is provided (as the RoutedEvent property of that event data).
Public method ReadLocalValue Returns the local value of a dependency property, if it exists. (Inherited from DependencyObject.)
Public method ReleaseAllTouchCaptures Releases all captured touch devices from this element.
Public method ReleaseMouseCapture Releases the mouse capture, if this element held the capture.
Public method ReleaseStylusCapture Releases the stylus device capture, if this element held the capture.
Public method ReleaseTouchCapture Attempts to release the specified touch device from this element.
Public method RemoveHandler Removes the specified routed event handler from this element.
Public method SetCurrentValue Sets the value of a dependency property without changing its value source. (Inherited from DependencyObject.)
Public method SetValue(DependencyProperty, Object) Sets the local value of a dependency property, specified by its dependency property identifier. (Inherited from DependencyObject.)
Public method SetValue(DependencyPropertyKey, Object) Sets the local value of a read-only dependency property, specified by the DependencyPropertyKey identifier of the dependency property. (Inherited from DependencyObject.)
Public method ShouldSerializeCommandBindings Returns whether serialization processes should serialize the contents of the CommandBindings property on instances of this class.
Public method ShouldSerializeInputBindings Returns whether serialization processes should serialize the contents of the InputBindings property on instances of this class.
Protected method ShouldSerializeProperty Returns a value that indicates whether serialization processes should serialize the value for the provided dependency property. (Inherited from DependencyObject.)
Public method ToString Returns a string that represents the current object. (Inherited from Object.)
Public method VerifyAccess Enforces that the calling thread has access to this DispatcherObject. (Inherited from DispatcherObject.)
Top
Events

  Name Description
Public event DragEnter Occurs when the input system reports an underlying drag event with this element as the drag target.
Public event DragLeave Occurs when the input system reports an underlying drag event with this element as the drag origin.
Public event DragOver Occurs when the input system reports an underlying drag event with this element as the potential drop target.
Public event Drop Occurs when the input system reports an underlying drop event with this element as the drop target.
Public event FocusableChanged Occurs when the value of the Focusable property changes.
Public event GiveFeedback Occurs when the input system reports an underlying drag-and-drop event that involves this element.
Public event GotFocus Occurs when this element gets logical focus.
Public event GotKeyboardFocus Occurs when the keyboard is focused on this element.
Public event GotMouseCapture Occurs when this element captures the mouse.
Public event GotStylusCapture Occurs when this element captures the stylus.
Public event GotTouchCapture Occurs when a touch is captured to this element.
Public event IsEnabledChanged Occurs when the value of the IsEnabled property on this element changes.
Public event IsKeyboardFocusedChanged Occurs when the value of the IsKeyboardFocused property changes on this element.
Public event IsKeyboardFocusWithinChanged Occurs when the value of the IsKeyboardFocusWithinChanged property changes on this element.
Public event IsMouseCapturedChanged Occurs when the value of the IsMouseCaptured property changes on this element.
Public event IsMouseCaptureWithinChanged Occurs when the value of the IsMouseCaptureWithinProperty changes on this element.
Public event IsMouseDirectlyOverChanged Occurs when the value of the IsMouseDirectlyOver property changes on this element.
Public event IsStylusCapturedChanged Occurs when the value of the IsStylusCaptured property changes on this element.
Public event IsStylusCaptureWithinChanged Occurs when the value of the IsStylusCaptureWithin property changes on this element.
Public event IsStylusDirectlyOverChanged Occurs when the value of the IsStylusDirectlyOver property changes on this element.
Public event KeyDown Occurs when a key is pressed while focus is on this element.
Public event KeyUp Occurs when a key is released while focus is on this element.
Public event LostFocus Occurs when this element loses logical focus.
Public event LostKeyboardFocus Occurs when the keyboard is no longer focused on this element.
Public event LostMouseCapture Occurs when this element loses mouse capture.
Public event LostStylusCapture Occurs when this element loses stylus capture.
Public event LostTouchCapture Occurs when this element loses a touch capture.
Public event MouseDown Occurs when any mouse button is pressed while the pointer is over this element.
Public event MouseEnter Occurs when the mouse pointer enters the bounds of this element.
Public event MouseLeave Occurs when the mouse pointer leaves the bounds of this element.
Public event MouseLeftButtonDown Occurs when the left mouse button is pressed while the mouse pointer is over this element.
Public event MouseLeftButtonUp Occurs when the left mouse button is released while the mouse pointer is over this element.
Public event MouseMove Occurs when the mouse pointer moves while over this element.
Public event MouseRightButtonDown Occurs when the right mouse button is pressed while the mouse pointer is over this element.
Public event MouseRightButtonUp Occurs when the right mouse button is released while the mouse pointer is over this element.
Public event MouseUp Occurs when any mouse button is released over this element.
Public event MouseWheel Occurs when the user rotates the mouse wheel while the mouse pointer is over this element.
Public event PreviewDragEnter Occurs when the input system reports an underlying drag event with this element as the drag target.
Public event PreviewDragLeave Occurs when the input system reports an underlying drag event with this element as the drag origin.
Public event PreviewDragOver Occurs when the input system reports an underlying drag event with this element as the potential drop target.
Public event PreviewDrop Occurs when the input system reports an underlying drop event with this element as the drop target.
Public event PreviewGiveFeedback Occurs when a drag-and-drop operation is started.
Public event PreviewGotKeyboardFocus Occurs when the keyboard is focused on this element.
Public event PreviewKeyDown Occurs when a key is pressed while the keyboard is focused on this element.
Public event PreviewKeyUp Occurs when a key is released while the keyboard is focused on this element.
Public event PreviewLostKeyboardFocus Occurs when the keyboard is no longer focused on this element.
Public event PreviewMouseDown Occurs when any mouse button is pressed while the pointer is over this element.
Public event PreviewMouseLeftButtonDown Occurs when the left mouse button is pressed while the mouse pointer is over this element.
Public event PreviewMouseLeftButtonUp Occurs when the left mouse button is released while the mouse pointer is over this element.
Public event PreviewMouseMove Occurs when the mouse pointer moves while the mouse pointer is over this element.
Public event PreviewMouseRightButtonDown Occurs when the right mouse button is pressed while the mouse pointer is over this element.
Public event PreviewMouseRightButtonUp Occurs when the right mouse button is released while the mouse pointer is over this element.
Public event PreviewMouseUp Occurs when any mouse button is released while the mouse pointer is over this element.
Public event PreviewMouseWheel Occurs when the user rotates the mouse wheel while the mouse pointer is over this element.
Public event PreviewQueryContinueDrag Occurs when there is a change in the keyboard or mouse button state during a drag-and-drop operation.
Public event PreviewStylusButtonDown Occurs when the stylus button is pressed while the pointer is over this element.
Public event PreviewStylusButtonUp Occurs when the stylus button is released while the pointer is over this element.
Public event PreviewStylusDown Occurs when the stylus touches the digitizer while it is over this element.
Public event PreviewStylusInAirMove Occurs when the stylus moves over an element without actually touching the digitizer.
Public event PreviewStylusInRange Occurs when the stylus is close enough to the digitizer to be detected, while over this element.
Public event PreviewStylusMove Occurs when the stylus moves while over the element. The stylus must move while being detected by the  digitizer to raise this event, otherwise, PreviewStylusInAirMove is raised instead.
Public event PreviewStylusOutOfRange Occurs when the stylus is too far from the digitizer to be detected.
Public event PreviewStylusSystemGesture Occurs when a user performs one of several stylus gestures.
Public event PreviewStylusUp Occurs when the user raises the stylus off the digitizer while the stylus is over this element.
Public event PreviewTextInput Occurs when this element gets text in a device-independent manner.
Public event PreviewTouchDown Occurs when a finger touches the screen while the finger is over this element.
Public event PreviewTouchMove Occurs when a finger moves on the screen while the finger is over this element.
Public event PreviewTouchUp Occurs when a finger is raised off of the screen while the finger is over this element.
Public event QueryContinueDrag Occurs when there is a change in the keyboard or mouse button state during a drag-and-drop operation.
Public event QueryCursor Occurs when the cursor is requested to display. This event is raised on an element each time that the mouse pointer moves to a new location, which means the cursor object might need to be changed based on its new position.
Public event StylusButtonDown Occurs when the stylus button is pressed while the pointer is over this element.
Public event StylusButtonUp Occurs when the stylus button is released while the pointer is over this element.
Public event StylusDown Occurs when the stylus touches the digitizer while the stylus is over this element.
Public event StylusEnter Occurs when the stylus enters the bounds of this element.
Public event StylusInAirMove Occurs when the stylus moves over an element without actually touching the digitizer.
Public event StylusInRange Occurs when the stylus is close enough to the digitizer to be detected, while over this element.
Public event StylusLeave Occurs when the stylus leaves the bounds of the element.
Public event StylusMove Occurs when the stylus moves over this element. The stylus must move while on the digitizer to raise this event. Otherwise, StylusInAirMove is raised instead.
Public event StylusOutOfRange Occurs when the stylus is too far from the digitizer to be detected, while over this element.
Public event StylusSystemGesture Occurs when a user performs one of several stylus gestures.
Public event StylusUp Occurs when the user raises the stylus off the digitizer while it is over this element.
Public event TextInput Occurs when this element gets text in a device-independent manner.
Public event TouchDown Occurs when a finger touches the screen while the finger is over this element.
Public event TouchEnter Occurs when a touch moves from outside to inside the bounds of this element.
Public event TouchLeave Occurs when a touch moves from inside to outside the bounds of this element.
Public event TouchMove Occurs when a finger moves on the screen while the finger is over this element.
Public event TouchUp Occurs when a finger is raised off of the screen while the finger is over this element.
Top
Fields

  Name Description
Public field Static member AllowDropProperty Identifies the AllowDrop dependency property.
Public field Static member AreAnyTouchesCapturedProperty Identifies the AreAnyTouchesCaptured dependency property.
Public field Static member AreAnyTouchesCapturedWithinProperty Identifies the AreAnyTouchesCapturedWithin dependency property.
Public field Static member AreAnyTouchesDirectlyOverProperty Identifies the AreAnyTouchesDirectlyOver dependency property.
Public field Static member AreAnyTouchesOverProperty Identifies the AreAnyTouchesOver dependency property.
Public field Static member DragEnterEvent Identifies the DragEnter routed event.
Public field Static member DragLeaveEvent Identifies the DragLeave routed event.
Public field Static member DragOverEvent Identifies the DragOver routed event.
Public field Static member DropEvent Identifies the Drop routed event.
Public field Static member FocusableProperty Identifies the Focusable dependency property.
Public field Static member GiveFeedbackEvent Identifies the GiveFeedback routed event.
Public field Static member GotFocusEvent Identifies the GotFocus routed event.
Public field Static member GotKeyboardFocusEvent Identifies the GotKeyboardFocus routed event.
Public field Static member GotMouseCaptureEvent Identifies the GotMouseCapture routed event.
Public field Static member GotStylusCaptureEvent Identifies the GotStylusCapture routed event.
Public field Static member GotTouchCaptureEvent Identifies the GotTouchCapture routed event.
Public field Static member IsEnabledProperty Identifies the IsEnabled dependency property.
Public field Static member IsFocusedProperty Identifies the IsFocused dependency property.
Public field Static member IsKeyboardFocusedProperty Identifies the IsKeyboardFocused dependency property.
Public field Static member IsKeyboardFocusWithinProperty Identifies the IsKeyboardFocusWithin dependency property.
Public field Static member IsMouseCapturedProperty Identifies the IsMouseCaptured dependency property.
Public field Static member IsMouseCaptureWithinProperty Identifies the IsMouseCaptureWithin dependency property.
Public field Static member IsMouseDirectlyOverProperty Identifies the IsMouseDirectlyOver dependency property.
Public field Static member IsMouseOverProperty Identifies the IsMouseOver dependency property.
Public field Static member IsStylusCapturedProperty Identifies the IsStylusCaptured dependency property.
Public field Static member IsStylusCaptureWithinProperty Identifies the IsStylusCaptureWithin dependency property.
Public field Static member IsStylusDirectlyOverProperty Identifies the IsStylusDirectlyOver dependency property.
Public field Static member IsStylusOverProperty Identifies the IsStylusOver dependency property.
Public field Static member KeyDownEvent Identifies the KeyDown routed event.
Public field Static member KeyUpEvent Identifies the KeyUp routed event.
Public field Static member LostFocusEvent Identifies the LostFocus routed event.
Public field Static member LostKeyboardFocusEvent Identifies the LostKeyboardFocus routed event.
Public field Static member LostMouseCaptureEvent Identifies the LostMouseCapture routed event.
Public field Static member LostStylusCaptureEvent Identifies the LostStylusCapture routed event.
Public field Static member LostTouchCaptureEvent Identifies the LostTouchCapture routed event.
Public field Static member MouseDownEvent Identifies the MouseDown routed event.
Public field Static member MouseEnterEvent Identifies the MouseEnter routed event.
Public field Static member MouseLeaveEvent Identifies the MouseLeave routed event.
Public field Static member MouseLeftButtonDownEvent Identifies the MouseLeftButtonDown routed event.
Public field Static member MouseLeftButtonUpEvent Identifies the MouseLeftButtonUp routed event.
Public field Static member MouseMoveEvent Identifies the MouseMove routed event.
Public field Static member MouseRightButtonDownEvent Identifies the MouseRightButtonDown routed event.
Public field Static member MouseRightButtonUpEvent Identifies the MouseRightButtonUp routed event.
Public field Static member MouseUpEvent Identifies the MouseUp routed event.
Public field Static member MouseWheelEvent Identifies the MouseWheel routed event.
Public field Static member PreviewDragEnterEvent Identifies the PreviewDragEnter routed event.
Public field Static member PreviewDragLeaveEvent Identifies the PreviewDragLeave routed event.
Public field Static member PreviewDragOverEvent Identifies the PreviewDragOver routed event.
Public field Static member PreviewDropEvent Identifies the PreviewDrop routed event.
Public field Static member PreviewGiveFeedbackEvent Identifies the PreviewGiveFeedback routed event.
Public field Static member PreviewGotKeyboardFocusEvent Identifies the PreviewGotKeyboardFocus routed event.
Public field Static member PreviewKeyDownEvent Identifies the PreviewKeyDown routed event.
Public field Static member PreviewKeyUpEvent Identifies the PreviewKeyUp routed event.
Public field Static member PreviewLostKeyboardFocusEvent Identifies the PreviewLostKeyboardFocus routed event.
Public field Static member PreviewMouseDownEvent Identifies the PreviewMouseDown routed event.
Public field Static member PreviewMouseLeftButtonDownEvent Identifies the PreviewMouseLeftButtonDown routed event.
Public field Static member PreviewMouseLeftButtonUpEvent Identifies the PreviewMouseLeftButtonUp routed event.
Public field Static member PreviewMouseMoveEvent Identifies the PreviewMouseMove routed event.
Public field Static member PreviewMouseRightButtonDownEvent Identifies the PreviewMouseRightButtonDown routed event.
Public field Static member PreviewMouseRightButtonUpEvent Identifies the PreviewMouseRightButtonUp routed event.
Public field Static member PreviewMouseUpEvent Identifies the PreviewMouseUp routed event.
Public field Static member PreviewMouseWheelEvent Identifies the PreviewMouseWheel routed event.
Public field Static member PreviewQueryContinueDragEvent Identifies the PreviewQueryContinueDrag routed event.
Public field Static member PreviewStylusButtonDownEvent Identifies the PreviewStylusButtonDown routed event.
Public field Static member PreviewStylusButtonUpEvent Identifies the PreviewStylusButtonUp routed event.
Public field Static member PreviewStylusDownEvent Identifies the PreviewStylusDown routed event.
Public field Static member PreviewStylusInAirMoveEvent Identifies the PreviewStylusInAirMove routed event.
Public field Static member PreviewStylusInRangeEvent Identifies the PreviewStylusInRange routed event.
Public field Static member PreviewStylusMoveEvent Identifies the PreviewStylusMove routed event.
Public field Static member PreviewStylusOutOfRangeEvent Identifies the PreviewStylusOutOfRange routed event.
Public field Static member PreviewStylusSystemGestureEvent Identifies the PreviewStylusSystemGesture routed event.
Public field Static member PreviewStylusUpEvent Identifies the PreviewStylusUp routed event.
Public field Static member PreviewTextInputEvent Identifies the PreviewTextInput routed event.
Public field Static member PreviewTouchDownEvent Identifies the PreviewTouchDown routed event.
Public field Static member PreviewTouchMoveEvent Identifies the PreviewTouchMove routed event.
Public field Static member PreviewTouchUpEvent Identifies the PreviewTouchUp routed event.
Public field Static member QueryContinueDragEvent Identifies the QueryContinueDrag routed event.
Public field Static member QueryCursorEvent Identifies the QueryCursor routed event.
Public field Static member StylusButtonDownEvent Identifies the StylusButtonDown routed event.
Public field Static member StylusButtonUpEvent Identifies the StylusButtonUp routed event.
Public field Static member StylusDownEvent Identifies the StylusDown routed event.
Public field Static member StylusEnterEvent Identifies the StylusEnter routed event.
Public field Static member StylusInAirMoveEvent Identifies the StylusInAirMove routed event.
Public field Static member StylusInRangeEvent Identifies the StylusInRange routed event.
Public field Static member StylusLeaveEvent Identifies the StylusLeave routed event.
Public field Static member StylusMoveEvent Identifies the StylusMove routed event.
Public field Static member StylusOutOfRangeEvent Identifies the StylusOutOfRange routed event.
Public field Static member StylusSystemGestureEvent Identifies the StylusSystemGesture routed event.
Public field Static member StylusUpEvent Identifies the StylusUp routed event.
Public field Static member TextInputEvent Identifies the TextInput routed event.
Public field Static member TouchDownEvent Identifies the TouchDown routed event.
Public field Static member TouchEnterEvent Identifies the TouchEnter routed event.
Public field Static member TouchLeaveEvent Identifies the TouchLeave routed event.
Public field Static member TouchMoveEvent Identifies the TouchMove routed event.
Public field Static member TouchUpEvent Identifies the TouchUp routed event.
Top
Remarks

ContentElement defines the following common content characteristics:

  • Input: All ContentElement derived classes provide support for basic input capture from keyboard, mouse, drag-and-drop operations, stylus controls, and accelerators.

  • Focus: All ContentElement derived classes are potentially focusable. (However, the default focusable state for the ContentElement base class is false. For details on how to make a ContentElement focusable, see Focusable.) In addition, this class contains APIs that you can use for traversing the focus across related elements.

  • Events: ContentElement includes events that are related to input and focus; it also includes events for changes in state. In many cases, the ContentElement events are routed events. In some cases, routed events have both tunneling and bubbling routing strategies, raised as separate events in response to the same state or condition. Also, ContentElement defines APIs that can raise routed events and that can add or remove handlers to events.

ContentElement shares many common APIs with UIElement. These common APIs do not come from a shared class inheritance. But they do share common naming, similar behavior, and similar internal implementation of APIs in each class. The similarity is because ContentElement and UIElement are each classes that are an element base, although each has different intentions for its markup object model behavior.

In particular, UIElement descends from Visual, which provides the lower-level graphics support for rendering a ContentElement to a rectangular region within a composited window, whereas ContentElement defers rendering so that concepts more common to document scenarios, such as flow and wrapping, are more easily supported. These two related classes also implement the common interfaces IInputElement and IAnimatable.

Notes to Inheritors

The ContentElement class does not yet define all aspects of a complete content element for flow-style presentation. FrameworkContentElement is an immediately derived class of ContentElement. FrameworkContentElement includes a more complete set of additional members that support rendering a FrameworkContentElement within a content host and using the WPF framework-level layout system.

Version Information

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Platforms

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
See Also

Reference

Other Resources