コード例 #1
0
        //public ViewModelBase(INavigationService navigationService, IPageDialogService dialogService, IFacebookManager facebookManager)
        //     {
        //this._facebookManager = facebookManager;
        //    NavigationService = navigationService;
        //    DialogService = dialogService;
        //}

        public ViewModelBase(INavigationService navigationService, IPageDialogService dialogService, IFacebookManager facebookManager, IGoogleManager googleManager)
        {
            this._facebookManager = facebookManager;
            this._googleManager   = googleManager;
            NavigationService     = navigationService;
            DialogService         = dialogService;
        }
コード例 #2
0
 public LoginViewModel()
 {
     _facebookManager     = DependencyService.Get <IFacebookManager>();
     _googleManager       = DependencyService.Get <IGoogleManager>();
     LoginFacebookCommand = new Command(LoginFacebook);
     LoginGoogleCommand   = new Command(LoginGoogle);
 }
コード例 #3
0
 public LoginViewModel(INavigationService navigationService, IUserDataService userDataService,
                       IGoogleManager googleManager, IValidationService validationService) :
     base(navigationService)
 {
     _userDataService   = userDataService;
     _googleManager     = googleManager;
     _validationService = validationService;
 }
コード例 #4
0
        public MainPageViewModel(IGoogleManager googleManager, IPageDialogService dialogService)
        {
            _googleManager = googleManager;
            _dialogService = dialogService;

            IsLogedIn           = false;
            GoogleLoginCommand  = new DelegateCommand(GoogleLogin);
            GoogleLogoutCommand = new DelegateCommand(GoogleLogout);
        }
コード例 #5
0
 public LoginViewModel()
 {
     this.EntrarCommand   = new Command(Entrar);
     this.RegisterCommand = new Command(Register);
     _facebookManager     = DependencyService.Get <IFacebookManager>();
     _googleManager       = DependencyService.Get <IGoogleManager>();
     LoginFacebookCommand = new Command(LoginFacebook);
     LoginGoogleCommand   = new Command(LoginGoogle);
 }
コード例 #6
0
        public MainPageViewModel(INavigationService navigationService, IGoogleManager googleManager, IPageDialogService dialogService)
            : base(navigationService)
        {
            _navigationService = navigationService;
            _googleManager     = googleManager;
            _dialogService     = dialogService;

            LoginCommand = new DelegateCommand(CallLogin);
        }
コード例 #7
0
        public ProfilePageViewModel(IGoogleManager googleManager, INavigationService navigationService) : base(navigationService)
        {
            _googleManager     = googleManager;
            _navigationService = navigationService;

            Avatar   = MainPageViewModel.CurrentGoogleAvatar;
            Email    = MainPageViewModel.CurrentGoogleEmail;
            Username = MainPageViewModel.CurrentGoogleUsername;

            LogoutCommand = new DelegateCommand(CallLogout);
        }
コード例 #8
0
        public HomePage()
        {
            InitializeComponent();
            MasterPage.ListView.ItemSelected += ListView_ItemSelected;
            var tapGestureRecognizer = new TapGestureRecognizer();

            tapGestureRecognizer.Tapped += Logout_Tapped;
            MasterPage.Logout_Option.GestureRecognizers.Add(tapGestureRecognizer);
            var MenuTabGesture = new TapGestureRecognizer();

            MenuTabGesture.Tapped += Menu_Tapped;
            MasterPage.Menu_Icon.GestureRecognizers.Add(MenuTabGesture);
            _facebookManager = DependencyService.Get <IFacebookManager>();
            _googleManager   = DependencyService.Get <IGoogleManager>();
        }
コード例 #9
0
        private void GoogleLogin()
        {
            try
            {
                _googleManager = DependencyService.Get <IGoogleManager>();

                UserDialogs.Instance.ShowLoading("Iniciando sesion...", MaskType.Black);

                _googleManager.Login(OnLoginComplete);
#if __IOS__
                UserDialogs.Instance.HideLoading();
#endif
            }
            catch (Exception ex)
            {
            }
        }
コード例 #10
0
 public SignUpPageViewModel(INavigationService navigationService) : base(navigationService)
 {
     _facebookManager        = DependencyService.Get <IFacebookManager>();
     _googleManager          = DependencyService.Get <IGoogleManager>();
     _appleManager           = DependencyService.Get <IAppleManager>();
     IsLogedIn               = false;
     FacebookLoginCommand    = new DelegateCommand(FacebookLogin);
     GoogleLoginCommand      = new DelegateCommand(GoogleLogin);
     FacebookLogoutCommand   = new DelegateCommand(FacebookLogout);
     AppleLoginCommand       = new DelegateCommand(AppleIdLogin);
     AppleLogoutCommand      = new DelegateCommand(AppleIdLogout);
     GoogleLogoutCommand     = new DelegateCommand(GoogleLogout);
     GoBackToSignInPage      = new DelegateCommand(GoToSignInPage);
     SubmitBtnCommand        = new DelegateCommand(GoToEnterOtpPage);
     SubmitFbIdButtonCommand = new DelegateCommand(UpdateFacebookEmailId);
     CrossButtonCommand      = new DelegateCommand(CloseEmailPopup);
     ToggleCheckboxCommand   = new DelegateCommand(ToggleCheckbox);
 }
コード例 #11
0
        public DetailsUserViewModel(FacebookUser facebookUser, GoogleUser googleUser)
        {
            this.LogoutCommand = new Command(Logout);
            _facebookManager   = DependencyService.Get <IFacebookManager>();
            _googleManager     = DependencyService.Get <IGoogleManager>();

            if (facebookUser != null)
            {
                Name       = $"{facebookUser.FirstName} {facebookUser.LastName}";
                Photo      = new Uri(facebookUser.Picture);
                IsFacebook = true;
            }
            else
            {
                Name       = googleUser.Name;
                Photo      = googleUser.Picture;
                IsFacebook = false;
            }
        }
コード例 #12
0
        public SignInPageViewModel(INavigationService navigationService) : base(navigationService)
        {
            _facebookManager = DependencyService.Get <IFacebookManager>();
            _googleManager   = DependencyService.Get <IGoogleManager>();
            _appleManager    = DependencyService.Get <IAppleManager>();

            IsLogedIn                     = false;
            AppleLoginCommand             = new DelegateCommand(AppleIdLogin);
            AppleLogoutCommand            = new DelegateCommand(AppleIdLogout);
            FacebookLoginCommand          = new DelegateCommand(FacebookLogin);
            GoogleLoginCommand            = new DelegateCommand(GoogleLogin);
            FacebookLogoutCommand         = new DelegateCommand(FacebookLogout);
            GoogleLogoutCommand           = new DelegateCommand(GoogleLogout);
            GoToSignUpPageCommand         = new DelegateCommand(GoToSignUpPage);
            GoToForgotPasswordPageCommand = new DelegateCommand(GoToForgotPasswordPage);
            ContinueCommand               = new DelegateCommand(SignIn);
            SubmitFbIdButtonCommand       = new DelegateCommand(UpdateFacebookEmailId);
            CrossButtonCommand            = new DelegateCommand(CloseEmailPopup);
        }
コード例 #13
0
        private IGoogleManager _googleManagerService;//??incorrect naming
        protected override void OnCreate(Bundle bundle)
        {
            TabLayoutResource = Resource.Layout.Tabbar;
            ToolbarResource   = Resource.Layout.Toolbar;

            base.OnCreate(bundle);

            UserDialogs.Init(this);
            CrossCurrentActivity.Current.Init(this, bundle);//for using media plugin

            global::Xamarin.Forms.Forms.Init(this, bundle);
            LoadApplication(new App(new AndroidInitializer()));

            CachedImageRenderer.Init(true);//for using FFImageLoading
            Instance = this;

            ActivityContext = this;

            var container = (App.Current as PrismApplicationBase).Container;

            _googleManagerService = container.Resolve <IGoogleManager>();
        }
コード例 #14
0
 public LoginPage()
 {
     _googleManager = DependencyService.Get <IGoogleManager>();
     CheckUserLoggedIn();
     InitializeComponent();
 }
コード例 #15
0
        private async void CierraSesion()
        {
            try
            {
                var result = await Application.Current.MainPage.DisplayAlert("City Center Rosario", "¿Está seguro que desea salir de la aplicación?", "OK", "Cancelar");

                string Mensajevalida = string.Format("Result {0}", result);

                if (Mensajevalida == "Result True")
                {
                    UserDialogs.Instance.ShowLoading("Cerrando sesión...", MaskType.Black);

                    Application.Current.Properties["IsLoggedIn"]      = false;
                    Application.Current.Properties["IdUsuario"]       = 0;
                    Application.Current.Properties["Email"]           = "";
                    Application.Current.Properties["NombreCompleto"]  = "";
                    Application.Current.Properties["Ciudad"]          = "";
                    Application.Current.Properties["Pass"]            = "";
                    Application.Current.Properties["FechaNacimiento"] = "";
                    Application.Current.Properties["FotoPerfil"]      = "";
                    Application.Current.Properties["TipoCuenta"]      = "";

                    await Application.Current.SavePropertiesAsync();

                    //MainViewModel.GetInstance().Master = new MasterViewModel();
                    MainViewModel.GetInstance().Inicio = new InicioViewModel();
                    MainViewModel.GetInstance().Detail = new DetailViewModel();
                    MainViewModel.GetInstance().Casino = new CasinoViewModel();

                    PerfilVisible   = false;
                    OpcionesVisible = true;

                    ((MasterPage)Application.Current.MainPage).IsPresented = false;

                    _googleManager = DependencyService.Get <IGoogleManager>();
                    _googleManager.Logout();



                    try
                    {
                        var Contenido = new FormUrlEncodedContent(new[]
                        {
                            new KeyValuePair <string, string>("neq_equipo", Application.Current.Properties["Token"].ToString()),
                            new KeyValuePair <string, string>("neq_id_usuario", "0"),
                            new KeyValuePair <string, string>("neq_dispositivo", CrossDeviceInfo.Current.Platform.ToString()),
                            new KeyValuePair <string, string>("neq_app_id", CrossDeviceInfo.Current.Id)
                        });


                        var response2 = await this.apiService.Get <GuardadoGenerico>("/notificaciones", "/guardar_equipo", Contenido);

                        if (!response2.IsSuccess)
                        {
                        }
                    }
                    catch (Exception ex)
                    {
                    }

                    MasterPage fpm = new MasterPage();
                    //fpm.Master = new DetailPage(); // You have to create a Master ContentPage()

                    //App.NavPage = new NavigationPage(new CustomTabPage()) { BarBackgroundColor = Color.FromHex("#23144B") };

                    //fpm.Detail = App.NavPage; // You have to create a Detail ContenPage()
                    Application.Current.MainPage   = fpm;
                    App.NavPage.BarBackgroundColor = Color.FromHex("#23144B");
                    // ActualizaBarra.Cambio(VariablesGlobales.VentanaActual);

                    UserDialogs.Instance.HideLoading();
                }
            }
            catch (Exception ex)
            {
                UserDialogs.Instance.HideLoading();

                //  await  Mensaje.Alerta("Ocurrio un error al cerrar sesion");

                //await Application.Current.MainPage.DisplayAlert(
                //          "Error",
                //           ex.ToString(),
                //          "Ok");
            }
        }
コード例 #16
0
 public ViewModelBase(IGoogleManager googleManager)
 {
     this._googleManager = googleManager;
 }
コード例 #17
0
 public SignIn()
 {
     _googleManager = DependencyService.Get <IGoogleManager>();
     InitializeComponent();
 }
コード例 #18
0
 public LoginViewModel(INavigationService navigationService, IPageDialogService dialogService, IFacebookManager facebookManager, IGoogleManager googleManager) : base(navigationService, dialogService, facebookManager, googleManager)
 {
     HomeNavigation       = new DelegateCommand(homenavigationAsync);
     FacebookLoginPressed = new DelegateCommand(FacebookLogin);
     GoogleLoginPressed   = new DelegateCommand(GoogleLogin);
 }