亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

比較 2 個文件 C# 之間的變量

比較 2 個文件 C# 之間的變量

C#
呼喚遠方 2021-07-16 14:01:14
我對 C 編碼和最重要的 C# 很陌生,所以我的問題是了解它是如何工作的。所以我真正想要的是,當您按下網格時,您將獲得一個唯一的 id,具體取決于網格中顯示的項目,而按下網格時,您將進入我想要顯示 item.id 的新頁面文件 1foreach (var item in list) {        TapGestureRecognizer gridTap = new TapGestureRecognizer();        gridTap.Tapped += (sender, e) =>        {            Navigation.PushModalAsync(new MarketItemPage());            item.Id = GridIdentifier.Grid_id; // item.id is the id of the choosen item = static int in class        };}檔案 2 public void Update()    {        string gridid = GridIdentifier.Grid_id.ToString();        grid.Children.Add(new Label        {            Text = gridid,            FontSize = 16,            FontFamily = "Arial",            TextColor = Color.Red,            VerticalTextAlignment = TextAlignment.Center,            HorizontalTextAlignment = TextAlignment.Center,            HorizontalOptions = LayoutOptions.Center,        });    }班級public static class GridIdentifier{    public static int Grid_id { get; set; }}
查看完整描述

1 回答

?
泛舟湖上清波郎朗

TA貢獻1818條經驗 獲得超3個贊

有幾種方法可以實現這一點。一種方法是將項目傳遞IdMarketItemPage.

有關更多選項,請查看導航時傳遞數據的 Xamarin 信息


查看完整回答
反對 回復 2021-07-18
  • 1 回答
  • 0 關注
  • 226 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號