summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs
diff options
context:
space:
mode:
authorrina6350.you <rina6350.you@samsung.com>2017-05-22 17:04:02 +0900
committerrina6350.you <rina6350.you@samsung.com>2017-06-12 16:24:31 +0900
commit578e50e218cf32dbbd7d02b4d176bd1ea08e4897 (patch)
treef503cf1c8bba96275e3640d1e33911dbb257123a /Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs
parentcd659265d2e8a09f74b6516dfa90233cfde4076b (diff)
downloadxamarin-forms-578e50e218cf32dbbd7d02b4d176bd1ea08e4897.tar.gz
xamarin-forms-578e50e218cf32dbbd7d02b4d176bd1ea08e4897.tar.bz2
xamarin-forms-578e50e218cf32dbbd7d02b4d176bd1ea08e4897.zip
Support the BarBackground Color of TabbedPage.
TASK=TCAPI-2498 Change-Id: If09d98c00072fb4b53dc99e8f026f1bfcf70bd79
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs')
-rwxr-xr-x[-rw-r--r--]Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs25
1 files changed, 23 insertions, 2 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs
index b5868669..34e0235e 100644..100755
--- a/Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs
@@ -4,7 +4,7 @@ using System.Linq;
using ElmSharp;
using EToolbarItem = ElmSharp.ToolbarItem;
using EToolbarItemEventArgs = ElmSharp.ToolbarItemEventArgs;
-
+using EColor = ElmSharp.Color;
using Xamarin.Forms.PlatformConfiguration.TizenSpecific;
using Xamarin.Forms.Internals;
@@ -25,6 +25,7 @@ namespace Xamarin.Forms.Platform.Tizen
RegisterPropertyHandler(TabbedPage.TitleProperty, UpdateTitle);
//Register for current page change property
RegisterPropertyHandler("CurrentPage", CurrentPageChanged);
+ RegisterPropertyHandler(TabbedPage.BarBackgroundColorProperty, UpdateBarBackgroundColor);
}
protected override void OnElementChanged(ElementChangedEventArgs<TabbedPage> e)
@@ -160,6 +161,23 @@ namespace Xamarin.Forms.Platform.Tizen
}
}
+ void UpdateBarBackgroundColor()
+ {
+ EColor bgColor = Element.BarBackgroundColor.ToNative();
+ _toolbar.BackgroundColor = bgColor;
+ foreach (EToolbarItem item in _itemToItemPage.Keys)
+ {
+ if (Element.BarBackgroundColor == Color.Default)
+ {
+ item.DeletePartColor("bg");
+ }
+ else
+ {
+ item.SetPartColor("bg", bgColor);
+ }
+ }
+ }
+
void UpdateTitle()
{
_toolbar.Text = Element.Title;
@@ -188,7 +206,10 @@ namespace Xamarin.Forms.Platform.Tizen
foreach (Page child in Pages)
{
EToolbarItem toolbarItem = _toolbar.Append(child.Title, string.IsNullOrEmpty(child.Icon) ? null : ResourcePath.GetPath(child.Icon));
-
+ if (Element.BarBackgroundColor != Color.Default)
+ {
+ toolbarItem.SetPartColor("bg", _toolbar.BackgroundColor);
+ }
_itemToItemPage.Add(toolbarItem, child);
var childContent = Platform.GetOrCreateRenderer(child).NativeView;