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

Methods

Name Return 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