Class TextBoxTimeSpanMaskingBehavior
A masking behavior to only allow entering of TimeSpans.
Behavior<TextBox>.AssociatedObject
Behavior.CreateInstanceCore()
Behavior.Detach()
Behavior.AssociatedType
Namespace: Sartorius.SAF.Presentation.Controls.Behaviors
Assembly: Sartorius.SAF.Presentation.Controls.dll
Syntax
public class TextBoxTimeSpanMaskingBehavior : TextBoxMaskingBehaviorBase, IAnimatable, IAttachedObject
Examples
The following example illustrates how to use the TextBoxTimeSpanMaskingBehavior to restrict the user input to exclusively allowing a TimeSpan.
<StackPanel Orientation="Horizontal">
<SAF:Caption Style="{SAF:Style CaptionContentBox}"
Text="Enter the timespan" />
<TextBox Style="{SAF:Style TextBoxSingleLine}"
Text="{Binding TimeSpan}"
Width="150">
<b:Interaction.Behaviors>
<SAF:TextBoxTimeSpanMaskingBehavior />
</b:Interaction.Behaviors>
</TextBox>
</StackPanel>
Constructors
View SourceTextBoxTimeSpanMaskingBehavior()
Creates a new instance of the TextBoxTimeSpanMaskingBehavior class.
Declaration
public TextBoxTimeSpanMaskingBehavior()
Methods
View SourceIsValid(string)
Checks whether the valueToValidate matches the pattern to be valid.
Declaration
public override bool IsValid(string valueToValidate)
Parameters
| Type | Name | Description |
|---|---|---|
| string | valueToValidate | The value for validation. |
Returns
| Type | Description |
|---|---|
| bool | True if the value is valid, otherwise false. |
Overrides
Implements
Microsoft.Xaml.Behaviors.IAttachedObject