Hi,
I'm using a MaskedTextBox to validate an IP Address and would also like it to match when the MaskedTextBox is empty.
Here is my XAML:
<Editors:MaskedTextBox x:Name="ipAddressTextBox"
Grid.Row="1"
Width="100"
Height="24"
Mask="^(\s*|[0-9]{0,3}[.][0-9]{0,3}[.][0-9]{0,3}[.][0-9]{0,3})$"
MaskType="Regex"
Text="{Binding Path=IpAddressComparableValue,
RelativeSource={RelativeSource TemplatedParent},
UpdateSourceTrigger=LostFocus,
ValidatesOnDataErrors=True,
Converter={StaticResource ipAddressComparableTextConverter}}"
ToolTip="{x:Static Properties:Resources.IpAddressTextBoxToolTip}" />
The regex that I'm using should work but the behavior in the MaskedTextBox isn't what I hoped for. Is there a way to match the IP Address regex and allow the text box to be empty also?
Thanks,
Josh