In This Article

ExternalHeaderPresenter Class

Represents a control that renders an external header (image and label) for a bar control that can't render them itself, such as BarComboBox.

public class ExternalHeaderPresenter : Control
Inheritance:
object Visual UIElement FrameworkElement Control object

Constructors

ExternalHeaderPresenter()

Initializes an instance of the class.

public ExternalHeaderPresenter()

Properties

CanIndentContent

Indicates whether the image and label can be indented if present.

public bool CanIndentContent { get; set; }

Property Value

bool:

true if the image and label can be indented if present; otherwise, false. The default value is false.

CanShowImage

Indicates whether an image should be displayed if present.

public bool CanShowImage { get; set; }

Property Value

bool:

true if an image should be displayed if present; otherwise, false. The default value is true.

HasImage

Indicates whether the source element has an image.

public bool HasImage { get; }

Property Value

bool:

true if the source element has an image; otherwise, false.

HasLabel

Indicates whether the source element has a label.

public bool HasLabel { get; }

Property Value

bool:

true if the source element has a label; otherwise, false.

Label

The text label to display.

[Localizability(LocalizationCategory.Label)]
public string? Label { get; set; }

Property Value

string

SmallImageSource

The ImageSource for a small image, generally 16x16 size.

public ImageSource? SmallImageSource { get; set; }

Property Value

ImageSource:

The ImageSource for a small image.

SourceElement

The source element.

public FrameworkElement? SourceElement { get; set; }

Property Value

FrameworkElement

Methods

GetLayoutClip(Size?)

Returns a geometry for a clipping mask. The mask applies if the layout system attempts to arrange an element that is larger than the available display space.

protected override Geometry? GetLayoutClip(Size? layoutSlotSize)
Parameter Type Description
layoutSlotSize Size

The size of the part of the element that does visual presentation.

Returns

Geometry:

The clipping geometry.

MeasureOverride(Size)

Called to remeasure a control.

protected override Size MeasureOverride(Size constraint)
Parameter Type Description
constraint Size

The maximum size that the method can return.

Returns

Size:

The size of the control, up to the maximum specified by constraint.

OnToolTipClosing(ToolTipEventArgs)

Invoked whenever an unhandled ToolTipClosing routed event reaches this class in its route. Implement this method to add class handling for this event.

protected override void OnToolTipClosing(ToolTipEventArgs e)
Parameter Type Description
e ToolTipEventArgs

Provides data about the event.

OnToolTipOpening(ToolTipEventArgs)

Invoked whenever the ToolTipOpening routed event reaches this class in its route. Implement this method to add class handling for this event.

protected override void OnToolTipOpening(ToolTipEventArgs e)
Parameter Type Description
e ToolTipEventArgs

Provides data about the event.

Fields

CanIndentContentProperty

Defines the CanIndentContent property.

public static readonly DependencyProperty CanIndentContentProperty

CanShowImageProperty

Defines the CanShowImage property.

public static readonly DependencyProperty CanShowImageProperty

HasImageProperty

Defines the HasImage property.

public static readonly DependencyProperty HasImageProperty

HasLabelProperty

Defines the HasLabel property.

public static readonly DependencyProperty HasLabelProperty

LabelProperty

Defines the Label property.

public static readonly DependencyProperty LabelProperty

SmallImageSourceProperty

Defines the SmallImageSource property.

public static readonly DependencyProperty SmallImageSourceProperty

SourceElementProperty

Defines the SourceElement property.

public static readonly DependencyProperty SourceElementProperty

Extension Methods