summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/ProgressBar.cs
blob: 8267ca04364e51bdce59892a22d9d916b099f812 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65

namespace Xamarin.Forms.PlatformConfiguration.TizenSpecific
{
	using FormsElement = Forms.ProgressBar;

	public static class ProgressBar
	{
		public static readonly BindableProperty ProgressBarPendingModeProperty =
			BindableProperty.Create("ProgressBarPendingMode", typeof(bool),
			typeof(FormsElement), false);

		public static readonly BindableProperty ProgressBarPulsingStatusProperty =
			BindableProperty.Create("ProgressBarPulsingStatus", typeof(bool),
			typeof(FormsElement), false);

		public static bool GetPendingMode(BindableObject element)
		{
			return (bool)element.GetValue(ProgressBarPendingModeProperty);
		}

		public static void SetPendingMode(BindableObject element, bool isPending)
		{
			if (!isPending)
			{
				SetPulsingStatus(element, false);
			}
			element.SetValue(ProgressBarPendingModeProperty, isPending);
		}

		public static bool GetPulsingStatus(BindableObject element)
		{
			return (bool)element.GetValue(ProgressBarPulsingStatusProperty);
		}

		public static void SetPulsingStatus(BindableObject element, bool isPulsing)
		{
			if (GetPendingMode(element))
			{
				element.SetValue(ProgressBarPulsingStatusProperty, isPulsing);
			}
		}

		public static bool GetPendingMode(this IPlatformElementConfiguration<Tizen, FormsElement> config)
		{
			return GetPendingMode(config.Element);
		}

		public static IPlatformElementConfiguration<Tizen, FormsElement> SetPendingMode(this IPlatformElementConfiguration<Tizen, FormsElement> config, bool isPending)
		{
			SetPendingMode(config.Element, isPending);
			return config;
		}

		public static bool GetPulsingStatus(this IPlatformElementConfiguration<Tizen, FormsElement> config)
		{
			return GetPulsingStatus(config.Element);
		}

		public static IPlatformElementConfiguration<Tizen, FormsElement> SetPulsingStatus(this IPlatformElementConfiguration<Tizen, FormsElement> config, bool isPulsing)
		{
			SetPulsingStatus(config.Element, isPulsing);
			return config;
		}
	}
}