private void SetButtonColor(NavigatorTest1Page 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.buttonInsert.BackgroundColor       = backgroundColor;
            page.buttonInsertBefore.BackgroundColor = backgroundColor;
            page.buttonRemove.BackgroundColor       = backgroundColor;
            page.buttonRemoveAt.BackgroundColor     = backgroundColor;
        }
Example #2
0
        public void Activate()
        {
            Console.WriteLine($"@@@ this.GetType().Name={this.GetType().Name}, Activate()");

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

            page = new NavigatorTest1Page();
            navigator.Push(page);
        }
        private void ButtonInsertClicked(object sender, ClickedEventArgs args)
        {
            if (Navigator == null)
            {
                Tizen.Log.Error("NUI", "The page should be pushed to a Navigator.\n");
                return;
            }

            var newPage = new NavigatorTest1Page();

            SetButtonColor(newPage, Navigator.PageCount % 4);
            newPage.AppBar.Title = "NavigatorTest1Page" + Navigator.PageCount.ToString();
            Navigator.Insert(Navigator.PageCount, newPage);
            Tizen.Log.Info("NUI", newPage.AppBar.Title + " has been inserted.\n");
        }