Exemplo n.º 1
0
        private void CreatePaginationUI()
        {
            if (m_PaginationStyle == UIPaginationStyle.PAGINATION_BAR)
            {
                //TODO: Arrows
                m_PaginationBar = new UIPaginationBar();
                m_PaginationBar.OnPageChanged  += m_Pagination_OnPageChanged;
                m_PaginationBar.TextStyle       = TextStyle.DefaultLabel.Clone();
                m_PaginationBar.TextStyle.Color = Color.White;

                m_PaginationBar.SelectedTextStyle = TextStyle.DefaultLabel.Clone();
                m_PaginationBar.SelectedTextStyle.Size++;

                this.Add(m_PaginationBar);
            }
            else if (m_PaginationStyle == UIPaginationStyle.LEFT_RIGHT_ARROWS)
            {
                if (m_LeftArrow == null || m_RightArrow == null)
                {
                    throw new Exception("Arrow images must be provided");
                }

                LeftArrow = new UIButton(m_LeftArrow);
                LeftArrow.OnButtonClick += Arrow_OnButtonClick;
                Add(LeftArrow);
                RightArrow = new UIButton(m_RightArrow);
                RightArrow.OnButtonClick += Arrow_OnButtonClick;
                Add(RightArrow);
            }
        }
        public UICollectionViewer()
            : base()
        {
            m_Pagination = new UIPaginationBar();
            m_Pagination.OnPageChanged  += new PaginationEvent(m_Pagination_OnPageChanged);
            m_Pagination.TextStyle       = TextStyle.DefaultLabel.Clone();
            m_Pagination.TextStyle.Color = Color.White;

            m_Pagination.SelectedTextStyle = TextStyle.DefaultLabel.Clone();
            m_Pagination.SelectedTextStyle.Size++;

            this.Add(m_Pagination);
        }