TextBoxHelper Class

Summary

A helper class that provides various attached properties for the TextBox control.
Namespace
MahApps.Metro.Controls
Base Types
  • object
graph BT Type-->Base0["object"] Type["TextBoxHelper"] class Type type-node

Syntax

public class TextBoxHelper

Remarks

Password watermarking code from: http://prabu-guru.blogspot.com/2010/06/how-to-add-watermark-text-to-textbox.html

Fields

Name Constant Value Summary
AutoWatermarkProperty
This property can be used to retrieve the watermark using the DisplayAttribute of bound property.
static
ButtonCommandParameterProperty
static
ButtonCommandProperty
static
ButtonContentProperty
static
ButtonContentTemplateProperty
static
ButtonFontFamilyProperty
static
ButtonFontSizeProperty
static
ButtonsAlignmentProperty
static
ButtonTemplateProperty
static
ButtonWidthProperty
This property can be used to set the button width (PART_ClearText) of TextBox, PasswordBox, ComboBox, NumericUpDown
static
ClearTextButtonProperty
static
HasTextProperty
static
IsClearTextButtonBehaviorEnabledProperty
The clear text button behavior property. It sets a click event to the button if the value is true.
static
IsMonitoringProperty
static
IsSpellCheckContextMenuEnabledProperty
static
IsWaitingForDataProperty
static
SelectAllOnFocusProperty
static
TextButtonProperty
static
TextLengthProperty
static
UseFloatingWatermarkProperty
static
WatermarkAlignmentProperty
static
WatermarkProperty
static
WatermarkTrimmingProperty
static
WatermarkWrappingProperty
static

Methods

Name Value Summary
ButtonClicked(object, RoutedEventArgs) void
static
GetAutoWatermark(DependencyObject) bool
static
GetButtonCommand(DependencyObject) ICommand
static
GetButtonCommandParameter(DependencyObject) object
static
GetButtonContent(DependencyObject) object
static
GetButtonContentTemplate(DependencyObject) DataTemplate
ButtonContentTemplate is the template used to display the content of the ClearText button.
static
GetButtonFontFamily(DependencyObject) FontFamily
static
GetButtonFontSize(DependencyObject) double
static
GetButtonsAlignment(DependencyObject) ButtonsAlignment
Gets the buttons placement variant.
static
GetButtonTemplate(DependencyObject) ControlTemplate
static
GetButtonWidth(DependencyObject) double
static
GetClearTextButton(DependencyObject) bool
Gets the clear text button visibility / feature. Can be used to enable text deletion.
static
GetHasText(DependencyObject) bool
Gets if the attached TextBox has text.
static
GetIsClearTextButtonBehaviorEnabled(Button) bool
Gets the clear text button behavior.
static
GetIsSpellCheckContextMenuEnabled(UIElement) bool
Indicates if a TextBox or RichTextBox should use SpellCheck context menu
static
GetIsWaitingForData(DependencyObject) bool
static
GetSelectAllOnFocus(DependencyObject) bool
static
GetTextButton(DependencyObject) bool
Gets the text button visibility.
static
GetUseFloatingWatermark(DependencyObject) bool
static
GetWatermark(DependencyObject) string
static
GetWatermarkAlignment(DependencyObject) TextAlignment
Gets a value that indicates the horizontal alignment of the watermark.
static
GetWatermarkTrimming(DependencyObject) TextTrimming
Gets the text trimming behavior to employ when watermark overflows the content area.
static
GetWatermarkWrapping(DependencyObject) TextWrapping
Gets how the watermark should wrap text.
static
SetAutoWatermark(DependencyObject, bool) void
Indicates if the watermark is automatically retrieved by using the DisplayAttribute of the bound property.
static
SetButtonCommand(DependencyObject, ICommand) void
static
SetButtonCommandParameter(DependencyObject, object) void
static
SetButtonContent(DependencyObject, object) void
static
SetButtonContentTemplate(DependencyObject, DataTemplate) void
static
SetButtonFontFamily(DependencyObject, FontFamily) void
static
SetButtonFontSize(DependencyObject, double) void
static
SetButtonsAlignment(DependencyObject, ButtonsAlignment) void
Sets the buttons placement variant.
static
SetButtonTemplate(DependencyObject, ControlTemplate) void
static
SetButtonWidth(DependencyObject, double) void
static
SetClearTextButton(DependencyObject, bool) void
Sets the clear text button visibility / feature. Can be used to enable text deletion.
static
SetHasText(DependencyObject, bool) void
static
SetIsClearTextButtonBehaviorEnabled(Button, bool) void
Sets the clear text button behavior.
static
SetIsMonitoring(DependencyObject, bool) void
static
SetIsSpellCheckContextMenuEnabled(UIElement, bool) void
static
SetIsWaitingForData(DependencyObject, bool) void
static
SetSelectAllOnFocus(DependencyObject, bool) void
static
SetTextButton(DependencyObject, bool) void
Sets the text button visibility.
static
SetUseFloatingWatermark(DependencyObject, bool) void
static
SetWatermark(DependencyObject, string) void
static
SetWatermarkAlignment(DependencyObject, TextAlignment) void
Sets a value that indicates the horizontal alignment of the watermark.
static
SetWatermarkTrimming(DependencyObject, TextTrimming) void
Sets the text trimming behavior to employ when watermark overflows the content area.
static
SetWatermarkWrapping(DependencyObject, TextWrapping) void
Sets how the watermark should wrap text.
static