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
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 |
Methods
| Improve this Doc View SourceArrangeOverride(Size)
Declaration
protected override Size ArrangeOverride(Size finalSize)
Parameters
Type | Name | Description |
---|---|---|
Size | finalSize |
Returns
Type | Description |
---|---|
Size |
Overrides
| Improve this Doc View SourceINTERNAL_OnAttachedToVisualTree()
Declaration
protected override void INTERNAL_OnAttachedToVisualTree()
Overrides
| Improve this Doc View SourceMeasureOverride(Size)
Declaration
protected override Size MeasureOverride(Size availableSize)
Parameters
Type | Name | Description |
---|---|---|
Size | availableSize |
Returns
Type | Description |
---|---|
Size |
Overrides
| 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 |