Skip to content

Commit f4541d3

Browse files
renamed
1 parent 2d90ec1 commit f4541d3

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

LoginForm/LoginForm/Behavior/LoginFormBehavior.cs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,7 @@ protected override void OnAttachedTo(ContentPage bindable)
2626
{
2727
base.OnAttachedTo(bindable);
2828
this.dataForm = bindable.FindByName<SfDataForm>("loginForm");
29-
if (dataForm != null)
30-
{
31-
this.dataForm.GenerateDataFormItem += this.OnGenerateDataFormItem;
32-
}
29+
this.dataForm.GenerateDataFormItem += this.OnGenerateDataFormItem;
3330

3431
this.loginButton = bindable.FindByName<Button>("loginButton");
3532

@@ -46,7 +43,7 @@ protected override void OnAttachedTo(ContentPage bindable)
4643
/// <param name="e">The event arguments.</param>
4744
private void OnGenerateDataFormItem(object sender, GenerateDataFormItemEventArgs e)
4845
{
49-
if (e.DataFormItem != null && e.DataFormItem.FieldName == nameof(LoginFormModel.UserName) && e.DataFormItem is DataFormTextEditorItem textItem)
46+
if (e.DataFormItem != null && e.DataFormItem.FieldName == nameof(LoginFormModel.Email) && e.DataFormItem is DataFormTextEditorItem textItem)
5047
{
5148
textItem.Keyboard = Keyboard.Email;
5249
}
@@ -59,9 +56,9 @@ private void OnGenerateDataFormItem(object sender, GenerateDataFormItemEventArgs
5956
/// <param name="e">The event arguments.</param>
6057
private async void OnLoginButtonCliked(object sender, EventArgs e)
6158
{
62-
if(this.dataForm != null && App.Current?.MainPage != null)
59+
if (this.dataForm != null && App.Current?.MainPage != null)
6360
{
64-
if(this.dataForm.Validate())
61+
if (this.dataForm.Validate())
6562
{
6663
await App.Current.MainPage.DisplayAlert("", "Signed in successfully", "OK");
6764
}
@@ -77,7 +74,7 @@ protected override void OnDetachingFrom(ContentPage bindable)
7774
base.OnDetachingFrom(bindable);
7875
if (this.loginButton != null)
7976
{
80-
this.loginButton.Clicked -= OnLoginButtonCliked;
77+
this.loginButton.Clicked -= OnLoginButtonCliked;
8178
}
8279

8380
if (this.dataForm != null)

LoginForm/LoginForm/Model/LoginFormModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ public class LoginFormModel
1212
{
1313
[Display(Prompt = "example@mail.com", Name = "Email")]
1414
[EmailAddress(ErrorMessage = "Enter your email - example@mail.com")]
15-
public string UserName { get; set; }
15+
public string Email { get; set; }
1616

1717
[Display(Name = "Password")]
1818
[DataType(DataType.Password)]

0 commit comments

Comments
 (0)