Class WatermarkTextBox
A TextBox with Watermark
Inheritance
Implements
Namespace: Sartorius.SAF.Presentation.Controls
Assembly: Sartorius.SAF.Presentation.Controls.dll
Syntax
public class WatermarkTextBox : TextBox, IAnimatable, ISupportInitialize, IFrameworkInputElement, IInputElement, IQueryAmbient, IAddChild, INotifyPropertyChanged
Constructors
View SourceWatermarkTextBox()
Default constructor
Declaration
public WatermarkTextBox()
Fields
View SourceMultiLineProperty
Defines the dependency property for the MultiLine property.
Declaration
public static readonly DependencyProperty MultiLineProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
ResetButtonStyleProperty
Defines the dependency property for the ResetButtonStyle property.
Declaration
public static readonly DependencyProperty ResetButtonStyleProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
ShowResetButtonProperty
Defines the dependency property for the ShowResetButton property.
Declaration
public static readonly DependencyProperty ShowResetButtonProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
TextLeftOffsetProperty
Defines the dependency property for the TextLeftOffset property.
Declaration
public static readonly DependencyProperty TextLeftOffsetProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
TextToUnitOffsetProperty
Defines the dependency property for the TextToUnitOffset property.
Declaration
public static readonly DependencyProperty TextToUnitOffsetProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
UnitProperty
Defines the dependency property for the Unit property.
Declaration
public static readonly DependencyProperty UnitProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
WatermarkForegroundProperty
Defines the dependency property for the WatermarkForeground property.
Declaration
public static readonly DependencyProperty WatermarkForegroundProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
WatermarkProperty
Defines the dependency property for the Watermark property.
Declaration
public static readonly DependencyProperty WatermarkProperty
Field Value
| Type | Description |
|---|---|
| DependencyProperty |
Properties
View SourceHasContent
Indicates whether the TextBox has content
Declaration
public bool HasContent { get; }
Property Value
| Type | Description |
|---|---|
| bool |
MultiLine
Indicates whether the TextBox is multiline
Declaration
public bool MultiLine { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
ResetButtonStyle
Gets or sets the Style of the ResetButton
Declaration
public Style ResetButtonStyle { get; set; }
Property Value
| Type | Description |
|---|---|
| Style |
ResetButtonVisibility
Gets or sets the Visibility of the ResetButton
Declaration
public Visibility ResetButtonVisibility { get; set; }
Property Value
| Type | Description |
|---|---|
| Visibility |
ResetCommand
Set Text of TextBox to string.Empty
Declaration
public ICommand ResetCommand { get; }
Property Value
| Type | Description |
|---|---|
| ICommand |
ScrollViewerMargin
Gets the Margin of the ScrollViewer
Declaration
public Thickness ScrollViewerMargin { get; }
Property Value
| Type | Description |
|---|---|
| Thickness |
ShowResetButton
Indicates wther the ResetButton is shown
Declaration
public bool ShowResetButton { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
TextLeftOffset
Gets or sets the left offset of the ScrollViewer witch contains the Text and the left offset of the SearchTextBlock
Declaration
public int TextLeftOffset { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
TextToUnitOffset
Gets or sets the space between the text an the unit
Declaration
public double TextToUnitOffset { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Unit
Gets or sets the Text for Unit
Declaration
public string Unit { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
UnitMargin
Gets the Margin for the Unit TextBlock
Declaration
public Thickness UnitMargin { get; }
Property Value
| Type | Description |
|---|---|
| Thickness |
Watermark
Gets or sets the watermark text
Declaration
public string Watermark { get; set; }
Property Value
| Type | Description |
|---|---|
| string |
WatermarkForeground
Gets or sets the watermark foreground
Declaration
public Brush WatermarkForeground { get; set; }
Property Value
| Type | Description |
|---|---|
| Brush |
WatermarkTextMargin
Gets the MArgin of the SearchTextBlock
Declaration
public Thickness WatermarkTextMargin { get; }
Property Value
| Type | Description |
|---|---|
| Thickness |
WatermarkVisibility
Gets the visibility of the watermark
Declaration
public Visibility WatermarkVisibility { get; set; }
Property Value
| Type | Description |
|---|---|
| Visibility |
Methods
View SourceOnApplyTemplate()
Called, when Template loaded
Declaration
public override void OnApplyTemplate()
Overrides
View SourceOnGotFocus(RoutedEventArgs)
Invoked whenever an unhandled GotFocus event reaches this element in its route.
Declaration
protected override void OnGotFocus(RoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| RoutedEventArgs | e | The RoutedEventArgs that contains the event data. |
Overrides
View SourceOnLostFocus(RoutedEventArgs)
Raises the LostFocus event (using the provided arguments).
Declaration
protected override void OnLostFocus(RoutedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| RoutedEventArgs | e | Provides data about the event. |
Overrides
View SourceOnPropertyChanged(string)
Raises the PropertChaned event with string as parameter
Declaration
protected virtual void OnPropertyChanged(string propertyName)
Parameters
| Type | Name | Description |
|---|---|---|
| string | propertyName | The name of the property |
OnPropertyChanged<T>(Expression<Func<T>>)
Raises the PropertChaned event with Expression of(T) as parameter
Declaration
protected virtual void OnPropertyChanged<T>(Expression<Func<T>> expression)
Parameters
| Type | Name | Description |
|---|---|---|
| Expression<Func<T>> | expression |
Type Parameters
| Name | Description |
|---|---|
| T |
OnTextChanged(TextChangedEventArgs)
Is called when the content in this editing control changes. The main job is to trigger adjusting the Unit property.
Declaration
protected override void OnTextChanged(TextChangedEventArgs e)
Parameters
| Type | Name | Description |
|---|---|---|
| TextChangedEventArgs | e |
Overrides
Events
View SourcePropertyChanged
Occures when a property value changes
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
| Type | Description |
|---|---|
| PropertyChangedEventHandler |