更新时间:2023-12-03 09:11:28
使用实例成员引用代替静态引用:
Use an instance member reference instead of a static reference:
View1
类中,将public static Entry txtName;
更改为
public Entry txtName;
.Page1
类添加新字段View1 _currentView;
.SelectButton()
方法的末尾,添加_currentView =
view;
.OnClick_Save()
中,将var s =
View1.txtName.Text;
更改为var s = _currentView.txtName.Text;
.View1
class, change public static Entry txtName;
to
public Entry txtName;
.View1 _currentView;
to the Page1
class.SelectButton()
method, add _currentView =
view;
.OnClick_Save()
, change var s =
View1.txtName.Text;
to var s = _currentView.txtName.Text;
.