TextBlockExtensions
- Assembly:
Fluence.Wpf - Namespace:
Fluence.Wpf.Controls
public static class TextBlockExtensions
Provides attached properties for extending TextBlock with Fluent Design features.
Methods
GetIcon
public static object GetIcon(this DependencyObject obj)
Gets the icon for the specified element.
Parameter obj: The target dependency object.
Returns: The icon content.
GetIconPlacement
public static ElementPlacement GetIconPlacement(this DependencyObject obj)
Gets the icon placement for the specified element.
Parameter obj: The target dependency object.
Returns: The requested icon placement.
GetIsTextSelectionEnabled
public static bool GetIsTextSelectionEnabled(this DependencyObject obj)
Gets the value of the IsTextSelectionEnabledProperty attached property for the specified object.
Parameter obj: The target TextBlock.
Returns: true if selection is enabled; otherwise false.
GetPlaceholderText
public static string GetPlaceholderText(this DependencyObject obj)
Gets the placeholder text for the specified element.
Parameter obj: The target dependency object.
Returns: The placeholder text.
GetShowPlaceholder
public static bool GetShowPlaceholder(this DependencyObject obj)
Gets whether the placeholder should be shown.
Parameter obj: The target dependency object.
Returns: true when the placeholder should be shown; otherwise false.
GetTextTrimming
public static TextTrimming GetTextTrimming(this DependencyObject obj)
Gets the value of the TextTrimmingProperty attached property for the specified object.
Parameter obj: The target TextBlock.
Returns: The requested text trimming mode.
GetTypography
public static FluentTypography GetTypography(this DependencyObject obj)
Gets the typography style for the specified TextBlock.
Parameter obj: The target TextBlock.
Returns: The requested Fluent typography style.
SetIcon
public static void SetIcon(this DependencyObject obj, object value)
Sets the icon for the specified element.
Parameter obj: The target dependency object.
Parameter value: The icon content to store.
SetIconPlacement
public static void SetIconPlacement(this DependencyObject obj, ElementPlacement value)
Sets the icon placement for the specified element.
Parameter obj: The target dependency object.
Parameter value: The icon placement to apply.
SetIsTextSelectionEnabled
public static void SetIsTextSelectionEnabled(this DependencyObject obj, bool value)
Sets the value of the IsTextSelectionEnabledProperty attached property for the specified object.
Parameter obj: The target TextBlock.
Parameter value: true to enable text selection; otherwise false.
SetPlaceholderText
public static void SetPlaceholderText(this DependencyObject obj, string value)
Sets the placeholder text for the specified element.
Parameter obj: The target dependency object.
Parameter value: The placeholder text to store.
SetShowPlaceholder
public static void SetShowPlaceholder(this DependencyObject obj, bool value)
Sets whether the placeholder should be shown.
Parameter obj: The target dependency object.
Parameter value: true to show the placeholder; otherwise false.
SetTextTrimming
public static void SetTextTrimming(this DependencyObject obj, TextTrimming value)
Sets the value of the TextTrimmingProperty attached property for the specified object.
Parameter obj: The target TextBlock.
Parameter value: The text trimming mode to apply.
SetTypography
public static void SetTypography(this DependencyObject obj, FluentTypography value)
Sets the typography style for the specified TextBlock.
Parameter obj: The target TextBlock.
Parameter value: The Fluent typography style to apply.
Dependency property identifiers
Use these identifiers with WPF property APIs. The matching CLR properties appear above when the control exposes them.
IconPlacementProperty
public static readonly DependencyProperty IconPlacementProperty
Identifies the IconPlacement attached property.
IconProperty
public static readonly DependencyProperty IconProperty
Identifies the Icon attached property.
IsTextSelectionEnabledProperty
public static readonly DependencyProperty IsTextSelectionEnabledProperty
Identifies the IsTextSelectionEnabled attached property.
PlaceholderTextProperty
public static readonly DependencyProperty PlaceholderTextProperty
Identifies the PlaceholderText attached property.
ShowPlaceholderProperty
public static readonly DependencyProperty ShowPlaceholderProperty
Identifies the ShowPlaceholder attached property.
TextTrimmingProperty
public static readonly DependencyProperty TextTrimmingProperty
Identifies the TextTrimming attached property.
TypographyProperty
public static readonly DependencyProperty TypographyProperty
Identifies the Typography attached property.