C# Класс Hourglass.Windows.Watermark

Provides a DependencyProperty that allows a watermark to be applied to TextBox and ComboBox controls when the control has no actual value.
Показать файл Открыть проект

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

Свойство Тип Описание
HintBrushProperty System.Windows.DependencyProperty
HintProperty System.Windows.DependencyProperty

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

Метод Описание
GetHint ( Control control ) : object

Returns the value of the HintProperty.

GetHintBrush ( Control control ) : System.Windows.Media.Brush

Returns the value of the HintBrushProperty.

SetHint ( Control control, object value ) : void

Sets the value of the HintProperty.

SetHintBrush ( Control control, System.Windows.Media.Brush value ) : void

Sets the value of the HintBrushProperty.

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

Метод Описание
AddWatermarkAdorner ( Control control, object hint, System.Windows.Media.Brush brush ) : void

Adds a WatermarkAdorner to a Control.

BindControl ( Control control ) : void

Binds the event handlers for to a Control.

ComboBoxSelectionChanged ( object sender, System.Windows.Controls.SelectionChangedEventArgs e ) : void

Invoked when the selection of a combo box control changes.

ComboBoxTextChanged ( object sender, RoutedEventArgs e ) : void

Invoked when content changes in a combo box control changes.

ControlGotKeyboardFocus ( object sender, System.Windows.Input.KeyboardFocusChangedEventArgs e ) : void

Invoked when the keyboard is focused on a control.

ControlLoaded ( object sender, RoutedEventArgs e ) : void

Invoked when the control is laid out, rendered, and ready for interaction.

ControlLostKeyboardFocus ( object sender, System.Windows.Input.KeyboardFocusChangedEventArgs e ) : void

Invoked when the keyboard is no longer focused on a control.

DependencyPropertyChanged ( DependencyObject sender, System.Windows.DependencyPropertyChangedEventArgs e ) : void

Invoked when the effective value of a DependencyProperty changes.

GetWatermarkAdorner ( Control control ) : WatermarkAdorner

Returns a WatermarkAdorner for a Control, or null if none exists.

HasActualValue ( Control control ) : bool

Returns a value indicating whether a Control has an actual value (where the text property is not null or empty).

RemoveWatermarkAdorner ( Control control ) : void

Removes the WatermarkAdorner from a Control.

TextBoxTextChanged ( object sender, System.Windows.Controls.TextChangedEventArgs e ) : void

Invoked when content changes in a text box control.

UpdateAdornerLayer ( Control control ) : void

Forces the AdornerLayer to re-render.

UpdateWatermark ( Control control ) : void

Updates the WatermarkAdorner on the Control.

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

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

Returns the value of the HintProperty.
public static GetHint ( Control control ) : object
control System.Windows.Controls.Control A .
Результат object

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

Returns the value of the HintBrushProperty.
public static GetHintBrush ( Control control ) : System.Windows.Media.Brush
control System.Windows.Controls.Control A .
Результат System.Windows.Media.Brush

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

Sets the value of the HintProperty.
public static SetHint ( Control control, object value ) : void
control System.Windows.Controls.Control A .
value object The value to set.
Результат void

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

Sets the value of the HintBrushProperty.
public static SetHintBrush ( Control control, System.Windows.Media.Brush value ) : void
control System.Windows.Controls.Control A .
value System.Windows.Media.Brush The value to set.
Результат void

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

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

A DependencyProperty that specifies the foreground of the watermark to be displayed when the control has no actual value and no keyboard focus.
public static DependencyProperty,System.Windows HintBrushProperty
Результат System.Windows.DependencyProperty

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

A DependencyProperty that specifies the content of the watermark to be displayed when the control has no actual value and no keyboard focus, typically a string.
public static DependencyProperty,System.Windows HintProperty
Результат System.Windows.DependencyProperty