C# Класс MahApps.Metro.Controls.TextBoxHelper

A helper class that provides various attached properties for the TextBox control.
Password watermarking code from: http://prabu-guru.blogspot.com/2010/06/how-to-add-watermark-text-to-textbox.html
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
ButtonCommandParameterProperty System.Windows.DependencyProperty
ButtonCommandProperty System.Windows.DependencyProperty
ButtonContentProperty System.Windows.DependencyProperty
ButtonFontFamilyProperty System.Windows.DependencyProperty
ButtonTemplateProperty System.Windows.DependencyProperty
ButtonsAlignmentProperty System.Windows.DependencyProperty
ClearTextButtonProperty System.Windows.DependencyProperty
IsClearTextButtonBehaviorEnabledProperty System.Windows.DependencyProperty
IsMonitoringProperty System.Windows.DependencyProperty
IsWaitingForDataProperty System.Windows.DependencyProperty
SelectAllOnFocusProperty System.Windows.DependencyProperty
TextLengthProperty System.Windows.DependencyProperty
UseFloatingWatermarkProperty DependencyProperty
WatermarkProperty DependencyProperty

Открытые методы

Метод Описание
ButtonClicked ( object sender, RoutedEventArgs e ) : void
GetButtonCommand ( DependencyObject d ) : ICommand
GetButtonCommandParameter ( DependencyObject d ) : object
GetButtonContent ( DependencyObject d ) : object
GetButtonFontFamily ( DependencyObject d ) : FontFamily
GetButtonTemplate ( DependencyObject d ) : System.Windows.Controls.ControlTemplate
GetButtonsAlignment ( DependencyObject d ) : ButtonsAlignment

Gets the buttons placement variant.

GetClearTextButton ( DependencyObject d ) : bool
GetHasText ( DependencyObject obj ) : bool

Gets if the attached TextBox has text.

GetIsWaitingForData ( DependencyObject obj ) : bool
GetSelectAllOnFocus ( DependencyObject obj ) : bool
GetUseFloatingWatermark ( DependencyObject obj ) : bool
GetWatermark ( DependencyObject obj ) : string
SetButtonCommand ( DependencyObject obj, ICommand value ) : void
SetButtonCommandParameter ( DependencyObject obj, object value ) : void
SetButtonContent ( DependencyObject obj, object value ) : void
SetButtonFontFamily ( DependencyObject obj, FontFamily value ) : void
SetButtonTemplate ( DependencyObject obj, System.Windows.Controls.ControlTemplate value ) : void
SetButtonsAlignment ( DependencyObject obj, ButtonsAlignment value ) : void

Sets the buttons placement variant.

SetClearTextButton ( DependencyObject obj, bool value ) : void
SetHasText ( DependencyObject obj, bool value ) : void
SetIsMonitoring ( DependencyObject obj, bool value ) : void
SetIsWaitingForData ( DependencyObject obj, bool value ) : void
SetSelectAllOnFocus ( DependencyObject obj, bool value ) : void
SetUseFloatingWatermark ( DependencyObject obj, bool value ) : void
SetWatermark ( DependencyObject obj, string value ) : void

Приватные методы

Метод Описание
ButtonCommandOrClearTextChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
ComboBoxLoaded ( object sender, RoutedEventArgs e ) : void
GetDefaultTextBoxBaseContextMenu ( ) : System.Windows.Controls.ContextMenu
GetIsClearTextButtonBehaviorEnabled ( System.Windows.Controls.Button d ) : bool
GetIsSpellCheckContextMenuEnabled ( UIElement element ) : bool
IsClearTextButtonBehaviorEnabledChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
OnIsMonitoringChanged ( DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e ) : void
PassBoxLoaded ( object sender, RoutedEventArgs e ) : void
PasswordChanged ( object sender, RoutedEventArgs e ) : void
PasswordGotFocus ( object sender, RoutedEventArgs e ) : void
SetIsClearTextButtonBehaviorEnabled ( System.Windows.Controls.Button obj, bool value ) : void
SetIsSpellCheckContextMenuEnabled ( UIElement element, bool value ) : void
SetTextLength ( DependencyObject obj, int value ) : void
TextBoxBaseContextMenuOpening ( object sender, System.Windows.Controls.ContextMenuEventArgs e ) : void
TextBoxGotFocus ( object sender, RoutedEventArgs e ) : void
TextBoxLoaded ( object sender, RoutedEventArgs e ) : void
TextChanged ( object sender, System.Windows.Controls.TextChangedEventArgs e ) : void
UseSpellCheckContextMenuChanged ( DependencyObject d, DependencyPropertyChangedEventArgs e ) : void

Описание методов

ButtonClicked() публичный статический Метод

public static ButtonClicked ( object sender, RoutedEventArgs e ) : void
sender object
e System.Windows.RoutedEventArgs
Результат void

GetButtonCommand() публичный статический Метод

public static GetButtonCommand ( DependencyObject d ) : ICommand
d System.Windows.DependencyObject
Результат ICommand

GetButtonCommandParameter() публичный статический Метод

public static GetButtonCommandParameter ( DependencyObject d ) : object
d System.Windows.DependencyObject
Результат object

GetButtonContent() публичный статический Метод

public static GetButtonContent ( DependencyObject d ) : object
d System.Windows.DependencyObject
Результат object

GetButtonFontFamily() публичный статический Метод

public static GetButtonFontFamily ( DependencyObject d ) : FontFamily
d System.Windows.DependencyObject
Результат FontFamily

GetButtonTemplate() публичный статический Метод

public static GetButtonTemplate ( DependencyObject d ) : System.Windows.Controls.ControlTemplate
d System.Windows.DependencyObject
Результат System.Windows.Controls.ControlTemplate

GetButtonsAlignment() публичный статический Метод

Gets the buttons placement variant.
public static GetButtonsAlignment ( DependencyObject d ) : ButtonsAlignment
d System.Windows.DependencyObject
Результат ButtonsAlignment

GetClearTextButton() публичный статический Метод

public static GetClearTextButton ( DependencyObject d ) : bool
d System.Windows.DependencyObject
Результат bool

GetHasText() публичный статический Метод

Gets if the attached TextBox has text.
public static GetHasText ( DependencyObject obj ) : bool
obj System.Windows.DependencyObject
Результат bool

GetIsWaitingForData() публичный статический Метод

public static GetIsWaitingForData ( DependencyObject obj ) : bool
obj System.Windows.DependencyObject
Результат bool

GetSelectAllOnFocus() публичный статический Метод

public static GetSelectAllOnFocus ( DependencyObject obj ) : bool
obj System.Windows.DependencyObject
Результат bool

GetUseFloatingWatermark() публичный статический Метод

public static GetUseFloatingWatermark ( DependencyObject obj ) : bool
obj System.Windows.DependencyObject
Результат bool

GetWatermark() публичный статический Метод

public static GetWatermark ( DependencyObject obj ) : string
obj System.Windows.DependencyObject
Результат string

SetButtonCommand() публичный статический Метод

public static SetButtonCommand ( DependencyObject obj, ICommand value ) : void
obj System.Windows.DependencyObject
value ICommand
Результат void

SetButtonCommandParameter() публичный статический Метод

public static SetButtonCommandParameter ( DependencyObject obj, object value ) : void
obj System.Windows.DependencyObject
value object
Результат void

SetButtonContent() публичный статический Метод

public static SetButtonContent ( DependencyObject obj, object value ) : void
obj System.Windows.DependencyObject
value object
Результат void

SetButtonFontFamily() публичный статический Метод

public static SetButtonFontFamily ( DependencyObject obj, FontFamily value ) : void
obj System.Windows.DependencyObject
value FontFamily
Результат void

SetButtonTemplate() публичный статический Метод

public static SetButtonTemplate ( DependencyObject obj, System.Windows.Controls.ControlTemplate value ) : void
obj System.Windows.DependencyObject
value System.Windows.Controls.ControlTemplate
Результат void

SetButtonsAlignment() публичный статический Метод

Sets the buttons placement variant.
public static SetButtonsAlignment ( DependencyObject obj, ButtonsAlignment value ) : void
obj System.Windows.DependencyObject
value ButtonsAlignment
Результат void

SetClearTextButton() публичный статический Метод

public static SetClearTextButton ( DependencyObject obj, bool value ) : void
obj System.Windows.DependencyObject
value bool
Результат void

SetHasText() публичный статический Метод

public static SetHasText ( DependencyObject obj, bool value ) : void
obj System.Windows.DependencyObject
value bool
Результат void

SetIsMonitoring() публичный статический Метод

public static SetIsMonitoring ( DependencyObject obj, bool value ) : void
obj System.Windows.DependencyObject
value bool
Результат void

SetIsWaitingForData() публичный статический Метод

public static SetIsWaitingForData ( DependencyObject obj, bool value ) : void
obj System.Windows.DependencyObject
value bool
Результат void

SetSelectAllOnFocus() публичный статический Метод

public static SetSelectAllOnFocus ( DependencyObject obj, bool value ) : void
obj System.Windows.DependencyObject
value bool
Результат void

SetUseFloatingWatermark() публичный статический Метод

public static SetUseFloatingWatermark ( DependencyObject obj, bool value ) : void
obj System.Windows.DependencyObject
value bool
Результат void

SetWatermark() публичный статический Метод

public static SetWatermark ( DependencyObject obj, string value ) : void
obj System.Windows.DependencyObject
value string
Результат void

Описание свойств

ButtonCommandParameterProperty публичное статическое свойство

public static DependencyProperty,System.Windows ButtonCommandParameterProperty
Результат System.Windows.DependencyProperty

ButtonCommandProperty публичное статическое свойство

public static DependencyProperty,System.Windows ButtonCommandProperty
Результат System.Windows.DependencyProperty

ButtonContentProperty публичное статическое свойство

public static DependencyProperty,System.Windows ButtonContentProperty
Результат System.Windows.DependencyProperty

ButtonFontFamilyProperty публичное статическое свойство

public static DependencyProperty,System.Windows ButtonFontFamilyProperty
Результат System.Windows.DependencyProperty

ButtonTemplateProperty публичное статическое свойство

public static DependencyProperty,System.Windows ButtonTemplateProperty
Результат System.Windows.DependencyProperty

ButtonsAlignmentProperty публичное статическое свойство

public static DependencyProperty,System.Windows ButtonsAlignmentProperty
Результат System.Windows.DependencyProperty

ClearTextButtonProperty публичное статическое свойство

public static DependencyProperty,System.Windows ClearTextButtonProperty
Результат System.Windows.DependencyProperty

IsClearTextButtonBehaviorEnabledProperty публичное статическое свойство

The clear text button behavior property. It sets a click event to the button if the value is true.
public static DependencyProperty,System.Windows IsClearTextButtonBehaviorEnabledProperty
Результат System.Windows.DependencyProperty

IsMonitoringProperty публичное статическое свойство

public static DependencyProperty,System.Windows IsMonitoringProperty
Результат System.Windows.DependencyProperty

IsWaitingForDataProperty публичное статическое свойство

public static DependencyProperty,System.Windows IsWaitingForDataProperty
Результат System.Windows.DependencyProperty

SelectAllOnFocusProperty публичное статическое свойство

public static DependencyProperty,System.Windows SelectAllOnFocusProperty
Результат System.Windows.DependencyProperty

TextLengthProperty публичное статическое свойство

public static DependencyProperty,System.Windows TextLengthProperty
Результат System.Windows.DependencyProperty

UseFloatingWatermarkProperty публичное статическое свойство

public static DependencyProperty UseFloatingWatermarkProperty
Результат DependencyProperty

WatermarkProperty публичное статическое свойство

public static DependencyProperty WatermarkProperty
Результат DependencyProperty