示例#1
0
        private void SetButtonColor(NavigatorTest2Page page, int type)
        {
            Color backgroundColor;

            if (type == 0)
            {
                backgroundColor = Color.DarkGreen;
            }
            else if (type == 1)
            {
                backgroundColor = Color.DarkRed;
            }
            else if (type == 2)
            {
                backgroundColor = Color.DarkBlue;
            }
            else
            {
                backgroundColor = Color.SaddleBrown;
            }

            page.buttonPush.BackgroundColor          = backgroundColor;
            page.buttonPop.BackgroundColor           = backgroundColor;
            page.buttonPushAndInsert.BackgroundColor = backgroundColor;
            page.buttonRemoveAndPop.BackgroundColor  = backgroundColor;
            page.buttonPushAndRemove.BackgroundColor = backgroundColor;
            page.buttonInsertAndPop.BackgroundColor  = backgroundColor;
            page.buttonPopToRoot.BackgroundColor     = backgroundColor;
        }
示例#2
0
        public void Activate()
        {
            Console.WriteLine($"@@@ this.GetType().Name={this.GetType().Name}, Activate()");

            window    = NUIApplication.GetDefaultWindow();
            navigator = window.GetDefaultNavigator();

            page = new NavigatorTest2Page();
            navigator.Push(page);
        }
示例#3
0
        private void InsertWhenAppeared(object sender, PageAppearedEventArgs args)
        {
            var page = sender as NavigatorTest2Page;

            page.Appeared -= InsertWhenAppeared;

            var insertedPage = new NavigatorTest2Page();

            SetButtonColor(insertedPage, Navigator.PageCount % 4);
            insertedPage.AppBar.Title = "NavigatorTest2Page" + (Navigator.PageCount - 1).ToString();
            Navigator.InsertBefore(page, insertedPage);
            Tizen.Log.Info("NUI", insertedPage.AppBar.Title + " has been inserted before the peek page.\n");
        }
示例#4
0
        private void ButtonPushClicked(object sender, ClickedEventArgs args)
        {
            if (Navigator == null)
            {
                Tizen.Log.Error("NUI", "The page should be pushed to a Navigator.\n");
                return;
            }

            var newPage = new NavigatorTest2Page();

            SetButtonColor(newPage, Navigator.PageCount % 4);
            newPage.AppBar.Title = "NavigatorTest2Page" + Navigator.PageCount.ToString();
            Navigator.Push(newPage);
            Tizen.Log.Info("NUI", newPage.AppBar.Title + " has been pushed.\n");
        }
示例#5
0
        private void ButtonPushAndInsertClicked(object sender, ClickedEventArgs args)
        {
            if (Navigator == null)
            {
                Tizen.Log.Error("NUI", "The page should be pushed to a Navigator.\n");
                return;
            }

            var pushedPage = new NavigatorTest2Page();

            SetButtonColor(pushedPage, Navigator.PageCount % 4);
            pushedPage.AppBar.Title = "NavigatorTest2Page" + (Navigator.PageCount + 1).ToString();
            pushedPage.Appeared    += InsertWhenAppeared;
            Navigator.Push(pushedPage);
            Tizen.Log.Info("NUI", pushedPage.AppBar.Title + " has been pushed.\n");
        }
示例#6
0
        private void ButtonInsertAndPopClicked(object sender, ClickedEventArgs args)
        {
            if (Navigator == null)
            {
                Tizen.Log.Error("NUI", "The page should be pushed to a Navigator.\n");
                return;
            }

            var newPage = new NavigatorTest2Page();

            SetButtonColor(newPage, Navigator.PageCount % 4);
            newPage.AppBar.Title = "NavigatorTest2Page" + Navigator.PageCount.ToString();
            Navigator.InsertBefore(Navigator.Peek(), newPage);
            Tizen.Log.Info("NUI", newPage.AppBar.Title + " has been inserted before the peek page.\n");

            var poppedPage = Navigator.Pop() as NavigatorTest2Page;

            Tizen.Log.Info("NUI", poppedPage.AppBar.Title + " has been popped.\n");
        }