Class ContentControl
Represents a control with a single piece of content. Controls such as Button, CheckBox, and ScrollViewer directly or indirectly inherit from this class.
Inheritance
System.Object
ContentControl
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.Controls
Assembly: OpenSilver.dll
Syntax
public class ContentControl : Control, IControl, IFrameworkElement, IUIElement, IDependencyObject
Constructors
| Improve this Doc View SourceContentControl()
Declaration
public ContentControl()
Fields
| Improve this Doc View SourceContentProperty
Identifies the Content dependency property.
Declaration
public static readonly DependencyProperty ContentProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ContentTemplateProperty
Identifies the ContentTemplate dependency property.
Declaration
public static readonly DependencyProperty ContentTemplateProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceContent
Gets or sets the content of a ContentControl.
Declaration
public object Content { get; set; }
Property Value
Type | Description |
---|---|
System.Object |
ContentTemplate
Gets or sets the data template that is used to display the content of the ContentControl.
Declaration
public DataTemplate ContentTemplate { get; set; }
Property Value
Type | Description |
---|---|
DataTemplate |
LogicalChildren
Gets an enumerator to the content control's logical child elements.
Declaration
protected override IEnumerator LogicalChildren { get; }
Property Value
Type | Description |
---|---|
System.Collections.IEnumerator | An enumerator. The default value is null. |
Overrides
Methods
| Improve this Doc View SourceOnContentChanged(Object, Object)
Declaration
protected virtual void OnContentChanged(object oldContent, object newContent)
Parameters
Type | Name | Description |
---|---|---|
System.Object | oldContent | |
System.Object | newContent |