Exemplo n.º 1
0
        private void CreateCommands()
        {
            LoginCommand = new Command(async() =>
            {
                var monkeyUsers = monkeyManager.GetMonkey <User>("users");

                if (monkeyUsers != null)
                {
                    Users = monkeyUsers;
                }

                var userFinded = Users.FirstOrDefault(e => e.UserName.ToUpper() == User.UserName.ToUpper() && e.Password == User.Password);
                if (userFinded != null)
                {
                    await App.Current.MainPage.Navigation.PushAsync(new ContactPage(userFinded));
                }
                else
                {
                    Result = "Usuario o contraseña no valido";
                }
            });

            RegisterCommand = new Command(async() =>
            {
                await App.Current.MainPage.Navigation.PushAsync(new RegisterPage());
            });
        }
        private void LoadContacts()
        {
            var monkeyContacts = monkeyManager.GetMonkey <Contact>("contacts");

            if (monkeyContacts != null)
            {
                Contacts = monkeyContacts;
            }
        }
Exemplo n.º 3
0
        private void LoadUsers()
        {
            var monkeyUsers = monkeyManager.GetMonkey <User>("users");

            if (monkeyUsers != null)
            {
                Users = monkeyUsers;
            }
        }
Exemplo n.º 4
0
        protected override void OnAppearing()
        {
            base.OnAppearing();
            var monkeyContacts = monkeyManager.GetMonkey <Contact>("contacts");

            if (monkeyContacts != null)
            {
                MessagingCenter.Send <ISubcriptor, ObservableCollection <Contact> >(this, "ChangeContacts", monkeyContacts);
            }
        }