summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core
diff options
context:
space:
mode:
authorStephane Delcroix <stephane@delcroix.org>2017-06-01 07:33:38 (GMT)
committerGitHub <noreply@github.com>2017-06-01 07:33:38 (GMT)
commit5adab7fe4e2024c7e9ab55f612f9c971e72eef9f (patch)
tree5d33f6a6aabd5b39784ff430b2356ed0e5e2c08b /Xamarin.Forms.Core
parent6e732fbe746a3d69bb48c70e3ec3d1d6e30b665e (diff)
downloadxamarin-forms-5adab7fe4e2024c7e9ab55f612f9c971e72eef9f.zip
xamarin-forms-5adab7fe4e2024c7e9ab55f612f9c971e72eef9f.tar.gz
xamarin-forms-5adab7fe4e2024c7e9ab55f612f9c971e72eef9f.tar.bz2
[C] use picker creation date as default Date (#944)
* [C] use picker creation date as default Date * fix test
Diffstat (limited to 'Xamarin.Forms.Core')
-rw-r--r--Xamarin.Forms.Core/DatePicker.cs6
1 files changed, 4 insertions, 2 deletions
diff --git a/Xamarin.Forms.Core/DatePicker.cs b/Xamarin.Forms.Core/DatePicker.cs
index ed16a87..4e46663 100644
--- a/Xamarin.Forms.Core/DatePicker.cs
+++ b/Xamarin.Forms.Core/DatePicker.cs
@@ -8,8 +8,10 @@ namespace Xamarin.Forms
{
public static readonly BindableProperty FormatProperty = BindableProperty.Create(nameof(Format), typeof(string), typeof(DatePicker), "d");
- public static readonly BindableProperty DateProperty = BindableProperty.Create(nameof(Date), typeof(DateTime), typeof(DatePicker), DateTime.Today, BindingMode.TwoWay, coerceValue: CoerceDate,
- propertyChanged: DatePropertyChanged);
+ public static readonly BindableProperty DateProperty = BindableProperty.Create(nameof(Date), typeof(DateTime), typeof(DatePicker), default(DateTime), BindingMode.TwoWay,
+ coerceValue: CoerceDate,
+ propertyChanged: DatePropertyChanged,
+ defaultValueCreator: (bindable) => DateTime.Today);
public static readonly BindableProperty MinimumDateProperty = BindableProperty.Create(nameof(MinimumDate), typeof(DateTime), typeof(DatePicker), new DateTime(1900, 1, 1),
validateValue: ValidateMinimumDate, coerceValue: CoerceMinimumDate);