diff options
Diffstat (limited to 'Xamarin.Forms.Core/DatePicker.cs')
-rw-r--r-- | Xamarin.Forms.Core/DatePicker.cs | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Xamarin.Forms.Core/DatePicker.cs b/Xamarin.Forms.Core/DatePicker.cs index 20eecae4..9ef7a7eb 100644 --- a/Xamarin.Forms.Core/DatePicker.cs +++ b/Xamarin.Forms.Core/DatePicker.cs @@ -4,7 +4,7 @@ using Xamarin.Forms.Platform; namespace Xamarin.Forms { [RenderWith(typeof(_DatePickerRenderer))] - public class DatePicker : View + public class DatePicker : View, IElementConfiguration<DatePicker> { public static readonly BindableProperty FormatProperty = BindableProperty.Create(nameof(Format), typeof(string), typeof(DatePicker), "d"); @@ -19,6 +19,13 @@ namespace Xamarin.Forms public static readonly BindableProperty TextColorProperty = BindableProperty.Create(nameof(TextColor), typeof(Color), typeof(DatePicker), Color.Default); + readonly Lazy<PlatformConfigurationRegistry<DatePicker>> _platformConfigurationRegistry; + + public DatePicker() + { + _platformConfigurationRegistry = new Lazy<PlatformConfigurationRegistry<DatePicker>>(() => new PlatformConfigurationRegistry<DatePicker>(this)); + } + public DateTime Date { get { return (DateTime)GetValue(DateProperty); } @@ -103,5 +110,10 @@ namespace Xamarin.Forms { return (DateTime)value <= ((DatePicker)bindable).MaximumDate; } + + public IPlatformElementConfiguration<T, DatePicker> On<T>() where T : IConfigPlatform + { + return _platformConfigurationRegistry.Value.On<T>(); + } } }
\ No newline at end of file |