summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Tizen/Renderers
diff options
context:
space:
mode:
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen/Renderers')
-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;