Fix xbuild error to BackgroundRenderer
[platform/core/csapi/xamarin-forms-extension.git] / Tizen.Xamarin.Forms.Extension.Renderer / RadioButtonRenderer.cs
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