summaryrefslogtreecommitdiff
path: root/Xamarin.Forms.Platform.Tizen
diff options
context:
space:
mode:
authorWonYoung Choi <wy80.choi@samsung.com>2017-02-15 19:23:23 +0900
committerKangho Hur <kangho.hur@samsung.com>2017-03-24 13:19:02 +0900
commit5f2706e4c098da7cb2af87540d30334beae78a83 (patch)
tree5224ec1a88469b2b10907db563a320d04dda98f9 /Xamarin.Forms.Platform.Tizen
parentbb5066c364f07302b087bbe8a38ce38f4d4588e4 (diff)
downloadxamarin-forms-5f2706e4c098da7cb2af87540d30334beae78a83.tar.gz
xamarin-forms-5f2706e4c098da7cb2af87540d30334beae78a83.tar.bz2
xamarin-forms-5f2706e4c098da7cb2af87540d30334beae78a83.zip
Add TabbedPageStyle
Add two styles of TabbedPage, "Tabbar", "TabbarWithTitle" Change-Id: I71d3e7c128b03b5df58a0ab9f9929b24ac9e4650
Diffstat (limited to 'Xamarin.Forms.Platform.Tizen')
-rw-r--r--[-rwxr-xr-x]Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs27
1 files changed, 11 insertions, 16 deletions
diff --git a/Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs b/Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs
index dd8c44cd..bec57fe9 100755..100644
--- a/Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs
+++ b/Xamarin.Forms.Platform.Tizen/Renderers/TabbedPageRenderer.cs
@@ -5,6 +5,8 @@ using ElmSharp;
using EToolbarItem = ElmSharp.ToolbarItem;
using EToolbarItemEventArgs = ElmSharp.ToolbarItemEventArgs;
+using Xamarin.Forms.PlatformConfiguration.TizenSpecific;
+
namespace Xamarin.Forms.Platform.Tizen
{
public class TabbedPageRenderer : VisualElementRenderer<TabbedPage>, IVisualElementRenderer
@@ -14,7 +16,7 @@ namespace Xamarin.Forms.Platform.Tizen
EvasObject _tcontent;
Dictionary<EToolbarItem, Page> _itemToItemPage = new Dictionary<EToolbarItem, Page>();
- public TabbedPageRenderer ()
+ public TabbedPageRenderer()
{
//Register for title change property
RegisterPropertyHandler(TabbedPage.TitleProperty, UpdateTitle);
@@ -81,6 +83,12 @@ namespace Xamarin.Forms.Platform.Tizen
base.OnElementReady();
}
+ protected override void UpdateThemeStyle()
+ {
+ _tpage.Style = Element.OnThisPlatform().GetStyle();
+ ((IVisualElementController)Element).NativeSizeChanged();
+ }
+
void UpdateTitle()
{
_tpage.Text = Element.Title;
@@ -106,7 +114,6 @@ namespace Xamarin.Forms.Platform.Tizen
void FillToolbar()
{
var logicalChildren = (Element as IElementController).LogicalChildren;
- bool hasIcon = false;
//add items to toolbar
foreach (Page child in logicalChildren)
@@ -117,20 +124,8 @@ namespace Xamarin.Forms.Platform.Tizen
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)
{