summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Core
diff options
context:
space:
mode:
authorKangho Hur <kangho.hur@samsung.com>2017-02-08 14:54:28 +0900
committerKangho Hur <kangho.hur@samsung.com>2017-02-10 18:32:15 +0900
commit76744140ccdb02ba637c7909bcd2f03ddb546407 (patch)
treed8d03abd7eac34bc11ecea0aaa327c158a1aff46 /Xamarin.Forms.Core
parent92d363dd7d7a3bd23f31a0bbda936b00e9b4fd33 (diff)
downloadxamarin-forms-76744140ccdb02ba637c7909bcd2f03ddb546407.tar.gz
xamarin-forms-76744140ccdb02ba637c7909bcd2f03ddb546407.tar.bz2
xamarin-forms-76744140ccdb02ba637c7909bcd2f03ddb546407.zip
Add Style to VisualElement as TizenSpecific
- Implement the change proposed in RFC-17 Change-Id: I96431b3a32358be6f32e7acdeb0cbc6a27a98ec4
Diffstat (limited to 'Xamarin.Forms.Core')
-rw-r--r--Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/ButtonStyle.cs9
-rw-r--r--Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/ProgressBar.cs32
-rw-r--r--Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/StyleValues.cs22
-rw-r--r--Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/Switch.cs30
-rw-r--r--Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/SwitchStyle.cs9
-rw-r--r--Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/VisualElement.cs29
-rw-r--r--Xamarin.Forms.Core/Xamarin.Forms.Core.csproj7
7 files changed, 56 insertions, 82 deletions
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/ButtonStyle.cs b/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/ButtonStyle.cs
deleted file mode 100644
index abe7bd81..00000000
--- a/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/ButtonStyle.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-namespace Xamarin.Forms.PlatformConfiguration.TizenSpecific
-{
- public enum ButtonStyle
- {
- Default,
- Circle,
- Bottom
- }
-}
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/ProgressBar.cs b/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/ProgressBar.cs
index 8267ca04..3ed287d2 100644
--- a/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/ProgressBar.cs
+++ b/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/ProgressBar.cs
@@ -5,28 +5,10 @@ namespace Xamarin.Forms.PlatformConfiguration.TizenSpecific
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);
@@ -34,23 +16,13 @@ namespace Xamarin.Forms.PlatformConfiguration.TizenSpecific
public static void SetPulsingStatus(BindableObject element, bool isPulsing)
{
- if (GetPendingMode(element))
+ string style = VisualElement.GetStyle(element);
+ if (style == ProgressBarStyle.Pending)
{
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);
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/StyleValues.cs b/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/StyleValues.cs
new file mode 100644
index 00000000..d4e3c3ff
--- /dev/null
+++ b/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/StyleValues.cs
@@ -0,0 +1,22 @@
+namespace Xamarin.Forms.PlatformConfiguration.TizenSpecific
+{
+ public static class ButtonStyle
+ {
+ public const string Default = "default";
+ public const string Circle = "circle";
+ public const string Bottom = "bottom";
+ }
+
+ public static class SwitchStyle
+ {
+ public const string CheckBox = "default";
+ public const string Toggle = "toggle";
+ public const string Favorite = "favorite";
+ }
+
+ public static class ProgressBarStyle
+ {
+ public const string Default = "default";
+ public const string Pending = "pending";
+ }
+}
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/Switch.cs b/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/Switch.cs
deleted file mode 100644
index cef38f34..00000000
--- a/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/Switch.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-namespace Xamarin.Forms.PlatformConfiguration.TizenSpecific
-{
- using FormsElement = Forms.Switch;
-
- public static class Switch
- {
- public static readonly BindableProperty SwitchStyleProperty = BindableProperty.Create("SwitchStyle", typeof(SwitchStyle), typeof(FormsElement), SwitchStyle.Default);
-
- public static SwitchStyle GetSwitchStyle(BindableObject element)
- {
- return (SwitchStyle)element.GetValue(SwitchStyleProperty);
- }
-
- public static void SetSwitchStyle(BindableObject element, SwitchStyle value)
- {
- element.SetValue(SwitchStyleProperty, value);
- }
-
- public static SwitchStyle GetSwitchStyle(this IPlatformElementConfiguration<Tizen, FormsElement> config)
- {
- return GetSwitchStyle(config.Element);
- }
-
- public static IPlatformElementConfiguration<Tizen, FormsElement> SetSwitchStyle(this IPlatformElementConfiguration<Tizen, FormsElement> config, SwitchStyle value)
- {
- SetSwitchStyle(config.Element, value);
- return config;
- }
- }
-}
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/SwitchStyle.cs b/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/SwitchStyle.cs
deleted file mode 100644
index a7980fe2..00000000
--- a/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/SwitchStyle.cs
+++ /dev/null
@@ -1,9 +0,0 @@
-namespace Xamarin.Forms.PlatformConfiguration.TizenSpecific
-{
- public enum SwitchStyle
- {
- Default,
- CheckBox,
- Favorite
- }
-}
diff --git a/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/VisualElement.cs b/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/VisualElement.cs
new file mode 100644
index 00000000..7eb4c718
--- /dev/null
+++ b/Xamarin.Forms.Core/PlatformConfiguration/TizenSpecific/VisualElement.cs
@@ -0,0 +1,29 @@
+namespace Xamarin.Forms.PlatformConfiguration.TizenSpecific
+{
+ using FormsElement = Forms.VisualElement;
+ public static class VisualElement
+ {
+ public static readonly BindableProperty StyleProperty = BindableProperty.Create("ThemeStyle", typeof(string), typeof(VisualElement), default(string));
+
+ public static string GetStyle(BindableObject element)
+ {
+ return (string)element.GetValue(StyleProperty);
+ }
+
+ public static void SetStyle(BindableObject element, string value)
+ {
+ element.SetValue(StyleProperty, value);
+ }
+
+ public static string GetStyle(this IPlatformElementConfiguration<Tizen, FormsElement> config)
+ {
+ return GetStyle(config.Element);
+ }
+
+ public static IPlatformElementConfiguration<Tizen, FormsElement> SetStyle(this IPlatformElementConfiguration<Tizen, FormsElement> config, string value)
+ {
+ SetStyle(config.Element, value);
+ return config;
+ }
+ }
+}
diff --git a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
index 6d3ce330..46c640de 100644
--- a/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
+++ b/Xamarin.Forms.Core/Xamarin.Forms.Core.csproj
@@ -103,15 +103,13 @@
<Compile Include="PlatformConfiguration\iOSSpecific\UIStatusBarAnimation.cs" />
<Compile Include="PlatformConfiguration\iOSSpecific\UpdateMode.cs" />
<Compile Include="PlatformConfiguration\iOSSpecific\VisualElement.cs" />
+ <Compile Include="PlatformConfiguration\TizenSpecific\StyleValues.cs" />
+ <Compile Include="PlatformConfiguration\TizenSpecific\VisualElement.cs" />
<Compile Include="PlatformConfiguration\TizenSpecific\Entry.cs" />
<Compile Include="PlatformConfiguration\TizenSpecific\Label.cs" />
<Compile Include="PlatformConfiguration\TizenSpecific\Image.cs" />
<Compile Include="PlatformConfiguration\TizenSpecific\ProgressBar.cs" />
- <Compile Include="PlatformConfiguration\TizenSpecific\Button.cs" />
- <Compile Include="PlatformConfiguration\TizenSpecific\ButtonStyle.cs" />
- <Compile Include="PlatformConfiguration\TizenSpecific\Switch.cs" />
<Compile Include="PlatformConfiguration\TizenSpecific\FontWeight.cs" />
- <Compile Include="PlatformConfiguration\TizenSpecific\SwitchStyle.cs" />
<Compile Include="PlatformConfiguration\WindowsSpecific\MasterDetailPage.cs" />
<Compile Include="PlatformConfiguration\WindowsSpecific\CollapseStyle.cs" />
<Compile Include="Configuration.cs" />
@@ -465,6 +463,7 @@
<Name>Xamarin.Forms.Platform</Name>
</ProjectReference>
</ItemGroup>
+ <ItemGroup />
<PropertyGroup>
<PostBuildEvent>
</PostBuildEvent>