Skip to end of metadata
Go to start of metadata

Remarks

FieldLabel is inherited from IsHeaderedContentControl, which means it has both Header and Content that can contain a single object of any type (such as a string, an image, or a panel). For more information about this content model see Content Model Overview.

You use FieldLabel to represent a data field that typically consists of a label and an input control. The label of a FieldLabel can be customized through the Header property, while the input control is defined in the Content property. Beside input controls, you can actually use any kind of controls as the content such as check box, radio button, combo box and so on.

With FieldLabel, common layout tasks such as aligning the header to justify symmetrically to the left or right is as easy as property sets. For example, consider that you have a login form with four data fields. You can easily specify the label's width of the FieldLabel through the HeaderWidth property such as illustrated in the following figure.

The following code shows the example similar to the above illustration.

XAML

For more information about FieldLabel, see FieldLabel Overview.

Definition

public class FieldLabel : ISHeaderedContentControl

Summary

The following table summarizes the members exposed in this class.

Public Constructors

FieldLabel Constructor()Initializes a new instance of the FieldLabel class.

Public Properties

FocusContentOnClickGets or sets a value indicating whether the first focusable control in the content should be focused when users clicked on the header element.
HeaderBackgroundGets or sets the brush to apply to the background of the header element.
HeaderBorderBrushGets or sets the brush to apply to the border of the header element.
HeaderDisplayModeSpecifies the mode of the content presentation.
HeaderFontSizeGets or sets the value that determines the font size of the header element.
HeaderForegroundRepresents the brush that describes the foreground color of the header element.
HeaderImageGets or sets the icon that appears in the header.
HeaderMarginGets or sets the margin of the header element.
HeaderPositionGets or sets the dock position for the header element.
HeaderStyleGets or sets the style to apply to the header element.
HeaderVisibilityGets or sets the header element visibility.
HeaderWidthGets or sets the width for the header element. The default is auto.
HorizontalHeaderAlignmentGets or sets the horizontal alignment for the header element.
ImageHeightSpecifies the height applied to the icon element.
ImageWidthSpecifies the width applied to the icon element.
TextImageRelationSpecifies the position of the text and image relative to each other on a control.
VerticalHeaderAlignmentGets or sets the vertical alignment for the header element.

Protected Properties

ProductProduct Info.

Fields

FocusContentOnClickPropertyIdentifies the FocusContentOnClick property.
HeaderBackgroundPropertyIdentifies the HeaderBackground dependency property.
HeaderBorderBrushPropertyIdentifies the HeaderBorderBrush dependency property.
HeaderDisplayModePropertyIdentifies the HeaderDisplayMode dependency property.
HeaderFontSizePropertyIdentifies the HeaderFontSize dependency property.
HeaderForegroundPropertyIdentifies the HeaderForeground dependency property.
HeaderImagePropertyIdentifies the HeaderImage dependency property.
HeaderMarginPropertyIdentifies the HeaderMargin dependency property.
HeaderPositionPropertyIdentifies the HeaderPosition dependency property.
HeaderStylePropertyIdentifies the HeaderStyle dependency property.
HeaderVisibilityPropertyIdentifies the HeaderVisibility dependency property.
HeaderWidthPropertyIdentifies the HeaderWidth dependency property.
HorizontalHeaderAlignmentPropertyIdentifies the HorizontalHeaderAlignment dependency property.
ImageHeightPropertyIdentifies the ImageHeight dependency property.
ImageWidthPropertyIdentifies the ImageWidth dependency property.
TextImageRelationPropertyIdentifies the TextImageRelation dependency property.
VerticalHeaderAlignmentPropertyIdentifies the VerticalHeaderAlignment dependency property.

Public Methods

AttachEventHandlers()Attach built-in event handlers to control templates. Call this method if necessary.
DetachedEventHandlers()Detach built-in event handlers from control templates. Call this method if necessary.
InitializeTemplates()Initializes control templates.

Public Constructors

public FieldLabel()

Initializes a new instance of the FieldLabel class.

Public Properties

public bool FocusContentOnClick { get; set; }

Gets or sets a value indicating whether the first focusable control in the content should be focused when users clicked on the header element.

public Brush HeaderBackground { get; set; }

Gets or sets the brush to apply to the background of the header element.

public Brush HeaderBorderBrush { get; set; }

Gets or sets the brush to apply to the border of the header element.

public ContentType HeaderDisplayMode { get; set; }

Specifies the mode of the content presentation.

public double HeaderFontSize { get; set; }

Gets or sets the value that determines the font size of the header element.

public Brush HeaderForeground { get; set; }

Represents the brush that describes the foreground color of the header element.

public ImageSource HeaderImage { get; set; }

Gets or sets the icon that appears in the header.

public Thickness HeaderMargin { get; set; }

Gets or sets the margin of the header element.

public Dock HeaderPosition { get; set; }

Gets or sets the dock position for the header element.

public Style HeaderStyle { get; set; }

Gets or sets the style to apply to the header element.

public Visibility HeaderVisibility { get; set; }

Gets or sets the header element visibility.

public double HeaderWidth { get; set; }

Gets or sets the width for the header element. The default is auto.

public HorizontalAlignment HorizontalHeaderAlignment { get; set; }

Gets or sets the horizontal alignment for the header element.

public double ImageHeight { get; set; }

Specifies the height applied to the icon element.

public double ImageWidth { get; set; }

Specifies the width applied to the icon element.

public TextImageRelation TextImageRelation { get; set; }

Specifies the position of the text and image relative to each other on a control.

public VerticalAlignment VerticalHeaderAlignment { get; set; }

Gets or sets the vertical alignment for the header element.

Protected Properties

protected ProductInfo Product { get; }

Product Info.

Fields

public static readonly DependencyProperty FocusContentOnClickProperty

Identifies the FocusContentOnClick property.

public static readonly DependencyProperty HeaderBackgroundProperty

Identifies the HeaderBackground dependency property.

public static readonly DependencyProperty HeaderBorderBrushProperty

Identifies the HeaderBorderBrush dependency property.

public static readonly DependencyProperty HeaderDisplayModeProperty

Identifies the HeaderDisplayMode dependency property.

public static readonly DependencyProperty HeaderFontSizeProperty

Identifies the HeaderFontSize dependency property.

public static readonly DependencyProperty HeaderForegroundProperty

Identifies the HeaderForeground dependency property.

public static readonly DependencyProperty HeaderImageProperty

Identifies the HeaderImage dependency property.

public static readonly DependencyProperty HeaderMarginProperty

Identifies the HeaderMargin dependency property.

public static readonly DependencyProperty HeaderPositionProperty

Identifies the HeaderPosition dependency property.

public static readonly DependencyProperty HeaderStyleProperty

Identifies the HeaderStyle dependency property.

public static readonly DependencyProperty HeaderVisibilityProperty

Identifies the HeaderVisibility dependency property.

public static readonly DependencyProperty HeaderWidthProperty

Identifies the HeaderWidth dependency property.

public static readonly DependencyProperty HorizontalHeaderAlignmentProperty

Identifies the HorizontalHeaderAlignment dependency property.

public static readonly DependencyProperty ImageHeightProperty

Identifies the ImageHeight dependency property.

public static readonly DependencyProperty ImageWidthProperty

Identifies the ImageWidth dependency property.

public static readonly DependencyProperty TextImageRelationProperty

Identifies the TextImageRelation dependency property.

public static readonly DependencyProperty VerticalHeaderAlignmentProperty

Identifies the VerticalHeaderAlignment dependency property.

Public Methods

public void AttachEventHandlers()

Attach built-in event handlers to control templates. Call this method if necessary.

public void DetachedEventHandlers()

Detach built-in event handlers from control templates. Call this method if necessary.

public void InitializeTemplates()

Initializes control templates.

  • No labels