summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKangho Hur <kangho.hur@samsung.com>2017-03-17 06:20:29 (GMT)
committerKangho Hur <kangho.hur@samsung.com>2017-03-17 06:20:29 (GMT)
commit20b731f61ef7851d69c5e6499acd4f997b7a5843 (patch)
tree9b33cd18bfe99c71f1cf5861b498a923f108d4f1
parent00eee1b00aa05efa205639bf8f8a9c70363dae88 (diff)
downloadxamarin-forms-20b731f61ef7851d69c5e6499acd4f997b7a5843.zip
xamarin-forms-20b731f61ef7851d69c5e6499acd4f997b7a5843.tar.gz
xamarin-forms-20b731f61ef7851d69c5e6499acd4f997b7a5843.tar.bz2
Fix PickerRender bugrefs/changes/86/119486/1
- Picker.TextColor is now available Change-Id: Idb005c09834672301ec5b465413c9fc1aed79d81
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/PickerRenderer.cs20
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 4508ccf..6080d64 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;