예제 #1
0
        async void OnTapDoThis_1(object sender, EventArgs e)
        {
            ViewCell lblClicked = (ViewCell)sender;
            string   txt        = lblClicked.ToString(); //do not know how to parse the viewcell elements

            //await Navigation.PushAsync(updateTask);

            await DisplayAlert("Message", "You tapped me on " + txt + " !", "Ok");

            //await Navigation.PushAsync(new UpdateCounts());
        }
예제 #2
0
        private void buttonFindByName_Clicked(object sender, EventArgs e)
        {
            Label label = this.FindByName <Label>("label2");

            Console.WriteLine($"變更前的文字標籤的文字內容 : {label.Text}");
            label.Text = "透過 FindByName 取得控制項來變更文字";
            Console.WriteLine($"變更後的文字標籤的文字內容 : {label.Text}");

            ViewCell viewcell          = this.FindByName <ViewCell>("viewCell");
            var      fooViewCellObject = viewcell == null ? "空值" : viewcell.ToString();

            Console.WriteLine($"ViewCell 的物件 {fooViewCellObject}");
        }