예제 #1
0
        private async void ChangeColor()
        {
            Label1.BackgroundColor = FuntionClass.GetRandomColor();
            await Task.Delay(50);

            Label2.BackgroundColor = FuntionClass.GetRandomColor();
            await Task.Delay(50);

            Label3.BackgroundColor = FuntionClass.GetRandomColor();
            await Task.Delay(50);

            ChangeButton.BackgroundColor = FuntionClass.GetRandomColor();
            await Task.Delay(50);

            BackButton.BackgroundColor = FuntionClass.GetRandomColor();
            await Task.Delay(50);
        }
        public StackPage()
        {
            NavigationPage.SetHasNavigationBar(this, false);
            InitializeComponent();

            BackButton.Clicked += async(sender, e) =>
                                  await Navigation.PopAsync();

            addButton.Clicked += (sender, e) =>
            {
                childrenStack.Children.Add(new Label
                {
                    HorizontalOptions = LayoutOptions.FillAndExpand,
                    VerticalOptions   = LayoutOptions.FillAndExpand,
                    BackgroundColor   = FuntionClass.GetRandomColor()
                }
                                           );
            };
        }