diff options
author | Kangho Hur <kangho.hur@samsung.com> | 2017-01-05 18:29:56 -0800 |
---|---|---|
committer | Gerrit Code Review <gerrit@review.vlan103.tizen.org> | 2017-01-05 18:29:56 -0800 |
commit | b729a649523c1acba03a4fccd30fac93d5f7b77e (patch) | |
tree | 33f10bd511da18508b96186ef93ff6fbcfdc78a8 /Xamarin.Forms.Platform.Tizen/Renderers/ProgressBarRenderer.cs | |
parent | abb567525413d1d7fa3850f08f530b70a1f77063 (diff) | |
parent | bc0f025f08dcb3bac810aa0348546c445046f0c9 (diff) | |
download | xamarin-forms-b729a649523c1acba03a4fccd30fac93d5f7b77e.tar.gz xamarin-forms-b729a649523c1acba03a4fccd30fac93d5f7b77e.tar.bz2 xamarin-forms-b729a649523c1acba03a4fccd30fac93d5f7b77e.zip |
Merge "Tizen Extension for ProgressBar" into tizen
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/Renderers/ProgressBarRenderer.cs')
-rw-r--r-- | Xamarin.Forms.Platform.Tizen/Renderers/ProgressBarRenderer.cs | 46 |
1 files changed, 42 insertions, 4 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/ProgressBarRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/ProgressBarRenderer.cs index 3aacd3f4..6bf86b16 100644 --- a/Xamarin.Forms.Platform.Tizen/Renderers/ProgressBarRenderer.cs +++ b/Xamarin.Forms.Platform.Tizen/Renderers/ProgressBarRenderer.cs @@ -1,4 +1,6 @@ using System.ComponentModel; + +using Specific = Xamarin.Forms.PlatformConfiguration.TizenSpecific.ProgressBar; using EProgressBar = ElmSharp.ProgressBar; namespace Xamarin.Forms.Platform.Tizen @@ -37,9 +39,28 @@ namespace Xamarin.Forms.Platform.Tizen base.OnElementChanged(e); } + protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) + { + base.OnElementPropertyChanged(sender, e); + if (e.PropertyName == ProgressBar.ProgressProperty.PropertyName) + { + UpdateProgress(); + } + else if (e.PropertyName == Specific.ProgressBarPendingModeProperty.PropertyName) + { + UpdatePendingMode(); + } + else if (e.PropertyName == Specific.ProgressBarPulsingStatusProperty.PropertyName) + { + UpdatePulsingStatus(); + } + } + void UpdateAll() { UpdateProgress(); + UpdatePendingMode(); + UpdatePulsingStatus(); } void UpdateProgress() @@ -47,12 +68,29 @@ namespace Xamarin.Forms.Platform.Tizen Control.Value = Element.Progress; } - protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e) + void UpdatePendingMode() { - base.OnElementPropertyChanged(sender, e); - if (e.PropertyName == ProgressBar.ProgressProperty.PropertyName) + bool isPending = Specific.GetPendingMode(Element); + if (isPending) { - UpdateProgress(); + Control.Style = "pending"; + } + else + { + Control.Style = "default"; + } + } + + void UpdatePulsingStatus() + { + bool isPulsing = Specific.GetPulsingStatus(Element); + if (isPulsing) + { + Control.PlayPulse(); + } + else + { + Control.StopPulse(); } } } |