|
34 | 34 |
|
35 | 35 | <StackPanel Margin="10,10,10,0"> |
36 | 36 | <TextBox Name="PhoneNumberValidator" |
37 | | - ui:TextBoxRegex.Regex="^\s*\+?\s*([0-9][\s-]*){9,}$" |
| 37 | + ui:TextBoxExtensions.Regex="^\s*\+?\s*([0-9][\s-]*){9,}$" |
38 | 38 | Header="Text box with Regex extension for phone number, validation occurs on TextChanged" |
39 | 39 | HeaderTemplate="{StaticResource HeaderTemplate}" |
40 | 40 | Style="{StaticResource TextBoxRegexStyle}" /> |
41 | 41 | <StackPanel Orientation="Horizontal"> |
42 | 42 | <TextBlock Text="Is Valid: " /> |
43 | | - <TextBlock Text="{Binding (ui:TextBoxRegex.IsValid), ElementName=PhoneNumberValidator, Converter={StaticResource StringFormatConverter}}" /> |
| 43 | + <TextBlock Text="{Binding (ui:TextBoxExtensions.IsValid), ElementName=PhoneNumberValidator, Converter={StaticResource StringFormatConverter}}" /> |
44 | 44 | </StackPanel> |
45 | 45 |
|
46 | 46 | </StackPanel> |
47 | 47 |
|
48 | 48 | <StackPanel Grid.Row="1" |
49 | | - Margin="10,10,10,0"> |
| 49 | + Margin="10,10,10,0"> |
50 | 50 | <TextBox Name="CharactValidator" |
51 | | - ui:TextBoxRegex.ValidationMode="Dynamic" |
52 | | - ui:TextBoxRegex.ValidationType="Characters" |
| 51 | + ui:TextBoxExtensions.ValidationMode="Dynamic" |
| 52 | + ui:TextBoxExtensions.ValidationType="Characters" |
53 | 53 | Header="Text box with ValidationType=Characters, validation occurs at input with ValidationMode=Dynamic and clear only single character when value is invalid" |
54 | 54 | HeaderTemplate="{StaticResource HeaderTemplate}" |
55 | 55 | Style="{StaticResource TextBoxRegexStyle}" |
56 | 56 | Text="abcdef" /> |
57 | 57 | <StackPanel Orientation="Horizontal"> |
58 | 58 | <TextBlock Text="Is Valid: " /> |
59 | | - <TextBlock Text="{Binding (ui:TextBoxRegex.IsValid), ElementName=CharactValidator, Converter={StaticResource StringFormatConverter}}" /> |
| 59 | + <TextBlock Text="{Binding (ui:TextBoxExtensions.IsValid), ElementName=CharactValidator, Converter={StaticResource StringFormatConverter}}" /> |
60 | 60 | </StackPanel> |
61 | 61 | </StackPanel> |
62 | 62 |
|
63 | 63 | <StackPanel Grid.Row="2" |
64 | | - Margin="10,10,10,0"> |
| 64 | + Margin="10,10,10,0"> |
65 | 65 | <TextBox Name="EmailValidator" |
66 | | - ui:TextBoxRegex.ValidationType="Email" |
| 66 | + ui:TextBoxExtensions.ValidationType="Email" |
67 | 67 | Header="Text box with ValidationType=Email, validation occurs on TextChanged" |
68 | 68 | HeaderTemplate="{StaticResource HeaderTemplate}" |
69 | 69 | Style="{StaticResource TextBoxRegexStyle}" /> |
70 | 70 | <StackPanel Orientation="Horizontal"> |
71 | 71 | <TextBlock Text="Is Valid: " /> |
72 | | - <TextBlock Text="{Binding (ui:TextBoxRegex.IsValid), ElementName=EmailValidator, Converter={StaticResource StringFormatConverter}}" /> |
| 72 | + <TextBlock Text="{Binding (ui:TextBoxExtensions.IsValid), ElementName=EmailValidator, Converter={StaticResource StringFormatConverter}}" /> |
73 | 73 | </StackPanel> |
74 | 74 | </StackPanel> |
75 | 75 |
|
76 | 76 | <StackPanel Grid.Row="3" |
77 | 77 | Margin="10,10,10,0"> |
78 | 78 | <TextBox Name="DecimalValidatorForce" |
79 | | - ui:TextBoxRegex.ValidationMode="Forced" |
80 | | - ui:TextBoxRegex.ValidationType="Decimal" |
| 79 | + ui:TextBoxExtensions.ValidationMode="Forced" |
| 80 | + ui:TextBoxExtensions.ValidationType="Decimal" |
81 | 81 | Header="Text box with ValidationType=Decimal, validation occurs on TextChanged and force occurs on lose focus with ValidationMode=Force (333,111 or 333.111)" |
82 | 82 | HeaderTemplate="{StaticResource HeaderTemplate}" |
83 | 83 | Style="{StaticResource TextBoxRegexStyle}" /> |
84 | 84 | <StackPanel Orientation="Horizontal"> |
85 | 85 | <TextBlock Text="Is Valid: " /> |
86 | | - <TextBlock Text="{Binding (ui:TextBoxRegex.IsValid), ElementName=DecimalValidatorForce, Converter={StaticResource StringFormatConverter}}" /> |
| 86 | + <TextBlock Text="{Binding (ui:TextBoxExtensions.IsValid), ElementName=DecimalValidatorForce, Converter={StaticResource StringFormatConverter}}" /> |
87 | 87 | </StackPanel> |
88 | 88 | </StackPanel> |
89 | 89 |
|
90 | 90 | <StackPanel Grid.Row="4" |
91 | 91 | Margin="10,10,10,0"> |
92 | 92 | <TextBox Name="NumberValidatorDynamic" |
93 | | - ui:TextBoxRegex.ValidationMode="Dynamic" |
94 | | - ui:TextBoxRegex.ValidationType="Number" |
| 93 | + ui:TextBoxExtensions.ValidationMode="Dynamic" |
| 94 | + ui:TextBoxExtensions.ValidationType="Number" |
95 | 95 | Header="Text box with ValidationType=Number, validation occurs at input with ValidationMode=Dynamic and clear only single character when value is invalid" |
96 | 96 | HeaderTemplate="{StaticResource HeaderTemplate}" |
97 | 97 | Style="{StaticResource TextBoxRegexStyle}" /> |
98 | 98 | <StackPanel Orientation="Horizontal"> |
99 | 99 | <TextBlock Text="Is Valid: " /> |
100 | | - <TextBlock Text="{Binding (ui:TextBoxRegex.IsValid), ElementName=NumberValidatorDynamic, Converter={StaticResource StringFormatConverter}}" /> |
| 100 | + <TextBlock Text="{Binding (ui:TextBoxExtensions.IsValid), ElementName=NumberValidatorDynamic, Converter={StaticResource StringFormatConverter}}" /> |
101 | 101 | </StackPanel> |
102 | 102 | </StackPanel> |
103 | 103 |
|
|
0 commit comments