Skip to content

Instantly share code, notes, and snippets.

@mmierzwa
Last active July 10, 2017 10:01
Show Gist options
  • Save mmierzwa/618358f58ec200ee689b2626963d9c32 to your computer and use it in GitHub Desktop.
Save mmierzwa/618358f58ec200ee689b2626963d9c32 to your computer and use it in GitHub Desktop.
Placeholder text in Xamarin.Forms Editor
using Xamarin.Forms;
namespace EditorWithPlaceholder
{
public class PlaceholderEditor : Editor
{
public static BindableProperty PlaceholderProperty
= BindableProperty.Create(nameof(Placeholder), typeof(string), typeof(PlaceholderEditor));
public static BindableProperty PlaceholderColorProperty
= BindableProperty.Create(nameof(PlaceholderColor), typeof(Color), typeof(PlaceholderEditor), Color.Gray);
public string Placeholder
{
get { return (string) GetValue(PlaceholderProperty); }
set { SetValue(PlaceholderProperty, value); }
}
public Color PlaceholderColor
{
get { return (Color) GetValue(PlaceholderColorProperty); }
set { SetValue(PlaceholderColorProperty, value); }
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment