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-24 04:19:03 (GMT)
commitbba54b857862f87fe2633dd386482465053d9edb (patch)
tree410c63bdf9691cdd92fdcab644b365d74e10cf1b
parent1644ebc5ff66520275083eca459f506a1fd26efb (diff)
downloadxamarin-forms-bba54b857862f87fe2633dd386482465053d9edb.zip
xamarin-forms-bba54b857862f87fe2633dd386482465053d9edb.tar.gz
xamarin-forms-bba54b857862f87fe2633dd386482465053d9edb.tar.bz2
Fix PickerRender bug
- 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;