Table of Contents

Class WatermarkTextBoxBehavior

Namespace
HeBianGu.Base.WpfBase
Assembly
HeBianGu.Base.WpfBase.dll

This behavior associates a watermark onto a TextBox indicating what the user should provide as input.

public class WatermarkTextBoxBehavior : Behavior<TextBox>, IAnimatable, IAttachedObject
Inheritance
WatermarkTextBoxBehavior
Implements
Inherited Members
Extension Methods

Fields

IsWatermarkedProperty

This readonly property is applied to the TextBox and indicates whether the watermark is currently being displayed. It allows a style to change the visual appearanve of the TextBox.

public static readonly DependencyProperty IsWatermarkedProperty

Field Value

DependencyProperty

TextProperty

The watermark text

public static readonly DependencyProperty TextProperty

Field Value

DependencyProperty

Properties

Text

The watermark text

public string Text { get; set; }

Property Value

string

Methods

GetIsWatermarked(TextBox)

Retrieves the current watermarked state of the TextBox.

public static bool GetIsWatermarked(TextBox tb)

Parameters

tb TextBox

Returns

bool

OnAttached()

Called after the behavior is attached to an AssociatedObject.

protected override void OnAttached()

Remarks

Override this to hook up functionality to the AssociatedObject.

OnDetaching()

Called when the behavior is being detached from its AssociatedObject, but before it has actually occurred.

protected override void OnDetaching()

Remarks

Override this to unhook functionality from the AssociatedObject.