我已经在视图A中构造了一个对象。我打算将此对象传递给视图B,然后在标签中打印该对象的参数。不幸的是,我不允许在视图B中访问对象的参数。我收到错误消息“对象不包含'hrs'的定义”视图A中的代码:async void Calculate_btn(object sender, EventArgs e){ Calculation calc = new Calculation() { hrs = "qwe", cse = "rty", aqe = "uio" }; var page = new Results(calc); await Navigation.PushModalAsync(page);}视图B中的代码:public Results(object number){ InitializeComponent(); string hours = number.hrs; label.text = hours;}
- 1 回答
- 0 关注
- 129 浏览
添加回答
举报
0/150
提交
取消