public RegisterPage(ClanViewRequest clan) { InitializeComponent(); BindingContext = new RegisterViewModel(clan); if (clan != null) { EntryPassword.IsVisible = false; LabelPasswor.IsVisible = false; EntryPasswordPotvrda.IsVisible = false; LabelPasswordPotvrda.IsVisible = false; EntryUsername.IsEnabled = false; RegisterButton.Text = "Spasi"; } }
public RegisterViewModel(ClanViewRequest clan = null) { _apiService = new APIService("Osoba"); _apiService_Clan = new APIService("Clan"); registerModel = new RegisterModel(); RegisterCommand = new Command(async() => await Register()); if (clan != null) { var Osoba = AsyncHelpers.RunSync <Wellness.Model.Osoba>(() => _apiService.GetById <Wellness.Model.Osoba>(clan.OsobaId)); _osoba = Osoba; _clan = clan; registerModel.Ime = Osoba.Ime; registerModel.Prezime = Osoba.Prezime; registerModel.KorisnickoIme = Osoba.KorisnickoIme; registerModel.BrojTelefona = Osoba.BrojTelefona; registerModel.Email = Osoba.Email; registerModel.JMBG = Osoba.Jmbg; } }