summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Tizen
diff options
context:
space:
mode:
authorKangho Hur <kangho.hur@samsung.com>2017-03-17 15:20:29 +0900
committerKangho Hur <kangho.hur@samsung.com>2017-03-24 13:19:03 +0900
commitbba54b857862f87fe2633dd386482465053d9edb (patch)
tree410c63bdf9691cdd92fdcab644b365d74e10cf1b /Xamarin.Forms.Platform.Tizen
parent1644ebc5ff66520275083eca459f506a1fd26efb (diff)
downloadxamarin-forms-bba54b857862f87fe2633dd386482465053d9edb.tar.gz
xamarin-forms-bba54b857862f87fe2633dd386482465053d9edb.tar.bz2
xamarin-forms-bba54b857862f87fe2633dd386482465053d9edb.zip
Fix PickerRender bug
- Picker.TextColor is now available Change-Id: Idb005c09834672301ec5b465413c9fc1aed79d81
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen')
-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 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;