summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core/Picker.cs
diff options
context:
space:
mode:
authorE.Z. Hart <hartez@users.noreply.github.com>2016-04-19 01:01:58 -0600
committerJason Smith <jason.smith@xamarin.com>2016-04-19 00:01:58 -0700
commita98f3fb2aae3c5b6a3fa5140e51f51ec67843a49 (patch)
tree654fa47cbd3cc889061466939630dcd5133cc837 /Xamarin.Forms.Core/Picker.cs
parent89a50d4bc1f4aaf83d5f92a28c2a7a96282cc0d3 (diff)
downloadxamarin-forms-a98f3fb2aae3c5b6a3fa5140e51f51ec67843a49.tar.gz
xamarin-forms-a98f3fb2aae3c5b6a3fa5140e51f51ec67843a49.tar.bz2
xamarin-forms-a98f3fb2aae3c5b6a3fa5140e51f51ec67843a49.zip
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.Core/Picker.cs')
-rw-r--r--Xamarin.Forms.Core/Picker.cs12
1 files changed, 10 insertions, 2 deletions
diff --git a/Xamarin.Forms.Core/Picker.cs b/Xamarin.Forms.Core/Picker.cs
index 733f2079..5c2fb72b 100644
--- a/Xamarin.Forms.Core/Picker.cs
+++ b/Xamarin.Forms.Core/Picker.cs
@@ -8,9 +8,11 @@ namespace Xamarin.Forms
[RenderWith(typeof(_PickerRenderer))]
public class Picker : View
{
- public static readonly BindableProperty TitleProperty = BindableProperty.Create("Title", typeof(string), typeof(Picker), default(string));
+ public static readonly BindableProperty TextColorProperty = BindableProperty.Create(nameof(TextColor), typeof(Color), typeof(Picker), Color.Default);
- public static readonly BindableProperty SelectedIndexProperty = BindableProperty.Create("SelectedIndex", typeof(int), typeof(Picker), -1, BindingMode.TwoWay,
+ public static readonly BindableProperty TitleProperty = BindableProperty.Create(nameof(Title), typeof(string), typeof(Picker), default(string));
+
+ public static readonly BindableProperty SelectedIndexProperty = BindableProperty.Create(nameof(SelectedIndex), typeof(int), typeof(Picker), -1, BindingMode.TwoWay,
propertyChanged: (bindable, oldvalue, newvalue) =>
{
EventHandler eh = ((Picker)bindable).SelectedIndexChanged;
@@ -32,6 +34,12 @@ namespace Xamarin.Forms
set { SetValue(SelectedIndexProperty, value); }
}
+ public Color TextColor
+ {
+ get { return (Color)GetValue(TextColorProperty); }
+ set { SetValue(TextColorProperty, value); }
+ }
+
public string Title
{
get { return (string)GetValue(TitleProperty); }