diff options
author | Seunghyun Choi <sh4682.choi@samsung.com> | 2016-12-21 18:11:54 +0900 |
---|---|---|
committer | Kangho Hur <kangho.hur@samsung.com> | 2017-07-10 11:11:16 +0900 |
commit | b1401b312d784490474d60fae4bbc59edd35fa79 (patch) | |
tree | 5703078b958d67cfa1a41ac9b4882094da791be8 /Xamarin.Forms.Platform.Tizen/Renderers | |
parent | dec707f392d886c891cd7dcde64eafdfec036cd7 (diff) | |
download | xamarin-forms-b1401b312d784490474d60fae4bbc59edd35fa79.tar.gz xamarin-forms-b1401b312d784490474d60fae4bbc59edd35fa79.tar.bz2 xamarin-forms-b1401b312d784490474d60fae4bbc59edd35fa79.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')
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/Renderers/ButtonRenderer.cs | 34 |
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 |