Skip to content

Commit

Permalink
Merge branch 'Feature/31-AddFocusMethodToFloatingLabelControl' into d…
Browse files Browse the repository at this point in the history
…evelop
  • Loading branch information
chrfalch committed Feb 12, 2017
2 parents 8ac87d7 + 744807c commit 4e3729a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
26 changes: 23 additions & 3 deletions NControl.Controls/NControl.Controls/FloatingLabelControl.cs
Expand Up @@ -129,8 +129,8 @@ public FloatingLabelControl ()
if(Focused != null)
Focused(this, e);
};
_textEntry.Unfocused += (object sender, FocusEventArgs e) =>

_textEntry.Unfocused += (object sender, FocusEventArgs e) =>
{
UpdatePlaceholderColor();
Expand Down Expand Up @@ -238,6 +238,26 @@ private void TextEntry_TextChanged (object sender, TextChangedEventArgs e)

#endregion

#region Public Members

/// <summary>
/// Focus this instance.
/// </summary>
public new void Focus()
{
_textEntry.Focus();
}

/// <summary>
/// Unfocus this instance.
/// </summary>
public new void Unfocus()
{
_textEntry.Unfocus();
}

#endregion

#region Properties
/// <summary>
/// The TextColor property.
Expand Down Expand Up @@ -592,7 +612,7 @@ public bool IsPassword
}
}

#endregion
#endregion

#region Private Members

Expand Down
Expand Up @@ -17,6 +17,7 @@ protected override void OnAppearing ()
var entry1 = new FloatingLabelControl{ Placeholder = "Email", Keyboard = Keyboard.Email };
entry1.SetBinding (FloatingLabelControl.TextProperty, "Title", BindingMode.TwoWay);
entry1.BindingContext = this;
entry1.Focus();

var entry2 = new FloatingLabelControl { Placeholder = "First name", Keyboard = Keyboard.Text };
var entry3 = new FloatingLabelControl { Placeholder = "Last name", Keyboard = Keyboard.Text };
Expand Down

0 comments on commit 4e3729a

Please sign in to comment.