private async void TappedCommandExecute(DefaultUser user) { this.IsBusyIndicatorVisible = true; var loginValue = user.Login; var passwordValue = user.Password; //await Task.Factory.StartNew(async () => //{ var deviceUid = DependencyService.Get<IDeviceIdentifier>().GetIdentifier(); var platform = Device.OS == TargetPlatform.Android ? Quickblox.Sdk.GeneralDataModel.Models.Platform.android : Quickblox.Sdk.GeneralDataModel.Models.Platform.ios; var userId = await App.QbProvider.LoginWithLoginValueAsync(loginValue, passwordValue, platform, deviceUid); Device.BeginInvokeOnMainThread(() => { if (userId > 0) { this.IsBusyIndicatorVisible = false; App.SetMainPage(); } //else //{ // App.Current.MainPage.DisplayAlert("Error", "Try to repeat login", "Ok"); //} this.IsBusyIndicatorVisible = false; }); //}); }
private async void TappedCommandExecute(DefaultUser user) { this.IsBusy = true; var loginValue = user.Login; var passwordValue = user.Password; var userId = await App.QbProvider.LoginWithLoginValueAsync(loginValue, passwordValue, Quickblox.Sdk.GeneralDataModel.Models.Platform.windows_phone, new DeviceUid_Uwp().GetIdentifier()); if (userId > 0) { this.IsBusy = false; App.NavigationFrame.Navigate(typeof(ChatsPage), userId); } else if (userId == 0) { new MessageDialog("Try to repeat login", "Error").ShowAsync(); } this.IsBusy = false; }