summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Controls
diff options
context:
space:
mode:
authorE.Z. Hart <hartez@users.noreply.github.com>2016-04-19 07:01:58 (GMT)
committerJason Smith <jason.smith@xamarin.com>2016-04-19 07:01:58 (GMT)
commita98f3fb2aae3c5b6a3fa5140e51f51ec67843a49 (patch)
tree654fa47cbd3cc889061466939630dcd5133cc837 /Xamarin.Forms.Controls
parent89a50d4bc1f4aaf83d5f92a28c2a7a96282cc0d3 (diff)
downloadxamarin-forms-a98f3fb2aae3c5b6a3fa5140e51f51ec67843a49.zip
xamarin-forms-a98f3fb2aae3c5b6a3fa5140e51f51ec67843a49.tar.gz
xamarin-forms-a98f3fb2aae3c5b6a3fa5140e51f51ec67843a49.tar.bz2
Add TextColor Property to Picker, TimePicker, DatePicker (#84)
* Add TextColor property to TimePicker Add TextColor page to TimePicker gallery Add TimePicker color toggling to color toggle test page Split color toggle tests up among tabs * Implement TimePicker.TextColor in iOS * Implement TimePicker.TextColor for WinRT tablet * Add IsEnabled=false tests to DefaultColorToggleTest Button and TimePicker Consolidate ColorStates array Fix IsEnabled changing color bug on iOS * Implement TimePicker.TextColor for WP8 * Add TextColor property to DatePicker Add DatePicker section to DefaultColorToggleTest Impement DatePicker.TextColor for WP8 * Implement DatePicker.TextColor for WinRT/UWP/Windows Phone 8.1 * Implement DatePicker.TextColor for iOS * Add TextColor to DatePicker Gallery Page * Implement DatePicker.TextColor for Android * Add Picker Gallery page for TextColor Implement Picker.TextColor on Android Consolidate TextColor management for Button, Picker, DatePicker, TimePicker Implement * Add untracked TextColorSwitcher Implement Picker.TextColor in iOS * Implement Picker.TextColor in WinRT/UWP/Windows Phone 8.1 Remove Pioker Loaded handlers in Dispose * Implement Picker.TextColor in WP8 * Removed unused field Update ignored warnings * Update docs * Use nameof() for BindableProperties * Cleanup * Fix custom renderer crashes for classes using TextColorSwitcher * Correct property name references * Fix typo and 'if' formatting * Add missing else
Diffstat (limited to 'Xamarin.Forms.Controls')
-rw-r--r--Xamarin.Forms.Controls/CoreGalleryPages/DatePickerCoreGalleryPage.cs40
-rw-r--r--Xamarin.Forms.Controls/CoreGalleryPages/PickerCoreGalleryPage.cs40
-rw-r--r--Xamarin.Forms.Controls/CoreGalleryPages/TimePickerCoreGalleryPage.cs22
3 files changed, 53 insertions, 49 deletions
diff --git a/Xamarin.Forms.Controls/CoreGalleryPages/DatePickerCoreGalleryPage.cs b/Xamarin.Forms.Controls/CoreGalleryPages/DatePickerCoreGalleryPage.cs
index 1dbb9bb..7cd0f11 100644
--- a/Xamarin.Forms.Controls/CoreGalleryPages/DatePickerCoreGalleryPage.cs
+++ b/Xamarin.Forms.Controls/CoreGalleryPages/DatePickerCoreGalleryPage.cs
@@ -1,34 +1,36 @@
using System;
-
using Xamarin.Forms.CustomAttributes;
namespace Xamarin.Forms.Controls
{
internal class DatePickerCoreGalleryPage : CoreGalleryPage<DatePicker>
{
- protected override bool SupportsTapGestureRecognizer
- {
- get { return false; }
- }
+ protected override bool SupportsTapGestureRecognizer => false;
- protected override void Build (StackLayout stackLayout)
+ protected override void Build(StackLayout stackLayout)
{
- base.Build (stackLayout);
+ base.Build(stackLayout);
+
+ var dateContainer = new ViewContainer<DatePicker>(Test.DatePicker.Date,
+ new DatePicker { Date = new DateTime(1987, 9, 13) });
- var dateContainer = new ViewContainer<DatePicker> (Test.DatePicker.Date, new DatePicker { Date = new DateTime (1987, 9, 13) });
+ var dateSelectedContainer = new EventViewContainer<DatePicker>(Test.DatePicker.DateSelected, new DatePicker());
+ dateSelectedContainer.View.DateSelected += (sender, args) => dateSelectedContainer.EventFired();
- var dateSelectedContainer = new EventViewContainer<DatePicker> (Test.DatePicker.DateSelected, new DatePicker ());
- dateSelectedContainer.View.DateSelected += (sender, args) => dateSelectedContainer.EventFired ();
+ var formatDateContainer = new ViewContainer<DatePicker>(Test.DatePicker.Format, new DatePicker { Format = "ddd" });
+ var minimumDateContainer = new ViewContainer<DatePicker>(Test.DatePicker.MinimumDate,
+ new DatePicker { MinimumDate = new DateTime(1987, 9, 13) });
+ var maximumDateContainer = new ViewContainer<DatePicker>(Test.DatePicker.MaximumDate,
+ new DatePicker { MaximumDate = new DateTime(2087, 9, 13) });
+ var textColorContainer = new ViewContainer<DatePicker>(Test.DatePicker.TextColor,
+ new DatePicker { Date = new DateTime(1978, 12, 24), TextColor = Color.Lime });
- var formatDateContainer = new ViewContainer<DatePicker> (Test.DatePicker.Format, new DatePicker { Format = "ddd" });
- var minimumDateContainer = new ViewContainer<DatePicker> (Test.DatePicker.MinimumDate, new DatePicker { MinimumDate = new DateTime (1987, 9, 13) });
- var maximumDateContainer = new ViewContainer<DatePicker> (Test.DatePicker.MaximumDate, new DatePicker { MaximumDate = new DateTime (2087, 9, 13) });
-
- Add (dateContainer);
- Add (dateSelectedContainer);
- Add (formatDateContainer);
- Add (minimumDateContainer);
- Add (maximumDateContainer);
+ Add(dateContainer);
+ Add(dateSelectedContainer);
+ Add(formatDateContainer);
+ Add(minimumDateContainer);
+ Add(maximumDateContainer);
+ Add(textColorContainer);
}
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Controls/CoreGalleryPages/PickerCoreGalleryPage.cs b/Xamarin.Forms.Controls/CoreGalleryPages/PickerCoreGalleryPage.cs
index cea755d..323b607 100644
--- a/Xamarin.Forms.Controls/CoreGalleryPages/PickerCoreGalleryPage.cs
+++ b/Xamarin.Forms.Controls/CoreGalleryPages/PickerCoreGalleryPage.cs
@@ -4,32 +4,34 @@ namespace Xamarin.Forms.Controls
{
internal class PickerCoreGalleryPage : CoreGalleryPage<Picker>
{
- // TODO
- protected override bool SupportsTapGestureRecognizer
- {
- get { return false; }
- }
+ protected override bool SupportsTapGestureRecognizer => false;
- protected override void Build (StackLayout stackLayout)
+ protected override void Build(StackLayout stackLayout)
{
- base.Build (stackLayout);
- var itemsContainer = new ViewContainer<Picker> (Test.Picker.Items, new Picker ());
- itemsContainer.View.Items.Add ("Item 1");
- itemsContainer.View.Items.Add ("Item 2");
- itemsContainer.View.Items.Add ("Item 3");
+ base.Build(stackLayout);
+ var itemsContainer = new ViewContainer<Picker>(Test.Picker.Items, new Picker());
+ itemsContainer.View.Items.Add("Item 1");
+ itemsContainer.View.Items.Add("Item 2");
+ itemsContainer.View.Items.Add("Item 3");
- var selectedIndexContainer = new ViewContainer<Picker> (Test.Picker.SelectedIndex, new Picker ());
- selectedIndexContainer.View.Items.Add ("Item 1");
- selectedIndexContainer.View.Items.Add ("Item 2");
- selectedIndexContainer.View.Items.Add ("Item 3");
+ var selectedIndexContainer = new ViewContainer<Picker>(Test.Picker.SelectedIndex, new Picker());
+ selectedIndexContainer.View.Items.Add("Item 1");
+ selectedIndexContainer.View.Items.Add("Item 2");
+ selectedIndexContainer.View.Items.Add("Item 3");
selectedIndexContainer.View.SelectedIndex = 2;
- var titleContainer = new ViewContainer<Picker> (Test.Picker.Title, new Picker ());
+ var titleContainer = new ViewContainer<Picker>(Test.Picker.Title, new Picker());
titleContainer.View.Title = "Title";
- Add (itemsContainer);
- Add (selectedIndexContainer);
- Add (titleContainer);
+ var textColorContainer = new ViewContainer<Picker>(Test.Picker.TextColor, new Picker());
+ textColorContainer.View.Items.Add("Item 1");
+ textColorContainer.View.Items.Add("Item 2");
+ textColorContainer.View.Items.Add("Item 3");
+
+ Add(itemsContainer);
+ Add(selectedIndexContainer);
+ Add(titleContainer);
+ Add(textColorContainer);
}
}
} \ No newline at end of file
diff --git a/Xamarin.Forms.Controls/CoreGalleryPages/TimePickerCoreGalleryPage.cs b/Xamarin.Forms.Controls/CoreGalleryPages/TimePickerCoreGalleryPage.cs
index bf8b9c9..a6a94eb 100644
--- a/Xamarin.Forms.Controls/CoreGalleryPages/TimePickerCoreGalleryPage.cs
+++ b/Xamarin.Forms.Controls/CoreGalleryPages/TimePickerCoreGalleryPage.cs
@@ -1,24 +1,24 @@
using System;
-
using Xamarin.Forms.CustomAttributes;
namespace Xamarin.Forms.Controls
{
internal class TimePickerCoreGalleryPage : CoreGalleryPage<TimePicker>
{
- protected override bool SupportsTapGestureRecognizer
- {
- get { return false; }
- }
+ protected override bool SupportsTapGestureRecognizer => false;
- protected override void Build (StackLayout stackLayout)
+ protected override void Build(StackLayout stackLayout)
{
- base.Build (stackLayout);
- var formatContainer = new ViewContainer<TimePicker> (Test.TimePicker.Format, new TimePicker { Format = "HH-mm-ss" });
- var timeContainer = new ViewContainer<TimePicker> (Test.TimePicker.Time, new TimePicker { Time = new TimeSpan (14, 45, 50) });
+ base.Build(stackLayout);
+ var formatContainer = new ViewContainer<TimePicker>(Test.TimePicker.Format, new TimePicker { Format = "HH-mm-ss" });
+ var timeContainer = new ViewContainer<TimePicker>(Test.TimePicker.Time,
+ new TimePicker { Time = new TimeSpan(14, 45, 50) });
+ var textColorContainer = new ViewContainer<TimePicker>(Test.TimePicker.TextColor,
+ new TimePicker { Time = new TimeSpan(14, 45, 50), TextColor = Color.Lime });
- Add (formatContainer);
- Add (timeContainer);
+ Add(formatContainer);
+ Add(timeContainer);
+ Add(textColorContainer);
}
}
} \ No newline at end of file