Class ContentPresenter
Displays the content of a ContentControl.
Inheritance
Inherited Members
Namespace: System.Windows.Controls
Assembly: OpenSilver.dll
Syntax
public class ContentPresenter : FrameworkElement, IFrameworkElement, IUIElement, IDependencyObject
Constructors
| Improve this Doc View SourceContentPresenter()
Initializes a new instance of the ContentPresenter class.
Declaration
public ContentPresenter()
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 data that is used to generate the child elements of a ContentPresenter.
Declaration
public object Content { get; set; }
Property Value
Type | Description |
---|---|
System.Object | The data that is used to generate the child elements. The default is null. |
ContentTemplate
Gets or sets the template that is used to display the content of the control.
Declaration
public DataTemplate ContentTemplate { get; set; }
Property Value
Type | Description |
---|---|
DataTemplate | A DataTemplate that defines the visualization of the content. The default is null. |
Methods
| Improve this Doc View SourceArrangeOverride(Size)
Provides the behavior for the Arrange pass of Silverlight layout. Classes can override this method to define their own Arrange pass behavior.
Declaration
protected override Size ArrangeOverride(Size finalSize)
Parameters
Type | Name | Description |
---|---|---|
Size | finalSize | The final area within the parent that this object should use to arrange itself and its children. |
Returns
Type | Description |
---|---|
Size | The actual size that is used after the element is arranged in layout. |
Overrides
| Improve this Doc View SourceMeasureOverride(Size)
Provides the behavior for the Measure pass of Silverlight layout. Classes can override this method to define their own Measure pass behavior.
Declaration
protected override Size MeasureOverride(Size availableSize)
Parameters
Type | Name | Description |
---|---|---|
Size | availableSize | The available size that this object can give to child objects. Infinity (System.Double.PositiveInfinity) can be specified as a value to indicate that the object will size to whatever content is available. |
Returns
Type | Description |
---|---|
Size | The size that this object determines it needs during layout, based on its calculations of the allocated sizes for child objects; or based on other considerations, such as a fixed container size. |