{"id":1022,"date":"2018-07-15T15:19:44","date_gmt":"2018-07-15T12:19:44","guid":{"rendered":"http:\/\/enisnecipoglu.com\/?p=1022"},"modified":"2018-07-15T15:19:44","modified_gmt":"2018-07-15T12:19:44","slug":"xamarin-forms-ile-validation","status":"publish","type":"post","link":"https:\/\/enisnecipoglu.com\/en\/xamarin-forms-ile-validation\/","title":{"rendered":"Validation on Xamarin Forms"},"content":{"rendered":"<p><\/p>\n<p>Projects with too much Inputs, can be difficult to validate you inputs. I&#8217;ll share easiy way to validate your inputs and it&#8217;ll make quick your job.<\/p>\n<hr \/>\n<h1>INSTALLATION <\/h1>\n<p>Firstly add <strong>Xamarin.Form.InputKit<\/strong> Nuget Package to your project.<br \/>\n<img loading=\"lazy\" src=\"http:\/\/enisnecipoglu.com\/wp-content\/uploads\/2018\/07\/inputkitnuget.png\" alt=\"Xamarin Forms InputKit Checkbox Radio Button Enis Necipo\u011flu\" width=\"1295\" height=\"500\" class=\"aligncenter size-full wp-image-1023\" srcset=\"https:\/\/enisnecipoglu.com\/wp-content\/uploads\/2018\/07\/inputkitnuget.png 1295w, https:\/\/enisnecipoglu.com\/wp-content\/uploads\/2018\/07\/inputkitnuget-300x116.png 300w, https:\/\/enisnecipoglu.com\/wp-content\/uploads\/2018\/07\/inputkitnuget-768x297.png 768w, https:\/\/enisnecipoglu.com\/wp-content\/uploads\/2018\/07\/inputkitnuget-1024x395.png 1024w\" sizes=\"(max-width: 1295px) 100vw, 1295px\" \/><\/p>\n<p>\nIf you want to display an alert icon in AdvancedEntry, you should add an 24dp icon which named as <strong>alert.png<\/strong>\n<\/p>\n<hr \/>\n<h1>USING<\/h1>\n<h2>Generating View<\/h2>\n<p>\nJust create a registration form like below:<br \/>\n<img src=\"http:\/\/enisnecipoglu.com\/wp-content\/uploads\/2018\/07\/37283369_2010567012287735_398185284140793856_n.png\" alt=\"Xamarin Forms Validation Annotation InputKit\" width=\"480\" class=\"aligncenter size-full wp-image-1026\" srcset=\"https:\/\/enisnecipoglu.com\/wp-content\/uploads\/2018\/07\/37283369_2010567012287735_398185284140793856_n.png 1080w, https:\/\/enisnecipoglu.com\/wp-content\/uploads\/2018\/07\/37283369_2010567012287735_398185284140793856_n-169x300.png 169w, https:\/\/enisnecipoglu.com\/wp-content\/uploads\/2018\/07\/37283369_2010567012287735_398185284140793856_n-768x1365.png 768w, https:\/\/enisnecipoglu.com\/wp-content\/uploads\/2018\/07\/37283369_2010567012287735_398185284140793856_n-576x1024.png 576w\" sizes=\"(max-width: 1080px) 100vw, 1080px\" \/><br \/>\n<br \/>\nBefore start to use controls from InputKit, you need to add an attribute inside ContentPage tag. Just add <br \/>\n<strong>xmlns:input=&#8221;clr-namespace:Plugin.InputKit.Shared.Controls;assembly=Plugin.InputKit&#8221;<\/strong> <br \/>\nthen you&#8217;re ready to use controls.<\/p>\n<p>After that, XAML will be like:<\/p>\n<div class=\"codecolorer-container xml default\" style=\"overflow:auto;white-space:nowrap;height:300px;\"><div class=\"xml codecolorer\"><span class=\"re1\">&lt;?xml<\/span> <span class=\"re0\">version<\/span>=<span class=\"st0\">&quot;1.0&quot;<\/span> <span class=\"re0\">encoding<\/span>=<span class=\"st0\">&quot;utf-8&quot;<\/span> <span class=\"re2\">?&gt;<\/span><br \/>\n<span class=\"re1\">&lt;ContentPage<\/span> <span class=\"re0\">xmlns<\/span>=<span class=\"st0\">&quot;http:\/\/xamarin.com\/schemas\/2014\/forms&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"re0\">xmlns:x<\/span>=<span class=\"st0\">&quot;http:\/\/schemas.microsoft.com\/winfx\/2009\/xaml&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"re0\">xmlns:local<\/span>=<span class=\"st0\">&quot;clr-namespace:FormViewSample.InputKit&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"re0\">xmlns:input<\/span>=<span class=\"st0\">&quot;clr-namespace:Plugin.InputKit.Shared.Controls;assembly=Plugin.InputKit&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"re0\">x:Class<\/span>=<span class=\"st0\">&quot;FormViewSample.InputKit.MainPage&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span class=\"re0\">BackgroundColor<\/span>=<span class=\"st0\">&quot;WhiteSmoke&quot;<\/span><span class=\"re2\">&gt;<\/span><br \/>\n<br \/>\n&nbsp; &nbsp; <span class=\"re1\">&lt;ContentPage.BindingContext<span class=\"re2\">&gt;<\/span><\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re1\">&lt;local:MainViewModel<\/span><span class=\"re2\">\/&gt;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"re1\">&lt;\/ContentPage.BindingContext<span class=\"re2\">&gt;<\/span><\/span><br \/>\n&nbsp; &nbsp; <span class=\"re1\">&lt;ContentPage.Content<span class=\"re2\">&gt;<\/span><\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re1\">&lt;StackLayout<\/span> <span class=\"re0\">Padding<\/span>=<span class=\"st0\">&quot;30&quot;<\/span><span class=\"re2\">&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re1\">&lt;Label<\/span> <span class=\"re0\">Text<\/span>=<span class=\"st0\">&quot;You can see FormView Below:&quot;<\/span><span class=\"re2\">\/&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re1\">&lt;BoxView<\/span> <span class=\"re0\">HeightRequest<\/span>=<span class=\"st0\">&quot;1&quot;<\/span> <span class=\"re0\">Color<\/span>=<span class=\"st0\">&quot;LightGray&quot;<\/span> <span class=\"re2\">\/&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re1\">&lt;input:FormView<\/span> <span class=\"re0\">IsValidated<\/span>=<span class=\"st0\">&quot;{Binding IsValidated}&quot;<\/span><span class=\"re2\">&gt;<\/span><br \/>\n<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re1\">&lt;input:AdvancedEntry<\/span> <br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">Text<\/span>=<span class=\"st0\">&quot;{Binding Email}&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">IsRequired<\/span>=<span class=\"st0\">&quot;True&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">Title<\/span>=<span class=\"st0\">&quot;Place your email below:&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">Annotation<\/span>=<span class=\"st0\">&quot;Email&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">Placeholder<\/span>=<span class=\"st0\">&quot;sample@domain.com&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">AnnotationColor<\/span>=<span class=\"st0\">&quot;Accent&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">ValidationMessage<\/span>=<span class=\"st0\">&quot;Please type a valid email address&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">IconImage<\/span>=<span class=\"st0\">&quot;ic_email_black_24dp.png&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">MinLength<\/span>=<span class=\"st0\">&quot;10&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">MaxLength<\/span>=<span class=\"st0\">&quot;50&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re2\">\/&gt;<\/span><br \/>\n<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re1\">&lt;input:AdvancedEntry<\/span> <br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">Text<\/span>=<span class=\"st0\">&quot;{Binding NameSurname}&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">IsRequired<\/span>=<span class=\"st0\">&quot;True&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">Title<\/span>=<span class=\"st0\">&quot;Place your name below:&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">Annotation<\/span>=<span class=\"st0\">&quot;NameSurname&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">Placeholder<\/span>=<span class=\"st0\">&quot;John Doe&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">AnnotationColor<\/span>=<span class=\"st0\">&quot;Accent&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">ValidationMessage<\/span>=<span class=\"st0\">&quot;Please type your name correctly&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">IconImage<\/span>=<span class=\"st0\">&quot;ic_account_circle_black_24dp.png&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">MinLength<\/span>=<span class=\"st0\">&quot;5&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">MaxLength<\/span>=<span class=\"st0\">&quot;30&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re2\">\/&gt;<\/span><br \/>\n<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re1\">&lt;input:AdvancedEntry<\/span> <br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">Text<\/span>=<span class=\"st0\">&quot;{Binding Phone}&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">IsRequired<\/span>=<span class=\"st0\">&quot;True&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">Title<\/span>=<span class=\"st0\">&quot;Place your phone number below:&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">Annotation<\/span>=<span class=\"st0\">&quot;Phone&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">Placeholder<\/span>=<span class=\"st0\">&quot;5439998877&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">AnnotationColor<\/span>=<span class=\"st0\">&quot;Accent&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">ValidationMessage<\/span>=<span class=\"st0\">&quot;Please type your phone number correctly&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">IconImage<\/span>=<span class=\"st0\">&quot;ic_account_circle_black_24dp.png&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">MaxLength<\/span>=<span class=\"st0\">&quot;10&quot;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re2\">\/&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re1\">&lt;Label<\/span> <span class=\"re0\">Text<\/span>=<span class=\"st0\">&quot;Choose your subscription type:&quot;<\/span> <span class=\"re2\">\/&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re1\">&lt;input:RadioButtonGroupView<\/span> <span class=\"re0\">IsRequired<\/span>=<span class=\"st0\">&quot;True&quot;<\/span><span class=\"re2\">&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re1\">&lt;input:RadioButton<\/span> <span class=\"re0\">Text<\/span>=<span class=\"st0\">&quot;Free&quot;<\/span> <span class=\"re2\">\/&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re1\">&lt;input:RadioButton<\/span> <span class=\"re0\">Text<\/span>=<span class=\"st0\">&quot;Bronze&quot;<\/span> <span class=\"re2\">\/&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re1\">&lt;input:RadioButton<\/span> <span class=\"re0\">Text<\/span>=<span class=\"st0\">&quot;Gold&quot;<\/span> <span class=\"re2\">\/&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re1\">&lt;input:RadioButton<\/span> <span class=\"re0\">Text<\/span>=<span class=\"st0\">&quot;Platinium&quot;<\/span> <span class=\"re2\">\/&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re1\">&lt;\/input:RadioButtonGroupView<span class=\"re2\">&gt;<\/span><\/span><br \/>\n<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re1\">&lt;input:CheckBox<\/span> <span class=\"re0\">IsRequired<\/span>=<span class=\"st0\">&quot;True&quot;<\/span> <span class=\"re0\">Type<\/span>=<span class=\"st0\">&quot;Check&quot;<\/span> <span class=\"re0\">Text<\/span>=<span class=\"st0\">&quot;I Accept User Agreement&quot;<\/span> <span class=\"re2\">\/&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re1\">&lt;Button<\/span> <span class=\"re0\">Command<\/span>=<span class=\"st0\">&quot;{Binding SubmitCommand}&quot;<\/span> <span class=\"re0\">Margin<\/span>=<span class=\"st0\">&quot;0,20&quot;<\/span> <span class=\"re0\">Text<\/span>=<span class=\"st0\">&quot;Submit&quot;<\/span> <span class=\"re0\">BackgroundColor<\/span>=<span class=\"st0\">&quot;Accent&quot;<\/span> <span class=\"re0\">CornerRadius<\/span>=<span class=\"st0\">&quot;20&quot;<\/span> <span class=\"re0\">TextColor<\/span>=<span class=\"st0\">&quot;White&quot;<\/span> <span class=\"re2\">\/&gt;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re1\">&lt;\/input:FormView<span class=\"re2\">&gt;<\/span><\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re1\">&lt;\/StackLayout<span class=\"re2\">&gt;<\/span><\/span><br \/>\n&nbsp; &nbsp; <span class=\"re1\">&lt;\/ContentPage.Content<span class=\"re2\">&gt;<\/span><\/span><br \/>\n<span class=\"re1\">&lt;\/ContentPage<span class=\"re2\">&gt;<\/span><\/span><\/div><\/div>\n<h2>Generating ViewModel<\/h2>\n<p>\nViewModel will be like. <strong>IsValidated<\/strong> proeprty will be set from FormView and you&#8217;ll check that property for know each input validated or not.<\/p>\n<div class=\"codecolorer-container csharp default\" style=\"overflow:auto;white-space:nowrap;height:300px;\"><div class=\"csharp codecolorer\"><span class=\"kw1\">using<\/span> <span class=\"co3\">System<\/span><span class=\"sy0\">;<\/span><br \/>\n<span class=\"kw1\">using<\/span> <span class=\"co3\">System.Collections.Generic<\/span><span class=\"sy0\">;<\/span><br \/>\n<span class=\"kw1\">using<\/span> <span class=\"co3\">System.ComponentModel<\/span><span class=\"sy0\">;<\/span><br \/>\n<span class=\"kw1\">using<\/span> <span class=\"co3\">System.Runtime.CompilerServices<\/span><span class=\"sy0\">;<\/span><br \/>\n<span class=\"kw1\">using<\/span> <span class=\"co3\">System.Text<\/span><span class=\"sy0\">;<\/span><br \/>\n<span class=\"kw1\">using<\/span> <span class=\"co3\">Xamarin.Forms<\/span><span class=\"sy0\">;<\/span><br \/>\n<br \/>\n<span class=\"kw1\">namespace<\/span> FormViewSample<span class=\"sy0\">.<\/span><span class=\"me1\">InputKit<\/span><br \/>\n<span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; <span class=\"kw1\">public<\/span> <span class=\"kw4\">class<\/span> MainViewModel <span class=\"sy0\">:<\/span> INotifyPropertyChanged<br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">private<\/span> <span class=\"kw4\">string<\/span> _nameSurname<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">private<\/span> <span class=\"kw4\">string<\/span> _email<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">private<\/span> <span class=\"kw4\">string<\/span> _phone<span class=\"sy0\">;<\/span><br \/>\n<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">public<\/span> MainViewModel<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; SubmitCommand <span class=\"sy0\">=<\/span> <span class=\"kw3\">new<\/span> Command<span class=\"br0\">&#40;<\/span>Submit<span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">public<\/span> Command SubmitCommand <span class=\"br0\">&#123;<\/span> <span class=\"kw1\">get<\/span><span class=\"sy0\">;<\/span> <span class=\"kw1\">set<\/span><span class=\"sy0\">;<\/span> <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">public<\/span> <span class=\"kw4\">bool<\/span> IsValidated <span class=\"br0\">&#123;<\/span> <span class=\"kw1\">get<\/span><span class=\"sy0\">;<\/span> <span class=\"kw1\">set<\/span><span class=\"sy0\">;<\/span> <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">public<\/span> <span class=\"kw4\">string<\/span> NameSurname <span class=\"br0\">&#123;<\/span> <span class=\"kw1\">get<\/span> <span class=\"sy0\">=&gt;<\/span> _nameSurname<span class=\"sy0\">;<\/span> <span class=\"kw1\">set<\/span> <span class=\"br0\">&#123;<\/span> _nameSurname <span class=\"sy0\">=<\/span> <span class=\"kw1\">value<\/span><span class=\"sy0\">;<\/span> OnPropertyChanged<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span> <span class=\"br0\">&#125;<\/span> <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">public<\/span> <span class=\"kw4\">string<\/span> Email <span class=\"br0\">&#123;<\/span> <span class=\"kw1\">get<\/span> <span class=\"sy0\">=&gt;<\/span> _email<span class=\"sy0\">;<\/span> <span class=\"kw1\">set<\/span> <span class=\"br0\">&#123;<\/span> _email <span class=\"sy0\">=<\/span> <span class=\"kw1\">value<\/span><span class=\"sy0\">;<\/span> OnPropertyChanged<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span> <span class=\"br0\">&#125;<\/span> <span class=\"br0\">&#125;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">public<\/span> <span class=\"kw4\">string<\/span> Phone <span class=\"br0\">&#123;<\/span> <span class=\"kw1\">get<\/span> <span class=\"sy0\">=&gt;<\/span> _phone<span class=\"sy0\">;<\/span> <span class=\"kw1\">set<\/span> <span class=\"br0\">&#123;<\/span> _phone <span class=\"sy0\">=<\/span> <span class=\"kw1\">value<\/span><span class=\"sy0\">;<\/span> OnPropertyChanged<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span> <span class=\"br0\">&#125;<\/span> <span class=\"br0\">&#125;<\/span><br \/>\n<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">async<\/span> <span class=\"kw4\">void<\/span> Submit<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">if<\/span> <span class=\"br0\">&#40;<\/span><span class=\"sy0\">!<\/span>IsValidated<span class=\"br0\">&#41;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#123;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">await<\/span> Application<span class=\"sy0\">.<\/span><span class=\"me1\">Current<\/span><span class=\"sy0\">.<\/span><span class=\"me1\">MainPage<\/span><span class=\"sy0\">.<\/span><span class=\"me1\">DisplayAlert<\/span><span class=\"br0\">&#40;<\/span><span class=\"st0\">&quot;&quot;<\/span>, <span class=\"st0\">&quot;You must fill all areas correctly!&quot;<\/span>, <span class=\"st0\">&quot;OK&quot;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co1\">\/\/DO SOME STUFFS HERE<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n<br \/>\n<br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co2\">#region INotifyPropertyChanged Implementation<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">public<\/span> <span class=\"kw1\">event<\/span> PropertyChangedEventHandler PropertyChanged<span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"kw1\">public<\/span> <span class=\"kw4\">void<\/span> OnPropertyChanged<span class=\"br0\">&#40;<\/span><span class=\"br0\">&#91;<\/span>CallerMemberName<span class=\"br0\">&#93;<\/span><span class=\"kw4\">string<\/span> propName <span class=\"sy0\">=<\/span> <span class=\"st0\">&quot;&quot;<\/span><span class=\"br0\">&#41;<\/span> <span class=\"sy0\">=&gt;<\/span> PropertyChanged<span class=\"sy0\">?.<\/span><span class=\"me1\">Invoke<\/span><span class=\"br0\">&#40;<\/span><span class=\"kw1\">this<\/span>, <span class=\"kw3\">new<\/span> PropertyChangedEventArgs<span class=\"br0\">&#40;<\/span>propName<span class=\"br0\">&#41;<\/span><span class=\"br0\">&#41;<\/span><span class=\"sy0\">;<\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"co2\">#endregion<\/span><br \/>\n&nbsp; &nbsp; <span class=\"br0\">&#125;<\/span><br \/>\n<span class=\"br0\">&#125;<\/span><\/div><\/div>\n<p>\u015eimdi gidip XAML k\u0131sm\u0131ndan ViewModel&#8217;i kulland\u0131\u011f\u0131m\u0131z\u0131 belirltelim:<\/p>\n<div class=\"codecolorer-container xml default\" style=\"overflow:auto;white-space:nowrap;\"><div class=\"xml codecolorer\"><span class=\"sc3\"><span class=\"re1\">&lt;?xml<\/span> <span class=\"re0\">version<\/span>=<span class=\"st0\">&quot;1.0&quot;<\/span> <span class=\"re0\">encoding<\/span>=<span class=\"st0\">&quot;utf-8&quot;<\/span> <span class=\"re2\">?&gt;<\/span><\/span><br \/>\n<span class=\"sc3\"><span class=\"re1\">&lt;ContentPage<\/span> <span class=\"re0\">xmlns<\/span>=<span class=\"st0\">&quot;http:\/\/xamarin.com\/schemas\/2014\/forms&quot;<\/span><\/span><br \/>\n<span class=\"sc3\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">xmlns:x<\/span>=<span class=\"st0\">&quot;http:\/\/schemas.microsoft.com\/winfx\/2009\/xaml&quot;<\/span><\/span><br \/>\n<span class=\"sc3\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">xmlns:local<\/span>=<span class=\"st0\">&quot;clr-namespace:FormViewSample.InputKit&quot;<\/span><\/span><br \/>\n<span class=\"sc3\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">xmlns:input<\/span>=<span class=\"st0\">&quot;clr-namespace:Plugin.InputKit.Shared.Controls;assembly=Plugin.InputKit&quot;<\/span><\/span><br \/>\n<span class=\"sc3\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">x:Class<\/span>=<span class=\"st0\">&quot;FormViewSample.InputKit.MainPage&quot;<\/span><\/span><br \/>\n<span class=\"sc3\"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class=\"re0\">BackgroundColor<\/span>=<span class=\"st0\">&quot;WhiteSmoke&quot;<\/span><span class=\"re2\">&gt;<\/span><\/span><br \/>\n<br \/>\n&nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;ContentPage.BindingContext<span class=\"re2\">&gt;<\/span><\/span><\/span><br \/>\n&nbsp; &nbsp; &nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;local:MainViewModel<\/span><span class=\"re2\">\/&gt;<\/span><\/span><br \/>\n&nbsp; &nbsp; <span class=\"sc3\"><span class=\"re1\">&lt;\/ContentPage.BindingContext<span class=\"re2\">&gt;<\/span><\/span><\/span><br \/>\n...<br \/>\n...<br \/>\n...<\/div><\/div>\n<blockquote><p>\n<strong>You can find sample project from <a href=\"https:\/\/github.com\/enisn\/Xamarin.Forms.InputKit\/tree\/master\/FormViewSample.InputKit\">here<\/a>.\n<\/p><\/blockquote>\n<p><\/p>","protected":false},"excerpt":{"rendered":"Projects with too much Inputs, can be difficult to validate you inputs. I&#8217;ll share easiy way to validate your inputs and it&#8217;ll make quick your job. INSTALLATION Firstly add Xamarin.Form.InputKit Nuget Package to your project. If you want to display an alert icon in AdvancedEntry, you should add an 24dp icon which named as alert.png USING Generating View Just create a registration form like below: Before start to use controls from InputKit, you need to add an attribute inside ContentPage tag. Just add xmlns:input=&#8221;clr-namespace:Plugin.InputKit.Shared.Controls;assembly=Plugin.InputKit&#8221; then you&#8217;re ready to use controls. After that, XAML will be like: &lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot; ?&gt; &lt;ContentPage xmlns=&quot;http:\/\/xamarin.com\/schemas\/2014\/forms&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xmlns:x=&quot;http:\/\/schemas.microsoft.com\/winfx\/2009\/xaml&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xmlns:local=&quot;clr-namespace:FormViewSample.InputKit&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;xmlns:input=&quot;clr-namespace:Plugin.InputKit.Shared.Controls;assembly=Plugin.InputKit&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;x:Class=&quot;FormViewSample.InputKit.MainPage&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;BackgroundColor=&quot;WhiteSmoke&quot;&gt; &nbsp; &nbsp; &lt;ContentPage.BindingContext&gt; &nbsp; &nbsp; &nbsp; &nbsp; &lt;local:MainViewModel\/&gt; &nbsp; &nbsp; &lt;\/ContentPage.BindingContext&gt; &nbsp; &nbsp; &lt;ContentPage.Content&gt; &nbsp; &nbsp; &nbsp; &nbsp; &lt;StackLayout Padding=&quot;30&quot;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;Label Text=&quot;You can see FormView Below:&quot;\/&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;BoxView HeightRequest=&quot;1&quot; Color=&quot;LightGray&quot; \/&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;input:FormView IsValidated=&quot;{Binding IsValidated}&quot;&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;input:AdvancedEntry &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Text=&quot;{Binding Email}&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IsRequired=&quot;True&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Title=&quot;Place your email below:&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Annotation=&quot;Email&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Placeholder=&quot;sample@domain.com&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AnnotationColor=&quot;Accent&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ValidationMessage=&quot;Please type a valid email address&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IconImage=&quot;ic_email_black_24dp.png&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MinLength=&quot;10&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MaxLength=&quot;50&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \/&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;input:AdvancedEntry &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Text=&quot;{Binding NameSurname}&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; IsRequired=&quot;True&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Title=&quot;Place your name below:&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Annotation=&quot;NameSurname&quot; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Placeholder=&quot;John Doe&quot; &nbsp; &nbsp; &nbsp; &nbsp; ","protected":false},"author":1,"featured_media":1034,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[20,15,6],"tags":[59,60,47,58,56,48,57,28,61,29],"_links":{"self":[{"href":"https:\/\/enisnecipoglu.com\/en\/wp-json\/wp\/v2\/posts\/1022"}],"collection":[{"href":"https:\/\/enisnecipoglu.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/enisnecipoglu.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/enisnecipoglu.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/enisnecipoglu.com\/en\/wp-json\/wp\/v2\/comments?post=1022"}],"version-history":[{"count":9,"href":"https:\/\/enisnecipoglu.com\/en\/wp-json\/wp\/v2\/posts\/1022\/revisions"}],"predecessor-version":[{"id":1033,"href":"https:\/\/enisnecipoglu.com\/en\/wp-json\/wp\/v2\/posts\/1022\/revisions\/1033"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/enisnecipoglu.com\/en\/wp-json\/wp\/v2\/media\/1034"}],"wp:attachment":[{"href":"https:\/\/enisnecipoglu.com\/en\/wp-json\/wp\/v2\/media?parent=1022"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/enisnecipoglu.com\/en\/wp-json\/wp\/v2\/categories?post=1022"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/enisnecipoglu.com\/en\/wp-json\/wp\/v2\/tags?post=1022"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}