Fix xbuild error to BackgroundRenderer 35/120535/1
authorsung-su.kim <sung-su.kim@samsung.com>
Thu, 23 Mar 2017 07:21:48 +0000 (16:21 +0900)
committersung-su.kim <sung-su.kim@samsung.com>
Thu, 23 Mar 2017 07:21:48 +0000 (16:21 +0900)
Change-Id: I28de2e186946c1b723df42c212178723c5ae402b

Tizen.Xamarin.Forms.Extension.Renderer/RadioButtonRenderer.cs [changed mode: 0755->0644]

old mode 100755 (executable)
new mode 100644 (file)
index 27cf855..ff420fb
@@ -8,8 +8,10 @@ using Xamarin.Forms.Platform.Tizen.Native;
 using Tizen.Xamarin.Forms.Extension;
 using Tizen.Xamarin.Forms.Extension.Renderer;
 using TForms = Xamarin.Forms.Platform.Tizen.Forms;
+using XColor = Xamarin.Forms.Color;
 
 [assembly: ExportRenderer(typeof(RadioButton), typeof(RadioButtonRenderer))]
+
 namespace Tizen.Xamarin.Forms.Extension.Renderer
 {
     public class RadioButtonRenderer : ViewRenderer<RadioButton, Radio>
@@ -112,7 +114,7 @@ namespace Tizen.Xamarin.Forms.Extension.Renderer
 
         void UpdateTextColor()
         {
-            _span.ForegroundColor = Element.TextColor.ToNative();
+            _span.ForegroundColor = ConvertToNativeColor(Element.TextColor);
         }
 
         void UpdateFont()
@@ -175,6 +177,18 @@ namespace Tizen.Xamarin.Forms.Extension.Renderer
             }
             Control.EdjeObject.EmitSignal(emission, "elm");
         }
+
+        public Color ConvertToNativeColor(XColor c)
+        {
+            if (c == XColor.Default)
+            {
+                return Color.Default;
+            }
+            else
+            {
+                return new Color((int)(255.0 * c.R), (int)(255.0 * c.G), (int)(255.0 * c.B), (int)(255.0 * c.A));
+            }
+        }
     }
 
     internal class RadioGroupManager
@@ -238,4 +252,4 @@ namespace Tizen.Xamarin.Forms.Extension.Renderer
             }
         }
     }
-}
+}
\ No newline at end of file