예제 #1
0
        /// <summary>
        /// Draw Diagram tab
        /// </summary>
        /// <param name="platform"></param>
        /// <param name="buttonRect"></param>
        /// <param name="textRect"></param>
        /// <param name="buttonBoxRect"></param>
        /// <param name="closeButtonRect"></param>
        /// <param name="tab"></param>
        public void DrawTab(IPlatformDrawer platform, Rect buttonRect, Rect textRect, Rect buttonBoxRect, Rect closeButtonRect, NavigationItem tab)
        {
            platform.DrawStretchBox(buttonRect, tab.State == NavigationItemState.Current ? CachedStyles.TabBoxActiveStyle : CachedStyles.TabBoxStyle, 10);

            platform.DrawTabLabel(textRect, tab.Title, CachedStyles.TabTitleStyle);

            platform.DoButton(buttonBoxRect, "", CachedStyles.ClearItemStyle,
                              m =>
            {
                if (tab.NavigationAction != null)
                {
                    tab.NavigationAction(m);
                }
            },
                              m =>
            {
                if (tab.NavigationActionSecondary != null)
                {
                    tab.NavigationActionSecondary(m);
                }
            });



            if (tab.State == NavigationItemState.Current)
            {
                platform.DoButton(closeButtonRect, "", CachedStyles.TabCloseButton,
                                  m =>
                {
                    if (tab.CloseAction != null)
                    {
                        tab.CloseAction(m);
                    }
                });
            }
        }