我拥有
的公共财产此类: APIUserCredentials
public class APIUserCredentials
{
private string _Email;
private string _Password;
public string Email
{
get { return _Email; }
set { _Email = value; }
}
public string Password
{
get { return _Password; }
set { _Password = value; }
}
public APIUserCredentials(string email, string password)
{
this.Email = email;
this.Password = password;
}
}
我在Activity的Oncreate中创建对象,然后中断了它。即使是公共密码,Visual Studio也无法访问属性密码。怎么了?
请注意:如果我像这样从类APIUserCredentials中删除getter和setter:
public class APIUserCredentials
{
public string Email;
public string Password;
public APIUserCredentials(string email, string password)
{
this.Email = email;
this.Password = password;
}
}
它看起来像一个编译器错误,但我不确定。任何帮助表示赞赏! ios应用程序上使用了相同的代码,它的工作原理就像一个超级按钮。但是在Android上,一旦将getter和setter放在类APIUserCredentials中,可访问性就无法正常工作。