diff options
author | Kangho Hur <kangho.hur@samsung.com> | 2017-03-17 15:20:29 +0900 |
---|---|---|
committer | Kangho Hur <kangho.hur@samsung.com> | 2017-04-24 13:36:56 +0900 |
commit | f7f2b41c84418db359aa1a11e9c008acf88743ac (patch) | |
tree | ed25b6396896d976b8b64014376631c3dddfb2e1 | |
parent | 7d1038c5db398687d4d273fbfd67a41877977b7e (diff) | |
download | xamarin-forms-f7f2b41c84418db359aa1a11e9c008acf88743ac.tar.gz xamarin-forms-f7f2b41c84418db359aa1a11e9c008acf88743ac.tar.bz2 xamarin-forms-f7f2b41c84418db359aa1a11e9c008acf88743ac.zip |
Fix PickerRender bug
- Picker.TextColor is now available
Change-Id: Idb005c09834672301ec5b465413c9fc1aed79d81
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/Renderers/PickerRenderer.cs | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/PickerRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/PickerRenderer.cs index 4508ccf1..6080d647 100644 --- a/Xamarin.Forms.Platform.Tizen/Renderers/PickerRenderer.cs +++ b/Xamarin.Forms.Platform.Tizen/Renderers/PickerRenderer.cs @@ -1,13 +1,14 @@ -using System; +using System; using System.ComponentModel; using System.Collections.Generic; using ElmSharp; -using EButton = ElmSharp.Button; +using EColor = ElmSharp.Color; namespace Xamarin.Forms.Platform.Tizen { - public class PickerRenderer : ViewRenderer<Picker, EButton> + public class PickerRenderer : ViewRenderer<Picker, Native.Button> { + static readonly EColor s_defaultTextColor = EColor.White; internal List _list; internal Native.Dialog _dialog; Dictionary<ListItem, int> _itemToItemNumber = new Dictionary<ListItem, int>(); @@ -20,7 +21,7 @@ namespace Xamarin.Forms.Platform.Tizen { if (Control == null) { - var button = new EButton(Forms.Context.MainWindow); + var button = new Native.Button(Forms.Context.MainWindow); SetNativeControl (button); } @@ -32,7 +33,7 @@ namespace Xamarin.Forms.Platform.Tizen if (e.NewElement != null) { UpdateSelectedIndex(); - + UpdateTextColor(); Control.Clicked += OnClick; } @@ -47,6 +48,10 @@ namespace Xamarin.Forms.Platform.Tizen { UpdateSelectedIndex(); } + else if (e.PropertyName == Picker.TextColorProperty.PropertyName) + { + UpdateTextColor(); + } } void UpdateSelectedIndex() @@ -55,6 +60,11 @@ namespace Xamarin.Forms.Platform.Tizen "" : Element.Items[Element.SelectedIndex]); } + void UpdateTextColor() + { + Control.TextColor = Element.TextColor.IsDefault ? s_defaultTextColor : Element.TextColor.ToNative(); + } + void OnClick(object sender, EventArgs e) { int i = 0; |