Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add event completed #34

Merged
merged 2 commits into from
Jun 12, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 16 additions & 5 deletions src/SuaveControls.MaterialForms/MaterialEntry.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ public partial class MaterialEntry : ContentView
var matEntry = (MaterialEntry)bindable;
matEntry.HiddenLabel.FontSize = (double)newVal;
});
public static BindableProperty CompletedProperty = BindableProperty.Create(nameof(Completed), typeof(EventHandler), typeof(MaterialEntry), propertyChanged: (bindable, oldValue, newValue) =>
{
var matEntry = (MaterialEntry)bindable;
matEntry.Completed = (EventHandler)newValue;
});
#endregion

#region Public Properties
Expand Down Expand Up @@ -202,7 +207,7 @@ public string Text
}
set
{
SetValue(TextProperty, value);
SetValue(TextProperty, value);
}
}
public string Placeholder
Expand All @@ -217,7 +222,13 @@ public string Placeholder
}
}

#endregion
public EventHandler Completed
{
get => null;
set => EntryField.Completed += value;
}

#endregion

public MaterialEntry()
{
Expand Down Expand Up @@ -257,7 +268,7 @@ public MaterialEntry()
/// <returns>The layout unfocused.</returns>
private async Task CalculateLayoutUnfocused()
{
if(IsValid)
if (IsValid)
{
HiddenLabel.TextColor = DefaultColor;
BottomBorder.BackgroundColor = DefaultColor;
Expand Down Expand Up @@ -308,12 +319,12 @@ private async Task CalculateLayoutFocused()
/// </summary>
private void UpdateValidation()
{
if(IsValid)
if (IsValid)
{

BottomBorder.BackgroundColor = DefaultColor;
HiddenBottomBorder.BackgroundColor = AccentColor;
if(IsFocused)
if (IsFocused)
{
HiddenLabel.TextColor = AccentColor;
}
Expand Down