Skip to content

Commit

Permalink
AdvancedEntry Email Check Update ( #103 )
Browse files Browse the repository at this point in the history
  • Loading branch information
enisn committed Mar 25, 2019
1 parent 88803ef commit 64a48f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion InputKit/Shared/Controls/AdvancedEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public bool IsAnnotated
case AnnotationType.Text:
return Text.All(c => c == ' ' || !(Char.IsSymbol(c) || Char.IsSurrogate(c) || Char.IsControl(c) || Char.IsPunctuation(c)));
case AnnotationType.Email:
return Regex.Match(Text, "^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$").Success;
return Regex.Match(Text, @"^\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$").Success;
case AnnotationType.Password:
return Text.Any(Char.IsDigit) && Text.Any(Char.IsLetter);
case AnnotationType.Regex:
Expand Down
2 changes: 1 addition & 1 deletion Sample.InputKit/Sample.InputKit/MainPage.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
SelectedItem="{Binding SelectedItem}"
/>

<input:AdvancedEntry Placeholder="E-mail" IsRequired="True" ValidationMessage="Hey it's wrong!!" Annotation="Regex" RegexPattern="^([\w\.\-]+)@([\w\-]+)((\.(\w){2,3})+)$" />
<input:AdvancedEntry Placeholder="E-mail" IsRequired="True" ValidationMessage="Hey it's wrong!!" Annotation="Email"/>

<input:AdvancedSlider MaxValue="5000" MinValue="50" StepValue="50" Value="{Binding Price}" ValuePrefix="Price:" ValueSuffix="" Title="Choose Budget:"/>

Expand Down

0 comments on commit 64a48f1

Please sign in to comment.