summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs
diff options
context:
space:
mode:
authorSeunghyun Choi <sh4682.choi@samsung.com>2016-12-21 18:11:54 +0900
committerKangho Hur <kangho.hur@samsung.com>2017-04-24 13:36:47 +0900
commitef513157b7aac84c59a3184fc45146aa7c9a0b35 (patch)
tree275aeec8c8790b20717555d6c478e2f0a9c7f67f /Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs
parentc47d7439267e1c515a0b5097e9e2299f5cfb4fc9 (diff)
downloadxamarin-forms-ef513157b7aac84c59a3184fc45146aa7c9a0b35.tar.gz
xamarin-forms-ef513157b7aac84c59a3184fc45146aa7c9a0b35.tar.bz2
xamarin-forms-ef513157b7aac84c59a3184fc45146aa7c9a0b35.zip
Add Button Style
- Add Button Style(Circle, Bottom) - Approval of the RFC is required. (http://suprem.sec.samsung.net/confluence/display/SPTDTLC/%5BFormsTizen%5D+RFC+2+-+Button+Style) Change-Id: I545e0cc2417298f90468b651030937665f547105 Signed-off-by: Seunghyun Choi <sh4682.choi@samsung.com>
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs')
-rw-r--r--Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs34
1 files changed, 34 insertions, 0 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs
index a34df549..8af7bb69 100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs
@@ -1,5 +1,8 @@
using System;
+using System.ComponentModel;
using EColor = ElmSharp.Color;
+using Xamarin.Forms.PlatformConfiguration.TizenSpecific;
+using Specific = Xamarin.Forms.PlatformConfiguration.TizenSpecific.Button;
namespace Xamarin.Forms.Platform.Tizen
{
@@ -38,12 +41,23 @@ namespace Xamarin.Forms.Platform.Tizen
if (e.NewElement != null)
{
+ UpdateStyle();
Control.Clicked += ButtonClickedHandler;
}
base.OnElementChanged(e);
}
+ protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
+ {
+ base.OnElementPropertyChanged(sender, e);
+
+ if (e.PropertyName == Specific.ButtonStyleProperty.PropertyName)
+ {
+ UpdateStyle();
+ }
+ }
+
protected override Size MinimumSize()
{
return new Size(Control.MinimumWidth, Control.MinimumHeight);
@@ -84,6 +98,26 @@ namespace Xamarin.Forms.Platform.Tizen
}
}
+ void UpdateStyle()
+ {
+ string style;
+ switch (Specific.GetButtonStyle(Element))
+ {
+ case ButtonStyle.Circle:
+ style = "circle";
+ break;
+ case ButtonStyle.Bottom:
+ style = "bottom";
+ break;
+ default:
+ style = "default";
+ break;
+ }
+
+ Control.UpdateStyle(style);
+ ((IVisualElementController)Element).NativeSizeChanged();
+ }
+
void UpdateBorder()
{
/* The simpler way is to create some specialized theme for button in