//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; }
public LoginViewModel() { _facebookManager = DependencyService.Get <IFacebookManager>(); _googleManager = DependencyService.Get <IGoogleManager>(); LoginFacebookCommand = new Command(LoginFacebook); LoginGoogleCommand = new Command(LoginGoogle); }
public LoginViewModel(INavigationService navigationService, IUserDataService userDataService, IGoogleManager googleManager, IValidationService validationService) : base(navigationService) { _userDataService = userDataService; _googleManager = googleManager; _validationService = validationService; }
public MainPageViewModel(IGoogleManager googleManager, IPageDialogService dialogService) { _googleManager = googleManager; _dialogService = dialogService; IsLogedIn = false; GoogleLoginCommand = new DelegateCommand(GoogleLogin); GoogleLogoutCommand = new DelegateCommand(GoogleLogout); }
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); }
public MainPageViewModel(INavigationService navigationService, IGoogleManager googleManager, IPageDialogService dialogService) : base(navigationService) { _navigationService = navigationService; _googleManager = googleManager; _dialogService = dialogService; LoginCommand = new DelegateCommand(CallLogin); }
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); }
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>(); }
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) { } }
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); }
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; } }
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); }
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>(); }
public LoginPage() { _googleManager = DependencyService.Get <IGoogleManager>(); CheckUserLoggedIn(); InitializeComponent(); }
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"); } }
public ViewModelBase(IGoogleManager googleManager) { this._googleManager = googleManager; }
public SignIn() { _googleManager = DependencyService.Get <IGoogleManager>(); InitializeComponent(); }
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); }