Remarks
StylishLabel is inherited from ISContentControl, which means that it can contain a single object of any types, such as a string, an image, or a panel. For more information about this content model, see Content Model Overview.
StylishLabel supports ImageContent model concept which provides capability to efficiently specify the Image and Content through properties. To learn more about ImageContent model, see Content Model Overview.
Definition
public class StylishLabel : ISContentControl
Summary
The following table summarizes the members exposed in this class.
Public Constructors
StylishLabel Constructor() | Initializes a new instance of the StylishLabel class. |
Public Properties
ComputedImageMargin | Internal use. |
ContentEffect | Gets or sets the pixel shader effect to use for rendering the text element. |
ContentType | Gets or sets the content type of Stylish Label. |
DisplayText | Gets or sets the display text. |
DisplayTextPath | Gets or sets the display text path. |
HorizontalImageAlignment | Gets or sets the horizontal alignment of the image element. |
ImageHeight | Gets or sets the height of the image. |
ImageMargin | Gets or sets the margin of the image. |
ImageSource | Gets or sets the source for the image. |
ImageStretch | Gets or sets a value that describes how an Image should be stretched to fill the destination rectangle. |
ImageWidth | Gets or sets the width of the image. |
RootElement | Gets the root element. |
TextImageRelation | Gets or sets the position of the text and image relative to each other on a control. |
VerticalImageAlignment | Gets or sets the vertical alignment of the image element. |
Protected Properties
Product | Product Info. |
Fields
ComputedImageMarginProperty | Identifies the ComputedImageMargin dependency property. |
ContentEffectProperty | Identifies the ContentEffect dependency property. |
ContentTypeProperty | Identifies the ContentType dependency property. |
DisplayTextPathProperty | Identifies the DisplayText dependency property. |
DisplayTextProperty | Identifies the DisplayText dependency property. |
HorizontalImageAlignmentProperty | Identifies the HorizontalImageAlignment dependency property. |
ImageHeightProperty | Identifies the ImageHeight dependency property. |
ImageMarginProperty | Identifies the ImageMargin dependency property. |
ImageSourceProperty | Identifies the ImageSource dependency property. |
ImageStretchProperty | Identifies the ImageStretch dependency property. |
ImageWidthProperty | Identifies the ImageWidth dependency property. |
TextImageRelationProperty | Identifies the TextImageRelation dependency property. |
VerticalImageAlignmentProperty | Identifies the VerticalImageAlignment dependency property. |
Public Methods
InitializeTemplates() | Initializes control templates. |
OnApplyTemplate() | Builds the visual tree for the StylishLabel when a new template is applied. |
RefreshContentLayout() | Refresh the content display. |
Protected Methods
OnContentChanged(object, object) | Called when the value of the Content property changes. |
Public Constructors
public StylishLabel()
Initializes a new instance of the StylishLabel class.
Public Properties
public Thickness ComputedImageMargin { get; set; }
Internal use.
public Effect ContentEffect { get; set; }
Gets or sets the pixel shader effect to use for rendering the text element.
public ContentType ContentType { get; set; }
Gets or sets the content type of Stylish Label.
public string DisplayText { get; set; }
Gets or sets the display text.
public string DisplayTextPath { get; set; }
Gets or sets the display text path.
public HorizontalAlignment HorizontalImageAlignment { get; set; }
Gets or sets the horizontal alignment of the image element.
public double ImageHeight { get; set; }
Gets or sets the height of the image.
public Thickness ImageMargin { get; set; }
Gets or sets the margin of the image.
public ImageSource ImageSource { get; set; }
Gets or sets the source for the image.
public Stretch ImageStretch { get; set; }
Gets or sets a value that describes how an Image should be stretched to fill the destination rectangle.
public double ImageWidth { get; set; }
Gets or sets the width of the image.
public Grid RootElement { get; }
Gets the root element.
public TextImageRelation TextImageRelation { get; set; }
Gets or sets the position of the text and image relative to each other on a control.
public VerticalAlignment VerticalImageAlignment { get; set; }
Gets or sets the vertical alignment of the image element.
Protected Properties
protected ProductInfo Product { get; }
Product Info.
Fields
public static readonly DependencyProperty ComputedImageMarginProperty
Identifies the ComputedImageMargin dependency property.
public static readonly DependencyProperty ContentEffectProperty
Identifies the ContentEffect dependency property.
public static readonly DependencyProperty ContentTypeProperty
Identifies the ContentType dependency property.
public static readonly DependencyProperty DisplayTextPathProperty
Identifies the DisplayText dependency property.
public static readonly DependencyProperty DisplayTextProperty
Identifies the DisplayText dependency property.
public static readonly DependencyProperty HorizontalImageAlignmentProperty
Identifies the HorizontalImageAlignment dependency property.
public static readonly DependencyProperty ImageHeightProperty
Identifies the ImageHeight dependency property.
public static readonly DependencyProperty ImageMarginProperty
Identifies the ImageMargin dependency property.
public static readonly DependencyProperty ImageSourceProperty
Identifies the ImageSource dependency property.
public static readonly DependencyProperty ImageStretchProperty
Identifies the ImageStretch 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 VerticalImageAlignmentProperty
Identifies the VerticalImageAlignment dependency property.
Public Methods
public void InitializeTemplates()
Initializes control templates.
public void OnApplyTemplate()
Builds the visual tree for the StylishLabel when a new template is applied.
public void RefreshContentLayout()
Refresh the content display.
Protected Methods
protected void OnContentChanged(object oldContent, object newContent)
Called when the value of the Content property changes.
Parameters
oldContent | The old value of the Content property. |
newContent | The new value of the Content property. |