ContentPresenter ContentPresenter ContentPresenter ContentPresenter Class

Definition

Displays the content of a ContentControl. Can also provide content presentation for non-controls. Provides a base class for specialized presenters such as ScrollContentPresenter.

public : class ContentPresenter : FrameworkElement, IContentPresenter, IContentPresenter2, IContentPresenter3, IContentPresenter4, IContentPresenterOverrides
public class ContentPresenter : FrameworkElement, IContentPresenter, IContentPresenter2, IContentPresenter3, IContentPresenter4, IContentPresenterOverrides
Public Class ContentPresenter Inherits FrameworkElement Implements IContentPresenter, IContentPresenter2, IContentPresenter3, IContentPresenter4, IContentPresenterOverrides
var contentPresenter = new contentPresenter();
<ContentPresenter .../>
Inheritance
Attributes
Windows 10 requirements
Device family
Windows 10 (introduced v10.0.10240.0)
API contract
Windows.Foundation.UniversalApiContract (introduced v1)

Examples

This example shows a typical placement of a ContentPresenter object element as part of the ControlTemplate for a ContentControl. This example is a simplification of the Windows Runtime XAML default style for HyperlinkButton. One example VisualState is included to show how the ContentPresenter properties are changed based on state. The ContentPresenter is within a Border in the composition; it's common for content controls to have the ContentPresenter nested within one other parent element, and that parent element often template-binds some of the control properties that a ContentPresenter doesn't have. Note also how the ContentPresenter uses {TemplateBinding} markup extension to bind HorizontalAlignment / VerticalAlignment values to the control properties of where the template is applied.

    <!-- Default style for Windows.UI.Xaml.Controls.Primitives.HyperlinkButton -->
    <Style TargetType="HyperlinkButton">
...
        <Setter Property="HorizontalAlignment" Value="Left"/>
        <Setter Property="VerticalAlignment" Value="Center"/>
...
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="HyperlinkButton">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
...
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ContentPresenter"
                                                                       Storyboard.TargetProperty="Foreground">
                                            <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource HyperlinkDisabledThemeBrush}"/>
                                        </ObjectAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Border"
                                Background="{TemplateBinding Background}"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Margin="3">
                            <ContentPresenter x:Name="ContentPresenter"
                                              Content="{TemplateBinding Content}"
                                              ContentTransitions="{TemplateBinding ContentTransitions}"
                                              ContentTemplate="{TemplateBinding ContentTemplate}"
                                              HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              VerticalAlignment="{TemplateBinding VerticalContentAlignment}" 
                    />
                        </Border>
                        <!--focus visuals omitted-->
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

Remarks

Typically, you use the ContentPresenter directly within the ControlTemplate of a ContentControl to mark where the content to be presented appears.

A ContentPresenter is often used to apply characteristics to text content, which are set into a Content property using only a string for the text (or some indirect equivalent such as a Binding or a RESX resource). For this reason the properties of a ContentPresenter are similar to the properties of the TextElement class. (The TextElement class is a base class for several elements that aren't controls but are used to format the text that might appear in a control or layout container.)

Tip

Starting in Windows 10, ContentPresenter defines new border properties that let you draw a border around the ContentPresenter without using an additional Border element. The new properties are ContentPresenter.BorderBrush, ContentPresenter.BorderThickness, ContentPresenter.CornerRadius, and ContentPresenter.Padding.

<ContentPresenter BorderBrush="Red" BorderThickness="2" CornerRadius="10" Padding="12">
</ContentPresenter>

A ContentPresenter can use a logic class to influence which template to use for templated data content at run-time. For more info, see the ContentTemplateSelector property.

If the ContentPresenter is in the ControlTemplate of a ContentControl, the ContentPresenter behavior will implicitly bind to the ContentTemplate and Content properties of the templated ContentControl.

ContentPresenter derived classes

ContentPresenter is the parent class for these classes:

Constructors

ContentPresenter() ContentPresenter() ContentPresenter() ContentPresenter()

Initializes a new instance of the ContentPresenter class.

public : ContentPresenter()
public ContentPresenter()
Public Sub New()
var contentPresenter = new contentPresenter();

Properties

Background Background Background Background

Gets or sets the Brush to apply to the background of content handled by the ContentPresenter.

public : Brush Background { get; set; }
public Brush Background { get; set; }
Public ReadWrite Property Background As Brush
var brush = contentPresenter.background;
contentPresenter.background = brush;
<ContentPresenter Background="{StaticResource resourceName}"/>

Value
Brush Brush Brush Brush

The brush used as the background brush for the contents. The default is a null brush from a pure code perspective, but system style defaults set this to White (for Light theme) or Black (for Dark theme).

BackgroundProperty BackgroundProperty BackgroundProperty BackgroundProperty

Identifies the Background dependency property.

public : static DependencyProperty BackgroundProperty { get; }
public static DependencyProperty BackgroundProperty { get; }
Public Static ReadOnly Property BackgroundProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.backgroundProperty;
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the Background dependency property.

See Also

BorderBrush BorderBrush BorderBrush BorderBrush

Gets or sets a brush that describes the border fill of the content presenter.

public : Brush BorderBrush { get; set; }
public Brush BorderBrush { get; set; }
Public ReadWrite Property BorderBrush As Brush
var brush = contentPresenter.borderBrush;
contentPresenter.borderBrush = brush;
<ContentPresenter BorderBrush="{StaticResource resourceName}"/>

Value
Brush Brush Brush Brush

The brush that is used to fill the content presenter's border. The default is null, (a null brush) which is evaluated as Transparent for rendering.

Remarks

The BorderThickness value must be greater than 0 in order to see the BorderBrush value take effect.

BorderBrushProperty BorderBrushProperty BorderBrushProperty BorderBrushProperty

Identifies the BorderBrush dependency property.

public : static DependencyProperty BorderBrushProperty { get; }
public static DependencyProperty BorderBrushProperty { get; }
Public Static ReadOnly Property BorderBrushProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.borderBrushProperty;
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the BorderBrush dependency property.

See Also

BorderThickness BorderThickness BorderThickness BorderThickness

Gets or sets the border thickness of the content presenter.

public : Thickness BorderThickness { get; set; }
public Thickness BorderThickness { get; set; }
Public ReadWrite Property BorderThickness As Thickness
var thickness = contentPresenter.borderThickness;
contentPresenter.borderThickness = thickness;
<ContentPresenter BorderThickness="uniform"/>
- or -
<ContentPresenter BorderThickness="left&right,top&bottom"/>
- or -
<ContentPresenter BorderThickness="left,top,right,bottom"/>
Value
Thickness Thickness Thickness Thickness

The border thickness of the content presenter, as a Thickness value.

BorderThicknessProperty BorderThicknessProperty BorderThicknessProperty BorderThicknessProperty

Identifies the BorderThickness dependency property.

public : static DependencyProperty BorderThicknessProperty { get; }
public static DependencyProperty BorderThicknessProperty { get; }
Public Static ReadOnly Property BorderThicknessProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.borderThicknessProperty;
See Also

CharacterSpacing CharacterSpacing CharacterSpacing CharacterSpacing

Gets or sets the uniform spacing between characters, in units of 1/1000 of an em.

public : int CharacterSpacing { get; set; }
public int CharacterSpacing { get; set; }
Public ReadWrite Property CharacterSpacing As int
var int = contentPresenter.characterSpacing;
contentPresenter.characterSpacing = int;
<ContentPresenter CharacterSpacing="int"/>
Value
int int int int

The uniform spacing between characters, in units of 1/1000 of an em. The default is 0. Positive values increase tracking and loosen character spacing. Negative values decrease tracking and tighten the character spacing.

CharacterSpacingProperty CharacterSpacingProperty CharacterSpacingProperty CharacterSpacingProperty

Identifies the CharacterSpacing dependency property.

public : static DependencyProperty CharacterSpacingProperty { get; }
public static DependencyProperty CharacterSpacingProperty { get; }
Public Static ReadOnly Property CharacterSpacingProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.characterSpacingProperty;

Content Content Content Content

Gets or sets the data that is used to generate the child elements of a ContentPresenter.

public : Platform::Object Content { get; set; }
public object Content { get; set; }
Public ReadWrite Property Content As object
var object = contentPresenter.content;
contentPresenter.content = object;
<ContentPresenter Content="{Binding}"/>
Value
Platform::Object object object object

The data that is used to generate the child elements. The default is null.

ContentProperty ContentProperty ContentProperty ContentProperty

Identifies the Content dependency property

public : static DependencyProperty ContentProperty { get; }
public static DependencyProperty ContentProperty { get; }
Public Static ReadOnly Property ContentProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.contentProperty;
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the Content dependency property.

ContentTemplate ContentTemplate ContentTemplate ContentTemplate

Gets or sets the template that is used to display the content of the control.

public : DataTemplate ContentTemplate { get; set; }
public DataTemplate ContentTemplate { get; set; }
Public ReadWrite Property ContentTemplate As DataTemplate
var dataTemplate = contentPresenter.contentTemplate;
contentPresenter.contentTemplate = dataTemplate;
<ContentPresenter ContentTemplate="{Binding}"/>
Value
DataTemplate DataTemplate DataTemplate DataTemplate

A DataTemplate that defines the visualization of the content. The default is null.

ContentTemplateProperty ContentTemplateProperty ContentTemplateProperty ContentTemplateProperty

Identifies the ContentTemplate dependency property.

public : static DependencyProperty ContentTemplateProperty { get; }
public static DependencyProperty ContentTemplateProperty { get; }
Public Static ReadOnly Property ContentTemplateProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.contentTemplateProperty;

ContentTemplateSelector ContentTemplateSelector ContentTemplateSelector ContentTemplateSelector

Gets or sets a selection object that changes the DataTemplate to apply for content presented in the ContentPresenter, based on processing information about the content item or its container at run time.

public : DataTemplateSelector ContentTemplateSelector { get; set; }
public DataTemplateSelector ContentTemplateSelector { get; set; }
Public ReadWrite Property ContentTemplateSelector As DataTemplateSelector
var dataTemplateSelector = contentPresenter.contentTemplateSelector;
contentPresenter.contentTemplateSelector = dataTemplateSelector;
<ContentPresenter ContentTemplateSelector="selectorReference" />

Value
DataTemplateSelector DataTemplateSelector DataTemplateSelector DataTemplateSelector

A selection object that changes the DataTemplate to apply for content.

ContentTemplateSelectorProperty ContentTemplateSelectorProperty ContentTemplateSelectorProperty ContentTemplateSelectorProperty

Identifies the ContentTemplateSelector dependency property.

public : static DependencyProperty ContentTemplateSelectorProperty { get; }
public static DependencyProperty ContentTemplateSelectorProperty { get; }
Public Static ReadOnly Property ContentTemplateSelectorProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.contentTemplateSelectorProperty;

ContentTransitions ContentTransitions ContentTransitions ContentTransitions

Gets or sets the collection of Transition style elements that apply to content presented by the ContentPresenter.

public : TransitionCollection ContentTransitions { get; set; }
public TransitionCollection ContentTransitions { get; set; }
Public ReadWrite Property ContentTransitions As TransitionCollection
var transitionCollection = contentPresenter.contentTransitions;
contentPresenter.contentTransitions = transitionCollection;
<contentPresenter>
  <contentPresenter.ContentTransitions>
    <TransitionCollection>
      oneOrMoreTransitions
    </TransitionCollection>
  </contentPresenter.ContentTransitions>
</contentPresenter>
Value
TransitionCollection TransitionCollection TransitionCollection TransitionCollection

The strongly typed collection of Transition style elements.

Remarks

Important

The XAML syntax for all properties that use a TransitionCollection value is unusual in that you must declare an explicit TransitionCollection object element as the value, and then provide object elements as child elements of TransitionCollection for each of the transition animations you want to use. For most other XAML collection properties you could omit the collection object element because it can be implicit, but properties that use TransitionCollection don't support the implicit collection usage. For more info on implicit collections and XAML, see XAML syntax guide.

Transition animations play a particular role in UI design of your app. The basic idea is that when there is a change or transition, the animation draws the attention of the user to the change.

See Also

ContentTransitionsProperty ContentTransitionsProperty ContentTransitionsProperty ContentTransitionsProperty

Identifies the ContentTransitions dependency property.

public : static DependencyProperty ContentTransitionsProperty { get; }
public static DependencyProperty ContentTransitionsProperty { get; }
Public Static ReadOnly Property ContentTransitionsProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.contentTransitionsProperty;

CornerRadius CornerRadius CornerRadius CornerRadius

Gets or sets the radius for the corners of the content presenter's border.

public : CornerRadius CornerRadius { get; set; }
public CornerRadius CornerRadius { get; set; }
Public ReadWrite Property CornerRadius As CornerRadius
var cornerRadius = contentPresenter.cornerRadius;
contentPresenter.cornerRadius = cornerRadius;
<ContentPresenter CornerRadius="uniformRadius"/>
- or -
<ContentPresenter CornerRadius="topLeft,topRight,bottomRight,bottomLeft"/>

Value
CornerRadius CornerRadius CornerRadius CornerRadius

The degree to which the corners are rounded, expressed as values of the CornerRadius structure.

Remarks

Member components of a CornerRadius value cannot be negative.

CornerRadiusProperty CornerRadiusProperty CornerRadiusProperty CornerRadiusProperty

Identifies the CornerRadius dependency property.

public : static DependencyProperty CornerRadiusProperty { get; }
public static DependencyProperty CornerRadiusProperty { get; }
Public Static ReadOnly Property CornerRadiusProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.cornerRadiusProperty;
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the CornerRadius dependency property.

See Also

FontFamily FontFamily FontFamily FontFamily

Gets or sets the preferred top-level font family for the text content presented by the ContentPresenter.

public : FontFamily FontFamily { get; set; }
public FontFamily FontFamily { get; set; }
Public ReadWrite Property FontFamily As FontFamily
var fontFamily = contentPresenter.fontFamily;
contentPresenter.fontFamily = fontFamily;
<ContentPresenter FontFamily="fontFamily" />
-or-
<ContentPresenter FontFamily="fontFamilyName[,fallbackFontFamilyName]" />
-or-
<ContentPresenter FontFamily="fontURI#fontFamily" />
Value
FontFamily FontFamily FontFamily FontFamily

A FontFamily object that specifies the preferred font family, or a primary preferred font family with one or more fallback font families. For information about defaults, see the FontFamily class topic.

FontFamilyProperty FontFamilyProperty FontFamilyProperty FontFamilyProperty

Identifies the FontFamily dependency property.

public : static DependencyProperty FontFamilyProperty { get; }
public static DependencyProperty FontFamilyProperty { get; }
Public Static ReadOnly Property FontFamilyProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.fontFamilyProperty;
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the FontFamily dependency property.

FontSize FontSize FontSize FontSize

Gets or sets the font size for the text content presented by the ContentPresenter.

public : double FontSize { get; set; }
public double FontSize { get; set; }
Public ReadWrite Property FontSize As double
var double = contentPresenter.fontSize;
contentPresenter.fontSize = double;
<ContentPresenter FontSize="double" .../>
Value
double double double double

A non-negative value that specifies the font size, measured in pixels.

FontSizeProperty FontSizeProperty FontSizeProperty FontSizeProperty

Identifies the FontSize dependency property.

public : static DependencyProperty FontSizeProperty { get; }
public static DependencyProperty FontSizeProperty { get; }
Public Static ReadOnly Property FontSizeProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.fontSizeProperty;
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the FontSize dependency property.

FontStretch FontStretch FontStretch FontStretch

Gets or sets the font stretch for the text content presented by the ContentPresenter.

public : FontStretch FontStretch { get; set; }
public FontStretch FontStretch { get; set; }
Public ReadWrite Property FontStretch As FontStretch
var fontStretch = contentPresenter.fontStretch;
contentPresenter.fontStretch = fontStretch;
<ContentPresenter FontStretch="fontStretchMemberName"/>
Value
FontStretch FontStretch FontStretch FontStretch

The requested font stretch, as a FontStretch constant. The default is Normal.

FontStretchProperty FontStretchProperty FontStretchProperty FontStretchProperty

Identifies the FontStretch dependency property.

public : static DependencyProperty FontStretchProperty { get; }
public static DependencyProperty FontStretchProperty { get; }
Public Static ReadOnly Property FontStretchProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.fontStretchProperty;
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the FontStretch dependency property.

FontStyle FontStyle FontStyle FontStyle

Gets or sets the font style for the presented content.

public : FontStyle FontStyle { get; set; }
public FontStyle FontStyle { get; set; }
Public ReadWrite Property FontStyle As FontStyle
var fontStyle = contentPresenter.fontStyle;
contentPresenter.fontStyle = fontStyle;
<ContentPresenter FontStyle="fontStyleMemberName"/>
Value
FontStyle FontStyle FontStyle FontStyle

The requested font style, which is a FontStyle constant name. The default is Normal.

FontStyleProperty FontStyleProperty FontStyleProperty FontStyleProperty

Identifies the FontStyle dependency property.

public : static DependencyProperty FontStyleProperty { get; }
public static DependencyProperty FontStyleProperty { get; }
Public Static ReadOnly Property FontStyleProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.fontStyleProperty;
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the FontStyle dependency property.

FontWeight FontWeight FontWeight FontWeight

Gets or sets the top-level font weight for the text content presented by the ContentPresenter.

public : FontWeight FontWeight { get; set; }
public FontWeight FontWeight { get; set; }
Public ReadWrite Property FontWeight As FontWeight
var fontWeight = contentPresenter.fontWeight;
contentPresenter.fontWeight = fontWeight;
<ContentPresenter FontWeight="fontWeightsValue"/>
Value
FontWeight FontWeight FontWeight FontWeight

The requested font weight, which is a FontWeight that is obtained from one of the FontWeights property values. The default is Normal.

FontWeightProperty FontWeightProperty FontWeightProperty FontWeightProperty

Identifies the FontWeight dependency property.

public : static DependencyProperty FontWeightProperty { get; }
public static DependencyProperty FontWeightProperty { get; }
Public Static ReadOnly Property FontWeightProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.fontWeightProperty;
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the FontWeight dependency property.

Foreground Foreground Foreground Foreground

Gets or sets the Brush to apply to the text content handled by the ContentPresenter.

public : Brush Foreground { get; set; }
public Brush Foreground { get; set; }
Public ReadWrite Property Foreground As Brush
var brush = contentPresenter.foreground;
contentPresenter.foreground = brush;
<ContentPresenter Foreground="{StaticResource resourceName}"/>

Value
Brush Brush Brush Brush

The brush used as the foreground brush for the text contents. The default is a null brush from a pure code perspective, but system style defaults set this to Black (for Light theme) or White (for Dark theme).

See Also

ForegroundProperty ForegroundProperty ForegroundProperty ForegroundProperty

Identifies the Foreground dependency property.

public : static DependencyProperty ForegroundProperty { get; }
public static DependencyProperty ForegroundProperty { get; }
Public Static ReadOnly Property ForegroundProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.foregroundProperty;
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the Foreground dependency property.

HorizontalContentAlignment HorizontalContentAlignment HorizontalContentAlignment HorizontalContentAlignment

Gets or sets the horizontal alignment of the content.

public : HorizontalAlignment HorizontalContentAlignment { get; set; }
public HorizontalAlignment HorizontalContentAlignment { get; set; }
Public ReadWrite Property HorizontalContentAlignment As HorizontalAlignment
var horizontalAlignment = contentPresenter.horizontalContentAlignment;
contentPresenter.horizontalContentAlignment = horizontalAlignment;
<ContentPresenter  HorizontalContentAlignment="horizontalAlignmentMemberName"/>

HorizontalContentAlignmentProperty HorizontalContentAlignmentProperty HorizontalContentAlignmentProperty HorizontalContentAlignmentProperty

Identifies the HorizontalContentAlignment dependency property.

public : static DependencyProperty HorizontalContentAlignmentProperty { get; }
public static DependencyProperty HorizontalContentAlignmentProperty { get; }
Public Static ReadOnly Property HorizontalContentAlignmentProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.horizontalContentAlignmentProperty;
See Also

IsTextScaleFactorEnabled IsTextScaleFactorEnabled IsTextScaleFactorEnabled IsTextScaleFactorEnabled

Gets or sets whether automatic text enlargement, to reflect the system text size setting, is enabled.

public : Platform::Boolean IsTextScaleFactorEnabled { get; set; }
public bool IsTextScaleFactorEnabled { get; set; }
Public ReadWrite Property IsTextScaleFactorEnabled As bool
var bool = contentPresenter.isTextScaleFactorEnabled;
contentPresenter.isTextScaleFactorEnabled = bool;
<ContentPresenter IsTextScaleFactorEnabled="bool"/>
Value
Platform::Boolean bool bool bool

true if automatic text enlargement is enabled; otherwise, false.

See Also

IsTextScaleFactorEnabledProperty IsTextScaleFactorEnabledProperty IsTextScaleFactorEnabledProperty IsTextScaleFactorEnabledProperty

Identifies the IsTextScaleFactorEnabled dependency property.

public : static DependencyProperty IsTextScaleFactorEnabledProperty { get; }
public static DependencyProperty IsTextScaleFactorEnabledProperty { get; }
Public Static ReadOnly Property IsTextScaleFactorEnabledProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.isTextScaleFactorEnabledProperty;

LineHeight LineHeight LineHeight LineHeight

Gets or sets the height of each line of text content presented by the ContentPresenter.

public : double LineHeight { get; set; }
public double LineHeight { get; set; }
Public ReadWrite Property LineHeight As double
var double = contentPresenter.lineHeight;
contentPresenter.lineHeight = double;
<ContentPresenter LineHeight="double"/>
Value
double double double double

The height in pixels of each line of text content. A value of 0 indicates that the line height is determined automatically from the current font characteristics. The default is 0.

LineHeightProperty LineHeightProperty LineHeightProperty LineHeightProperty

Identifies the LineHeight dependency property.

public : static DependencyProperty LineHeightProperty { get; }
public static DependencyProperty LineHeightProperty { get; }
Public Static ReadOnly Property LineHeightProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.lineHeightProperty;
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the LineHeight dependency property.

LineStackingStrategy LineStackingStrategy LineStackingStrategy LineStackingStrategy

Gets or sets a value that indicates how a line box is determined for each line of text.

public : LineStackingStrategy LineStackingStrategy { get; set; }
public LineStackingStrategy LineStackingStrategy { get; set; }
Public ReadWrite Property LineStackingStrategy As LineStackingStrategy
var lineStackingStrategy = contentPresenter.lineStackingStrategy;
contentPresenter.lineStackingStrategy = lineStackingStrategy;
Value
LineStackingStrategy LineStackingStrategy LineStackingStrategy LineStackingStrategy

A value that indicates how a line box is determined for each line of text. The default is MaxHeight.

LineStackingStrategyProperty LineStackingStrategyProperty LineStackingStrategyProperty LineStackingStrategyProperty

Identifies the LineStackingStrategy dependency property.

public : static DependencyProperty LineStackingStrategyProperty { get; }
public static DependencyProperty LineStackingStrategyProperty { get; }
Public Static ReadOnly Property LineStackingStrategyProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.lineStackingStrategyProperty;

MaxLines MaxLines MaxLines MaxLines

Gets or sets the maximum lines of text shown.

public : int MaxLines { get; set; }
public int MaxLines { get; set; }
Public ReadWrite Property MaxLines As int
var int = contentPresenter.maxLines;
contentPresenter.maxLines = int;
Value
int int int int

The maximum lines of text shown. The default is 0, which is a special value that represents "Auto" behavior. The value cannot be negative.

MaxLinesProperty MaxLinesProperty MaxLinesProperty MaxLinesProperty

Identifies the MaxLines dependency property.

public : static DependencyProperty MaxLinesProperty { get; }
public static DependencyProperty MaxLinesProperty { get; }
Public Static ReadOnly Property MaxLinesProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.maxLinesProperty;
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the MaxLines dependency property.

OpticalMarginAlignment OpticalMarginAlignment OpticalMarginAlignment OpticalMarginAlignment

Get or sets a value that indicates how the font is modified to align with fonts of different sizes.

public : OpticalMarginAlignment OpticalMarginAlignment { get; set; }
public OpticalMarginAlignment OpticalMarginAlignment { get; set; }
Public ReadWrite Property OpticalMarginAlignment As OpticalMarginAlignment
var opticalMarginAlignment = contentPresenter.opticalMarginAlignment;
contentPresenter.opticalMarginAlignment = opticalMarginAlignment;
<ContentPresenter OpticalMarginAlignment="None"/>
-or-
<ContentPresenter OpticalMarginAlignment="TrimSideBearings"/>
Value
OpticalMarginAlignment OpticalMarginAlignment OpticalMarginAlignment OpticalMarginAlignment

A value of the enumeration that indicates how the font is modified to align at different sizes. The default is None.

OpticalMarginAlignmentProperty OpticalMarginAlignmentProperty OpticalMarginAlignmentProperty OpticalMarginAlignmentProperty

Identifies the OpticalMarginAlignment dependency property.

public : static DependencyProperty OpticalMarginAlignmentProperty { get; }
public static DependencyProperty OpticalMarginAlignmentProperty { get; }
Public Static ReadOnly Property OpticalMarginAlignmentProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.opticalMarginAlignmentProperty;

Padding Padding Padding Padding

Gets or sets the distance between the border and its child object.

public : Thickness Padding { get; set; }
public Thickness Padding { get; set; }
Public ReadWrite Property Padding As Thickness
var thickness = contentPresenter.padding;
contentPresenter.padding = thickness;
Value
Thickness Thickness Thickness Thickness

The dimensions of the space between the border and its child as a Thickness value. Thickness is a structure that stores dimension values using pixel measures.

Remarks

A related property is Margin (a property of FrameworkElement ). For more info about the relationship between margin and padding, see Alignment, margin, and padding or Define layouts with XAML.

PaddingProperty PaddingProperty PaddingProperty PaddingProperty

Identifies the Padding dependency property.

public : static DependencyProperty PaddingProperty { get; }
public static DependencyProperty PaddingProperty { get; }
Public Static ReadOnly Property PaddingProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.paddingProperty;
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the Padding dependency property.

See Also

TextLineBounds TextLineBounds TextLineBounds TextLineBounds

Gets or sets a value that indicates how the line box height is determined for each line of text displayed in the ContentPresenter.

public : TextLineBounds TextLineBounds { get; set; }
public TextLineBounds TextLineBounds { get; set; }
Public ReadWrite Property TextLineBounds As TextLineBounds
var textLineBounds = contentPresenter.textLineBounds;
contentPresenter.textLineBounds = textLineBounds;
<ContentPresenter TextLineBounds="textLineBoundsValue"/>
Value
TextLineBounds TextLineBounds TextLineBounds TextLineBounds

A value that indicates how the line box height is determined for each line of text. The default is Full.

TextLineBoundsProperty TextLineBoundsProperty TextLineBoundsProperty TextLineBoundsProperty

Identifies the TextLineBounds dependency property.

public : static DependencyProperty TextLineBoundsProperty { get; }
public static DependencyProperty TextLineBoundsProperty { get; }
Public Static ReadOnly Property TextLineBoundsProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.textLineBoundsProperty;

TextWrapping TextWrapping TextWrapping TextWrapping

Gets or sets how the element wraps text.

public : TextWrapping TextWrapping { get; set; }
public TextWrapping TextWrapping { get; set; }
Public ReadWrite Property TextWrapping As TextWrapping
var textWrapping = contentPresenter.textWrapping;
contentPresenter.textWrapping = textWrapping;
Value
TextWrapping TextWrapping TextWrapping TextWrapping

A value that indicates how the element wraps text. The default is NoWrap.

TextWrappingProperty TextWrappingProperty TextWrappingProperty TextWrappingProperty

Identifies the TextWrapping dependency property.

public : static DependencyProperty TextWrappingProperty { get; }
public static DependencyProperty TextWrappingProperty { get; }
Public Static ReadOnly Property TextWrappingProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.textWrappingProperty;
Value
DependencyProperty DependencyProperty DependencyProperty DependencyProperty

The identifier for the TextWrapping dependency property.

VerticalContentAlignment VerticalContentAlignment VerticalContentAlignment VerticalContentAlignment

Gets or sets the vertical alignment of the content.

public : VerticalAlignment VerticalContentAlignment { get; set; }
public VerticalAlignment VerticalContentAlignment { get; set; }
Public ReadWrite Property VerticalContentAlignment As VerticalAlignment
var verticalAlignment = contentPresenter.verticalContentAlignment;
contentPresenter.verticalContentAlignment = verticalAlignment;
<ContentPresenter  VerticalContentAlignment="verticalAlignmentValue"/>

VerticalContentAlignmentProperty VerticalContentAlignmentProperty VerticalContentAlignmentProperty VerticalContentAlignmentProperty

Identifies the VerticalContentAlignment dependency property.

public : static DependencyProperty VerticalContentAlignmentProperty { get; }
public static DependencyProperty VerticalContentAlignmentProperty { get; }
Public Static ReadOnly Property VerticalContentAlignmentProperty As DependencyProperty
var dependencyProperty = Windows.UI.Xaml.Controls.ContentPresenter.verticalContentAlignmentProperty;
See Also

AccessKey AccessKey AccessKey AccessKey

Inherited from UIElement

AccessKeyProperty AccessKeyProperty AccessKeyProperty AccessKeyProperty

Inherited from UIElement

AccessKeyScopeOwner AccessKeyScopeOwner AccessKeyScopeOwner AccessKeyScopeOwner

Inherited from UIElement

AccessKeyScopeOwnerProperty AccessKeyScopeOwnerProperty AccessKeyScopeOwnerProperty AccessKeyScopeOwnerProperty

Inherited from UIElement

ActualHeight ActualHeight ActualHeight ActualHeight

Inherited from FrameworkElement

ActualHeightProperty ActualHeightProperty ActualHeightProperty ActualHeightProperty

Inherited from FrameworkElement

ActualTheme ActualTheme ActualTheme ActualTheme

Inherited from FrameworkElement

ActualThemeProperty ActualThemeProperty ActualThemeProperty ActualThemeProperty

Inherited from FrameworkElement

ActualWidth ActualWidth ActualWidth ActualWidth

Inherited from FrameworkElement

ActualWidthProperty ActualWidthProperty ActualWidthProperty ActualWidthProperty

Inherited from FrameworkElement

AllowDrop AllowDrop AllowDrop AllowDrop

Inherited from UIElement

AllowDropProperty AllowDropProperty AllowDropProperty AllowDropProperty

Inherited from UIElement

AllowFocusOnInteraction AllowFocusOnInteraction AllowFocusOnInteraction AllowFocusOnInteraction

Inherited from FrameworkElement

AllowFocusOnInteractionProperty AllowFocusOnInteractionProperty AllowFocusOnInteractionProperty AllowFocusOnInteractionProperty

Inherited from FrameworkElement

AllowFocusWhenDisabled AllowFocusWhenDisabled AllowFocusWhenDisabled AllowFocusWhenDisabled

Inherited from FrameworkElement

AllowFocusWhenDisabledProperty AllowFocusWhenDisabledProperty AllowFocusWhenDisabledProperty AllowFocusWhenDisabledProperty

Inherited from FrameworkElement

BaseUri BaseUri BaseUri BaseUri

Inherited from FrameworkElement

CacheMode CacheMode CacheMode CacheMode

Inherited from UIElement

CacheModeProperty CacheModeProperty CacheModeProperty CacheModeProperty

Inherited from UIElement

CanDrag CanDrag CanDrag CanDrag

Inherited from UIElement

CanDragProperty CanDragProperty CanDragProperty CanDragProperty

Inherited from UIElement

CharacterReceivedEvent CharacterReceivedEvent CharacterReceivedEvent CharacterReceivedEvent

Inherited from UIElement

Clip Clip Clip Clip

Inherited from UIElement

ClipProperty ClipProperty ClipProperty ClipProperty

Inherited from UIElement

CompositeMode CompositeMode CompositeMode CompositeMode

Inherited from UIElement

CompositeModeProperty CompositeModeProperty CompositeModeProperty CompositeModeProperty

Inherited from UIElement

ContextFlyout ContextFlyout ContextFlyout ContextFlyout

Inherited from UIElement

ContextFlyoutProperty ContextFlyoutProperty ContextFlyoutProperty ContextFlyoutProperty

Inherited from UIElement

DataContext DataContext DataContext DataContext

Inherited from FrameworkElement

DataContextProperty DataContextProperty DataContextProperty DataContextProperty

Inherited from FrameworkElement

DesiredSize DesiredSize DesiredSize DesiredSize

Inherited from UIElement

Dispatcher Dispatcher Dispatcher Dispatcher

Inherited from DependencyObject

DoubleTappedEvent DoubleTappedEvent DoubleTappedEvent DoubleTappedEvent

Inherited from UIElement

DragEnterEvent DragEnterEvent DragEnterEvent DragEnterEvent

Inherited from UIElement

DragLeaveEvent DragLeaveEvent DragLeaveEvent DragLeaveEvent

Inherited from UIElement

DragOverEvent DragOverEvent DragOverEvent DragOverEvent

Inherited from UIElement

DropEvent DropEvent DropEvent DropEvent

Inherited from UIElement

ExitDisplayModeOnAccessKeyInvoked ExitDisplayModeOnAccessKeyInvoked ExitDisplayModeOnAccessKeyInvoked ExitDisplayModeOnAccessKeyInvoked

Inherited from UIElement

ExitDisplayModeOnAccessKeyInvokedProperty ExitDisplayModeOnAccessKeyInvokedProperty ExitDisplayModeOnAccessKeyInvokedProperty ExitDisplayModeOnAccessKeyInvokedProperty

Inherited from UIElement

FlowDirection FlowDirection FlowDirection FlowDirection

Inherited from FrameworkElement

FlowDirectionProperty FlowDirectionProperty FlowDirectionProperty FlowDirectionProperty

Inherited from FrameworkElement

FocusVisualMargin FocusVisualMargin FocusVisualMargin FocusVisualMargin

Inherited from FrameworkElement

FocusVisualMarginProperty FocusVisualMarginProperty FocusVisualMarginProperty FocusVisualMarginProperty

Inherited from FrameworkElement

FocusVisualPrimaryBrush FocusVisualPrimaryBrush FocusVisualPrimaryBrush FocusVisualPrimaryBrush

Inherited from FrameworkElement

FocusVisualPrimaryBrushProperty FocusVisualPrimaryBrushProperty FocusVisualPrimaryBrushProperty FocusVisualPrimaryBrushProperty

Inherited from FrameworkElement

FocusVisualPrimaryThickness FocusVisualPrimaryThickness FocusVisualPrimaryThickness FocusVisualPrimaryThickness

Inherited from FrameworkElement

FocusVisualPrimaryThicknessProperty FocusVisualPrimaryThicknessProperty FocusVisualPrimaryThicknessProperty FocusVisualPrimaryThicknessProperty

Inherited from FrameworkElement

FocusVisualSecondaryBrush FocusVisualSecondaryBrush FocusVisualSecondaryBrush FocusVisualSecondaryBrush

Inherited from FrameworkElement

FocusVisualSecondaryBrushProperty FocusVisualSecondaryBrushProperty FocusVisualSecondaryBrushProperty FocusVisualSecondaryBrushProperty

Inherited from FrameworkElement

FocusVisualSecondaryThickness FocusVisualSecondaryThickness FocusVisualSecondaryThickness FocusVisualSecondaryThickness

Inherited from FrameworkElement

FocusVisualSecondaryThicknessProperty FocusVisualSecondaryThicknessProperty FocusVisualSecondaryThicknessProperty FocusVisualSecondaryThicknessProperty

Inherited from FrameworkElement

GettingFocusEvent GettingFocusEvent GettingFocusEvent GettingFocusEvent

Inherited from UIElement

Height Height Height Height

Inherited from FrameworkElement

HeightProperty HeightProperty HeightProperty HeightProperty

Inherited from FrameworkElement

HighContrastAdjustment HighContrastAdjustment HighContrastAdjustment HighContrastAdjustment

Inherited from UIElement

HighContrastAdjustmentProperty HighContrastAdjustmentProperty HighContrastAdjustmentProperty HighContrastAdjustmentProperty

Inherited from UIElement

HoldingEvent HoldingEvent HoldingEvent HoldingEvent

Inherited from UIElement

HorizontalAlignment HorizontalAlignment HorizontalAlignment HorizontalAlignment

Inherited from FrameworkElement

HorizontalAlignmentProperty HorizontalAlignmentProperty HorizontalAlignmentProperty HorizontalAlignmentProperty

Inherited from FrameworkElement

IsAccessKeyScope IsAccessKeyScope IsAccessKeyScope IsAccessKeyScope

Inherited from UIElement

IsAccessKeyScopeProperty IsAccessKeyScopeProperty IsAccessKeyScopeProperty IsAccessKeyScopeProperty

Inherited from UIElement

IsDoubleTapEnabled IsDoubleTapEnabled IsDoubleTapEnabled IsDoubleTapEnabled

Inherited from UIElement

IsDoubleTapEnabledProperty IsDoubleTapEnabledProperty IsDoubleTapEnabledProperty IsDoubleTapEnabledProperty

Inherited from UIElement

IsHitTestVisible IsHitTestVisible IsHitTestVisible IsHitTestVisible

Inherited from UIElement

IsHitTestVisibleProperty IsHitTestVisibleProperty IsHitTestVisibleProperty IsHitTestVisibleProperty

Inherited from UIElement

IsHoldingEnabled IsHoldingEnabled IsHoldingEnabled IsHoldingEnabled

Inherited from UIElement

IsHoldingEnabledProperty IsHoldingEnabledProperty IsHoldingEnabledProperty IsHoldingEnabledProperty

Inherited from UIElement

IsRightTapEnabled IsRightTapEnabled IsRightTapEnabled IsRightTapEnabled

Inherited from UIElement

IsRightTapEnabledProperty IsRightTapEnabledProperty IsRightTapEnabledProperty IsRightTapEnabledProperty

Inherited from UIElement

IsTapEnabled IsTapEnabled IsTapEnabled IsTapEnabled

Inherited from UIElement

IsTapEnabledProperty IsTapEnabledProperty IsTapEnabledProperty IsTapEnabledProperty

Inherited from UIElement

KeyboardAccelerators KeyboardAccelerators KeyboardAccelerators KeyboardAccelerators

Inherited from UIElement

KeyDownEvent KeyDownEvent KeyDownEvent KeyDownEvent

Inherited from UIElement

KeyTipHorizontalOffset KeyTipHorizontalOffset KeyTipHorizontalOffset KeyTipHorizontalOffset

Inherited from UIElement

KeyTipHorizontalOffsetProperty KeyTipHorizontalOffsetProperty KeyTipHorizontalOffsetProperty KeyTipHorizontalOffsetProperty

Inherited from UIElement

KeyTipPlacementMode KeyTipPlacementMode KeyTipPlacementMode KeyTipPlacementMode

Inherited from UIElement

KeyTipPlacementModeProperty KeyTipPlacementModeProperty KeyTipPlacementModeProperty KeyTipPlacementModeProperty

Inherited from UIElement

KeyTipVerticalOffset KeyTipVerticalOffset KeyTipVerticalOffset KeyTipVerticalOffset

Inherited from UIElement

KeyTipVerticalOffsetProperty KeyTipVerticalOffsetProperty KeyTipVerticalOffsetProperty KeyTipVerticalOffsetProperty

Inherited from UIElement

KeyUpEvent KeyUpEvent KeyUpEvent KeyUpEvent

Inherited from UIElement

Language Language Language Language

Inherited from FrameworkElement

LanguageProperty LanguageProperty LanguageProperty LanguageProperty

Inherited from FrameworkElement

Lights Lights Lights Lights

Inherited from UIElement

LightsProperty LightsProperty LightsProperty LightsProperty

Inherited from UIElement

LosingFocusEvent LosingFocusEvent LosingFocusEvent LosingFocusEvent

Inherited from UIElement

ManipulationCompletedEvent ManipulationCompletedEvent ManipulationCompletedEvent ManipulationCompletedEvent

Inherited from UIElement

ManipulationDeltaEvent ManipulationDeltaEvent ManipulationDeltaEvent ManipulationDeltaEvent

Inherited from UIElement

ManipulationInertiaStartingEvent ManipulationInertiaStartingEvent ManipulationInertiaStartingEvent ManipulationInertiaStartingEvent

Inherited from UIElement

ManipulationMode ManipulationMode ManipulationMode ManipulationMode

Inherited from UIElement

ManipulationModeProperty ManipulationModeProperty ManipulationModeProperty ManipulationModeProperty

Inherited from UIElement

ManipulationStartedEvent ManipulationStartedEvent ManipulationStartedEvent ManipulationStartedEvent

Inherited from UIElement

ManipulationStartingEvent ManipulationStartingEvent ManipulationStartingEvent ManipulationStartingEvent

Inherited from UIElement

Margin Margin Margin Margin

Inherited from FrameworkElement

MarginProperty MarginProperty MarginProperty MarginProperty

Inherited from FrameworkElement

MaxHeight MaxHeight MaxHeight MaxHeight

Inherited from FrameworkElement

MaxHeightProperty MaxHeightProperty MaxHeightProperty MaxHeightProperty

Inherited from FrameworkElement

MaxWidth MaxWidth MaxWidth MaxWidth

Inherited from FrameworkElement

MaxWidthProperty MaxWidthProperty MaxWidthProperty MaxWidthProperty

Inherited from FrameworkElement

MinHeight MinHeight MinHeight MinHeight

Inherited from FrameworkElement

MinHeightProperty MinHeightProperty MinHeightProperty MinHeightProperty

Inherited from FrameworkElement

MinWidth MinWidth MinWidth MinWidth

Inherited from FrameworkElement

MinWidthProperty MinWidthProperty MinWidthProperty MinWidthProperty

Inherited from FrameworkElement

Name Name Name Name

Inherited from FrameworkElement

NameProperty NameProperty NameProperty NameProperty

Inherited from FrameworkElement

NoFocusCandidateFoundEvent NoFocusCandidateFoundEvent NoFocusCandidateFoundEvent NoFocusCandidateFoundEvent

Inherited from UIElement

Opacity Opacity Opacity Opacity

Inherited from UIElement

OpacityProperty OpacityProperty OpacityProperty OpacityProperty

Inherited from UIElement

Parent Parent Parent Parent

Inherited from FrameworkElement

PointerCanceledEvent PointerCanceledEvent PointerCanceledEvent PointerCanceledEvent

Inherited from UIElement

PointerCaptureLostEvent PointerCaptureLostEvent PointerCaptureLostEvent PointerCaptureLostEvent

Inherited from UIElement

PointerCaptures PointerCaptures PointerCaptures PointerCaptures

Inherited from UIElement

PointerCapturesProperty PointerCapturesProperty PointerCapturesProperty PointerCapturesProperty

Inherited from UIElement

PointerEnteredEvent PointerEnteredEvent PointerEnteredEvent PointerEnteredEvent

Inherited from UIElement

PointerExitedEvent PointerExitedEvent PointerExitedEvent PointerExitedEvent

Inherited from UIElement

PointerMovedEvent PointerMovedEvent PointerMovedEvent PointerMovedEvent

Inherited from UIElement

PointerPressedEvent PointerPressedEvent PointerPressedEvent PointerPressedEvent

Inherited from UIElement

PointerReleasedEvent PointerReleasedEvent PointerReleasedEvent PointerReleasedEvent

Inherited from UIElement

PointerWheelChangedEvent PointerWheelChangedEvent PointerWheelChangedEvent PointerWheelChangedEvent

Inherited from UIElement

PreviewKeyDownEvent PreviewKeyDownEvent PreviewKeyDownEvent PreviewKeyDownEvent

Inherited from UIElement

PreviewKeyUpEvent PreviewKeyUpEvent PreviewKeyUpEvent PreviewKeyUpEvent

Inherited from UIElement

Projection Projection Projection Projection

Inherited from UIElement

ProjectionProperty ProjectionProperty ProjectionProperty ProjectionProperty

Inherited from UIElement

RenderSize RenderSize RenderSize RenderSize

Inherited from UIElement

RenderTransform RenderTransform RenderTransform RenderTransform

Inherited from UIElement

RenderTransformOrigin RenderTransformOrigin RenderTransformOrigin RenderTransformOrigin

Inherited from UIElement

RenderTransformOriginProperty RenderTransformOriginProperty RenderTransformOriginProperty RenderTransformOriginProperty

Inherited from UIElement

RenderTransformProperty RenderTransformProperty RenderTransformProperty RenderTransformProperty

Inherited from UIElement

RequestedTheme RequestedTheme RequestedTheme RequestedTheme

Inherited from FrameworkElement

RequestedThemeProperty RequestedThemeProperty RequestedThemeProperty RequestedThemeProperty

Inherited from FrameworkElement

Resources Resources Resources Resources

Inherited from FrameworkElement

RightTappedEvent RightTappedEvent RightTappedEvent RightTappedEvent

Inherited from UIElement

Style Style Style Style

Inherited from FrameworkElement

StyleProperty StyleProperty StyleProperty StyleProperty

Inherited from FrameworkElement

TabFocusNavigation TabFocusNavigation TabFocusNavigation TabFocusNavigation

Inherited from UIElement

TabFocusNavigationProperty TabFocusNavigationProperty TabFocusNavigationProperty TabFocusNavigationProperty

Inherited from UIElement

Tag Tag Tag Tag

Inherited from FrameworkElement

TagProperty TagProperty TagProperty TagProperty

Inherited from FrameworkElement

TappedEvent TappedEvent TappedEvent TappedEvent

Inherited from UIElement

Transform3D Transform3D Transform3D Transform3D

Inherited from UIElement

Transform3DProperty Transform3DProperty Transform3DProperty Transform3DProperty

Inherited from UIElement

Transitions Transitions Transitions Transitions

Inherited from UIElement

TransitionsProperty TransitionsProperty TransitionsProperty TransitionsProperty

Inherited from UIElement

Triggers Triggers Triggers Triggers

Inherited from FrameworkElement

UseLayoutRounding UseLayoutRounding UseLayoutRounding UseLayoutRounding

Inherited from UIElement

UseLayoutRoundingProperty UseLayoutRoundingProperty UseLayoutRoundingProperty UseLayoutRoundingProperty

Inherited from UIElement

VerticalAlignment VerticalAlignment VerticalAlignment VerticalAlignment

Inherited from FrameworkElement

VerticalAlignmentProperty VerticalAlignmentProperty VerticalAlignmentProperty VerticalAlignmentProperty

Inherited from FrameworkElement

Visibility Visibility Visibility Visibility

Inherited from UIElement

VisibilityProperty VisibilityProperty VisibilityProperty VisibilityProperty

Inherited from UIElement

Width Width Width Width

Inherited from FrameworkElement

WidthProperty WidthProperty WidthProperty WidthProperty

Inherited from FrameworkElement

XYFocusDownNavigationStrategy XYFocusDownNavigationStrategy XYFocusDownNavigationStrategy XYFocusDownNavigationStrategy

Inherited from UIElement

XYFocusDownNavigationStrategyProperty XYFocusDownNavigationStrategyProperty XYFocusDownNavigationStrategyProperty XYFocusDownNavigationStrategyProperty

Inherited from UIElement

XYFocusKeyboardNavigation XYFocusKeyboardNavigation XYFocusKeyboardNavigation XYFocusKeyboardNavigation

Inherited from UIElement

XYFocusKeyboardNavigationProperty XYFocusKeyboardNavigationProperty XYFocusKeyboardNavigationProperty XYFocusKeyboardNavigationProperty

Inherited from UIElement

XYFocusLeftNavigationStrategy XYFocusLeftNavigationStrategy XYFocusLeftNavigationStrategy XYFocusLeftNavigationStrategy

Inherited from UIElement

XYFocusLeftNavigationStrategyProperty XYFocusLeftNavigationStrategyProperty XYFocusLeftNavigationStrategyProperty XYFocusLeftNavigationStrategyProperty

Inherited from UIElement

XYFocusRightNavigationStrategy XYFocusRightNavigationStrategy XYFocusRightNavigationStrategy XYFocusRightNavigationStrategy

Inherited from UIElement

XYFocusRightNavigationStrategyProperty XYFocusRightNavigationStrategyProperty XYFocusRightNavigationStrategyProperty XYFocusRightNavigationStrategyProperty

Inherited from UIElement

XYFocusUpNavigationStrategy XYFocusUpNavigationStrategy XYFocusUpNavigationStrategy XYFocusUpNavigationStrategy

Inherited from UIElement

XYFocusUpNavigationStrategyProperty XYFocusUpNavigationStrategyProperty XYFocusUpNavigationStrategyProperty XYFocusUpNavigationStrategyProperty

Inherited from UIElement

Methods

OnContentTemplateChanged(DataTemplate, DataTemplate) OnContentTemplateChanged(DataTemplate, DataTemplate) OnContentTemplateChanged(DataTemplate, DataTemplate) OnContentTemplateChanged(DataTemplate, DataTemplate)

Invoked when the value of the ContentTemplate property changes.

protected : virtual void OnContentTemplateChanged(DataTemplate oldContentTemplate, DataTemplate newContentTemplate)
protected virtual void OnContentTemplateChanged(DataTemplate oldContentTemplate, DataTemplate newContentTemplate)
Protected Overridable Function OnContentTemplateChanged(oldContentTemplate As DataTemplate, newContentTemplate As DataTemplate) As void
contentPresenter.onContentTemplateChanged(oldContentTemplate, newContentTemplate);
Parameters
oldContentTemplate
DataTemplate DataTemplate DataTemplate DataTemplate

The old value of the ContentTemplate property.

newContentTemplate
DataTemplate DataTemplate DataTemplate DataTemplate

The new value of the ContentTemplate property.

OnContentTemplateSelectorChanged(DataTemplateSelector, DataTemplateSelector) OnContentTemplateSelectorChanged(DataTemplateSelector, DataTemplateSelector) OnContentTemplateSelectorChanged(DataTemplateSelector, DataTemplateSelector) OnContentTemplateSelectorChanged(DataTemplateSelector, DataTemplateSelector)

Invoked when the value of the ContentTemplateSelector property changes.

protected : virtual void OnContentTemplateSelectorChanged(DataTemplateSelector oldContentTemplateSelector, DataTemplateSelector newContentTemplateSelector)
protected virtual void OnContentTemplateSelectorChanged(DataTemplateSelector oldContentTemplateSelector, DataTemplateSelector newContentTemplateSelector)
Protected Overridable Function OnContentTemplateSelectorChanged(oldContentTemplateSelector As DataTemplateSelector, newContentTemplateSelector As DataTemplateSelector) As void
contentPresenter.onContentTemplateSelectorChanged(oldContentTemplateSelector, newContentTemplateSelector);
Parameters

Remarks

Classes that derive from ContentPresenter can override this method in order to perform any custom logic that should apply, in cases where the selector logic that automatically chooses the DataTemplate based on context changes.

AddHandler(RoutedEvent,Object,Boolean) AddHandler(RoutedEvent,Object,Boolean) AddHandler(RoutedEvent,Object,Boolean) AddHandler(RoutedEvent,Object,Boolean)

Inherited from UIElement

Arrange(Rect) Arrange(Rect) Arrange(Rect) Arrange(Rect)

Inherited from UIElement

ArrangeOverride(Size) ArrangeOverride(Size) ArrangeOverride(Size) ArrangeOverride(Size)

Inherited from FrameworkElement

CancelDirectManipulations CancelDirectManipulations CancelDirectManipulations CancelDirectManipulations

Inherited from UIElement

CapturePointer(Pointer) CapturePointer(Pointer) CapturePointer(Pointer) CapturePointer(Pointer)

Inherited from UIElement

ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty) ClearValue(DependencyProperty)

Inherited from DependencyObject

DeferTree(DependencyObject) DeferTree(DependencyObject) DeferTree(DependencyObject) DeferTree(DependencyObject)

Inherited from FrameworkElement

FindName(String) FindName(String) FindName(String) FindName(String)

Inherited from FrameworkElement

FindSubElementsForTouchTargeting(Point,Rect) FindSubElementsForTouchTargeting(Point,Rect) FindSubElementsForTouchTargeting(Point,Rect) FindSubElementsForTouchTargeting(Point,Rect)

Inherited from UIElement

GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty) GetAnimationBaseValue(DependencyProperty)

Inherited from DependencyObject

GetBindingExpression(DependencyProperty) GetBindingExpression(DependencyProperty) GetBindingExpression(DependencyProperty) GetBindingExpression(DependencyProperty)

Inherited from FrameworkElement

GetChildrenInTabFocusOrder GetChildrenInTabFocusOrder GetChildrenInTabFocusOrder GetChildrenInTabFocusOrder

Inherited from UIElement

GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty) GetValue(DependencyProperty)

Inherited from DependencyObject

GoToElementStateCore(String,Boolean) GoToElementStateCore(String,Boolean) GoToElementStateCore(String,Boolean) GoToElementStateCore(String,Boolean)

Inherited from FrameworkElement

InvalidateArrange InvalidateArrange InvalidateArrange InvalidateArrange

Inherited from UIElement

InvalidateMeasure InvalidateMeasure InvalidateMeasure InvalidateMeasure

Inherited from UIElement

Measure(Size) Measure(Size) Measure(Size) Measure(Size)

Inherited from UIElement

MeasureOverride(Size) MeasureOverride(Size) MeasureOverride(Size) MeasureOverride(Size)

Inherited from FrameworkElement

OnApplyTemplate OnApplyTemplate OnApplyTemplate OnApplyTemplate

Inherited from FrameworkElement

OnCreateAutomationPeer OnCreateAutomationPeer OnCreateAutomationPeer OnCreateAutomationPeer

Inherited from UIElement

OnDisconnectVisualChildren OnDisconnectVisualChildren OnDisconnectVisualChildren OnDisconnectVisualChildren

Inherited from UIElement

OnProcessKeyboardAccelerators(ProcessKeyboardAcceleratorEventArgs) OnProcessKeyboardAccelerators(ProcessKeyboardAcceleratorEventArgs) OnProcessKeyboardAccelerators(ProcessKeyboardAcceleratorEventArgs) OnProcessKeyboardAccelerators(ProcessKeyboardAcceleratorEventArgs)

Inherited from UIElement

ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty) ReadLocalValue(DependencyProperty)

Inherited from DependencyObject

RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback) RegisterPropertyChangedCallback(DependencyProperty,DependencyPropertyChangedCallback)

Inherited from DependencyObject

ReleasePointerCapture(Pointer) ReleasePointerCapture(Pointer) ReleasePointerCapture(Pointer) ReleasePointerCapture(Pointer)

Inherited from UIElement

ReleasePointerCaptures ReleasePointerCaptures ReleasePointerCaptures ReleasePointerCaptures

Inherited from UIElement

RemoveHandler(RoutedEvent,Object) RemoveHandler(RoutedEvent,Object) RemoveHandler(RoutedEvent,Object) RemoveHandler(RoutedEvent,Object)

Inherited from UIElement

SetBinding(DependencyProperty,BindingBase) SetBinding(DependencyProperty,BindingBase) SetBinding(DependencyProperty,BindingBase) SetBinding(DependencyProperty,BindingBase)

Inherited from FrameworkElement

SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object) SetValue(DependencyProperty,Object)

Inherited from DependencyObject

StartBringIntoView StartBringIntoView StartBringIntoView StartBringIntoView

Inherited from UIElement

StartBringIntoView(BringIntoViewOptions) StartBringIntoView(BringIntoViewOptions) StartBringIntoView(BringIntoViewOptions) StartBringIntoView(BringIntoViewOptions)

Inherited from UIElement

StartDragAsync(PointerPoint) StartDragAsync(PointerPoint) StartDragAsync(PointerPoint) StartDragAsync(PointerPoint)

Inherited from UIElement

TransformToVisual(UIElement) TransformToVisual(UIElement) TransformToVisual(UIElement) TransformToVisual(UIElement)

Inherited from UIElement

TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs) TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs) TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs) TryInvokeKeyboardAccelerator(ProcessKeyboardAcceleratorEventArgs)

Inherited from UIElement

TryStartDirectManipulation(Pointer) TryStartDirectManipulation(Pointer) TryStartDirectManipulation(Pointer) TryStartDirectManipulation(Pointer)

Inherited from UIElement

UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64) UnregisterPropertyChangedCallback(DependencyProperty,Int64)

Inherited from DependencyObject

UpdateLayout UpdateLayout UpdateLayout UpdateLayout

Inherited from UIElement

Events

AccessKeyDisplayDismissed AccessKeyDisplayDismissed AccessKeyDisplayDismissed AccessKeyDisplayDismissed

Inherited from UIElement

AccessKeyDisplayRequested AccessKeyDisplayRequested AccessKeyDisplayRequested AccessKeyDisplayRequested

Inherited from UIElement

AccessKeyInvoked AccessKeyInvoked AccessKeyInvoked AccessKeyInvoked

Inherited from UIElement

ActualThemeChanged ActualThemeChanged ActualThemeChanged ActualThemeChanged

Inherited from FrameworkElement

CharacterReceived CharacterReceived CharacterReceived CharacterReceived

Inherited from UIElement

ContextCanceled ContextCanceled ContextCanceled ContextCanceled

Inherited from UIElement

ContextRequested ContextRequested ContextRequested ContextRequested

Inherited from UIElement

DataContextChanged DataContextChanged DataContextChanged DataContextChanged

Inherited from FrameworkElement

DoubleTapped DoubleTapped DoubleTapped DoubleTapped

Inherited from UIElement

DragEnter DragEnter DragEnter DragEnter

Inherited from UIElement

DragLeave DragLeave DragLeave DragLeave

Inherited from UIElement

DragOver DragOver DragOver DragOver

Inherited from UIElement

DragStarting DragStarting DragStarting DragStarting

Inherited from UIElement

Drop Drop Drop Drop

Inherited from UIElement

DropCompleted DropCompleted DropCompleted DropCompleted

Inherited from UIElement

GettingFocus GettingFocus GettingFocus GettingFocus

Inherited from UIElement

GotFocus GotFocus GotFocus GotFocus

Inherited from UIElement

Holding Holding Holding Holding

Inherited from UIElement

KeyDown KeyDown KeyDown KeyDown

Inherited from UIElement

KeyUp KeyUp KeyUp KeyUp

Inherited from UIElement

LayoutUpdated LayoutUpdated LayoutUpdated LayoutUpdated

Inherited from FrameworkElement

Loaded Loaded Loaded Loaded

Inherited from FrameworkElement

Loading Loading Loading Loading

Inherited from FrameworkElement

LosingFocus LosingFocus LosingFocus LosingFocus

Inherited from UIElement

LostFocus LostFocus LostFocus LostFocus

Inherited from UIElement

ManipulationCompleted ManipulationCompleted ManipulationCompleted ManipulationCompleted

Inherited from UIElement

ManipulationDelta ManipulationDelta ManipulationDelta ManipulationDelta

Inherited from UIElement

ManipulationInertiaStarting ManipulationInertiaStarting ManipulationInertiaStarting ManipulationInertiaStarting

Inherited from UIElement

ManipulationStarted ManipulationStarted ManipulationStarted ManipulationStarted

Inherited from UIElement

ManipulationStarting ManipulationStarting ManipulationStarting ManipulationStarting

Inherited from UIElement

NoFocusCandidateFound NoFocusCandidateFound NoFocusCandidateFound NoFocusCandidateFound

Inherited from UIElement

PointerCanceled PointerCanceled PointerCanceled PointerCanceled

Inherited from UIElement

PointerCaptureLost PointerCaptureLost PointerCaptureLost PointerCaptureLost

Inherited from UIElement

PointerEntered PointerEntered PointerEntered PointerEntered

Inherited from UIElement

PointerExited PointerExited PointerExited PointerExited

Inherited from UIElement

PointerMoved PointerMoved PointerMoved PointerMoved

Inherited from UIElement

PointerPressed PointerPressed PointerPressed PointerPressed

Inherited from UIElement

PointerReleased PointerReleased PointerReleased PointerReleased

Inherited from UIElement

PointerWheelChanged PointerWheelChanged PointerWheelChanged PointerWheelChanged

Inherited from UIElement

PreviewKeyDown PreviewKeyDown PreviewKeyDown PreviewKeyDown

Inherited from UIElement

PreviewKeyUp PreviewKeyUp PreviewKeyUp PreviewKeyUp

Inherited from UIElement

ProcessKeyboardAccelerators ProcessKeyboardAccelerators ProcessKeyboardAccelerators ProcessKeyboardAccelerators

Inherited from UIElement

RightTapped RightTapped RightTapped RightTapped

Inherited from UIElement

SizeChanged SizeChanged SizeChanged SizeChanged

Inherited from FrameworkElement

Tapped Tapped Tapped Tapped

Inherited from UIElement

Unloaded Unloaded Unloaded Unloaded

Inherited from FrameworkElement

See Also