using EToolbarItem = ElmSharp.ToolbarItem;
using EToolbarItemEventArgs = ElmSharp.ToolbarItemEventArgs;
+using Xamarin.Forms.PlatformConfiguration.TizenSpecific;
+
namespace Xamarin.Forms.Platform.Tizen
{
public class TabbedPageRenderer : VisualElementRenderer<TabbedPage>, IVisualElementRenderer
EvasObject _tcontent;
Dictionary<EToolbarItem, Page> _itemToItemPage = new Dictionary<EToolbarItem, Page>();
- public TabbedPageRenderer ()
+ public TabbedPageRenderer()
{
//Register for title change property
RegisterPropertyHandler(TabbedPage.TitleProperty, UpdateTitle);
base.OnElementReady();
}
+ protected override void UpdateThemeStyle()
+ {
+ _tpage.Style = Element.OnThisPlatform().GetStyle();
+ ((IVisualElementController)Element).NativeSizeChanged();
+ }
+
void UpdateTitle()
{
_tpage.Text = Element.Title;
void FillToolbar()
{
var logicalChildren = (Element as IElementController).LogicalChildren;
- bool hasIcon = false;
//add items to toolbar
foreach (Page child in logicalChildren)
childRenderer.NativeView.Hide();
}
- EToolbarItem toolbarItem;
- if (string.IsNullOrEmpty(child.Icon))
- {
- toolbarItem = _tpage.Append(child.Title);
- }
- else
- {
- if (!hasIcon)
- {
- _tpage.Style="tabbar";
- hasIcon = true;
- }
- toolbarItem = _tpage.Append(child.Title, ResourcePath.GetPath(child.Icon));
- }
+ EToolbarItem toolbarItem = _tpage.Append(child.Title, string.IsNullOrEmpty(child.Icon) ? null : ResourcePath.GetPath(child.Icon));
+
_itemToItemPage.Add(toolbarItem, child);
if (Element.CurrentPage == child)
{