为什么我无法访问模型的属性?

时间:2017-12-05 04:06:52

标签: xamarin.forms visual-studio-2017

我有这个型号:

public class SignupModel
    {
        public string Rut           { get; set; }
        public string Name          { get; set; }
        public string Address       { get; set; }
        public string Commune       { get; set; }
        public string PhoneNumber   { get; set; }
        public string Email         { get; set; }
        public string CIPath        { get; set; }
        public string Password      { get; set; }

        public SignupModel()
        {
        }
    }

我有这个SignupViewModel:

public class SignupViewModel
    {
        public SignupModel SignupModel { get; set; }

        public SignupViewModel()
        {
            SignupModel = new SignupModel()
            {
                Rut         = "",
                Name        = "",
                Address     = "",
                Email       = "",
                PhoneNumber = "",
                Password    = "",
                CIPath      = "",
                Commune     = ""
            };
        }
    }

当我按下按钮时,我正在尝试这样做:

SignupViewModel.SignupModel.Password = "Superpassword";
                await DisplayAlert("Password", SignupViewModel.SignupModel.Password, "Ok");

它告诉我这个: enter image description here

有人可以向我解释发生了什么事吗?提前致谢。 :)

0 个答案:

没有答案