private void NavigateOnSelection() { if (selectedAsset != null) { NavService.NavigateTo <AssetDetailViewModel, AssetDto>(selectedAsset); } }
public async Task SaveEntry(GooglePlaceAutoCompletePrediction placeA) { var place = await googleMapsApi.GetPlaceDetails(placeA.PlaceId); if (place != null) { PickupText = place.Name; Entry.Latitude = place.Latitude; Entry.Longitude = place.Longitude; Entry.Address = place.Name; if (IsBusy) { return; } IsBusy = true; try { await _cateringService.AddEntryAsync(Entry); await NavService.NavigateTo <MainViewModel>(); await NavService.ClearBackStack(); await NavService.ClearBackStack(); } finally { IsBusy = false; } } }
public override async Task Init() { if (!((App)Application.Current).IsSignedIn) { await NavService.NavigateTo <SignInViewModel>(); } else { LoadEntries(); } }
async Task ExecuteLoginCommand() { if (!IsLogged()) { await NavService.NavigateTo <LoginPageViewModel>(); } else //apre la pagina utente se già loggato { await NavService.NavigateTo <UtentePageViewModel>(); } }
// ... async Task ExecuteSelectPlaceCommand() { var newItem = new CateringEntry { Title = Title, Latitude = Latitude, Longitude = Longitude, Date = Date, Notes = Notes }; await NavService.NavigateTo <SelectPlaceViewModel, CateringEntry>(newItem); }
async Task ExecuteCercaCommand() { if (isEmpty()) { await App.Current.MainPage.DisplayAlert("Errore", "Riempi entrambi i campi di ricerca", "Ok"); return; } SearchQuery query = new SearchQuery(); query.citta = Citta.Trim(); query.oggetto = Oggetto.Trim(); await NavService.NavigateTo <AnnunciQueryViewModel, SearchQuery>(query); }
async Task ExecuteSignInCommand() { if (!IsValidEmail(Email)) { await App.Current.MainPage.DisplayAlert("Errore", "Inserisci un indirizzo email valido", "Ok"); return; } if (EmptyFields()) { await App.Current.MainPage.DisplayAlert("Errore", "Non hai riempito uno o più campi", "Ok"); return; } if (!PasswordsAreTheSameAndNotEmpty()) { await App.Current.MainPage.DisplayAlert("Errore", "Le due password non corrispondono", "Ok"); return; } var signUpRequest = new SignUpRequest { name = Name.Trim(), surname = Surname.Trim(), email = Email.Trim(), password = Password.Trim() }; IsBusy = true; var signUpResponse = await _userService.SignUpAsync(signUpRequest); if (signUpResponse.hasSucceded) { //c'è da fare il login da qui? await App.Current.MainPage.DisplayAlert("Perfetto!", "Registrazione completata con successo", "Ok"); await NavService.NavigateTo <SearchPageViewModel>(); } else { await App.Current.MainPage.DisplayAlert("Errore", signUpResponse.responseMessage, "Ok"); } IsBusy = false; }
async Task ExecuteLogInCommand() { if (string.IsNullOrWhiteSpace(Email)) { StringBuilder benvenuto = new StringBuilder(); benvenuto.Append("Non hai inserito l'email"); await App.Current.MainPage.DisplayAlert("Fai attenzione:", benvenuto.ToString(), "Ok"); return; } if (string.IsNullOrWhiteSpace(Password)) { StringBuilder benvenuto = new StringBuilder(); benvenuto.Append("Non hai inserito la password"); await App.Current.MainPage.DisplayAlert("Fai attenzione:", benvenuto.ToString(), "Ok"); return; } Email = Email.Trim(); Password = Password.Trim(); IsBusy = true; var authResponse = await _authService.LoginAsync(Email, Password); if (authResponse.hasSucceded) { if (AppSettings.NewProfile) { StringBuilder benvenuto = new StringBuilder(); benvenuto.AppendLine("Benvenuto su RentIT!"); benvenuto.Append("Completa il tuo profilo prima di continuare"); await App.Current.MainPage.DisplayAlert("RentIT", benvenuto.ToString(), "Ok"); await NavService.NavigateTo <ModificaDatiViewModel>(); return; } await NavService.NavigateToMainPage(); } else { await App.Current.MainPage.DisplayAlert("Errore", authResponse.responseMessage, "Ok"); } IsBusy = false; }
async Task ExecutePinsCommand(ObservableRangeCollection <PlugEVMeEntry> entries) { try { var clone = JsonConvert.DeserializeObject <ObservableRangeCollection <PlugEVMeEntry> >(JsonConvert.SerializeObject(entries)); await NavService.NavigateTo <PinItemsSourcePageViewModel, ObservableRangeCollection <PlugEVMeEntry> >(clone); } catch (AppException e) { Debug.WriteLine("In catch block of Main method."); Debug.WriteLine("Caught: {0}", e.Message); if (e.InnerException != null) { Debug.WriteLine("Inner exception: {0}", e.InnerException); } } }
internal async Task RecordScanAsync(Guid id) { var logRecord = BuildLogRecord(id); if (1 == await DataRetrievalService.WriteBarcodeScanRecord(logRecord)) { //Queue up the record for upload to the Azure Database await DataRetrievalService.QueueAsync(logRecord.BarcodeScanLogId, QueueableObjects.BarcodeScanLog); //See if right now is a good time to upload the data - 10 records at a time DataRetrievalService.StartSafeQueuedUpdates(); //navigate await NavService.NavigateTo <LoyaltyBonusViewModel>(); } else { //TODO: rts - everything did not work out very well - write code here } }
async Task ExecuteLogOutCommandAsync() { IsBusy = true; var response = await _authService.LogoutAsync(); if (response) { await App.Current.MainPage.DisplayAlert("RentIT", "A presto!", "Ok"); await NavService.NavigateTo <SearchPageViewModel>(); } else { await App.Current.MainPage.DisplayAlert("Errore", "Impossibile effettuare il log out", "Ok"); } IsBusy = false; }
async Task ExecuteAddAnnuncioCommandAsync() { if (!IsLogged()) { await App.Current.MainPage.DisplayAlert("RentIT", "Iscriviti o effettua il login per aggiungere un annuncio!", "Ok"); await NavService.NavigateTo <LoginPageViewModel>(); return; } if (AppSettings.NewProfile) { await App.Current.MainPage.DisplayAlert("RentIT", "Aggiorna i tuoi dati prima di aggiungere un annuncio!", "Ok"); await NavService.NavigateTo <ModificaDatiViewModel>(); return; } await NavService.NavigateTo <AggiungiAnnuncioViewModel>(); }
async Task ExecuteSignInCommand() { // NEW Client ID: 409009394217-p3cu602apd7vkaucmg4p1vijhqm4is6f.apps.googleusercontent.com // OLD Client ID: 409009394217-11dcm7db57c38qp5q47jj4p8gfmi88p1.apps.googleusercontent.com await _authService.SignInAsync( tokenCallback : async t => { // use google token to get Azure auth token var response = await _tripLogService.GetAuthTokenAsync("google", t); // save auth token in local settings Helpers.Settings.TripLogApiAuthToken = response.AuthenticationToken; // Navigate to Main await NavService.NavigateTo <MainViewModel>(); await NavService.RemoveLastView(); }, errorCallback : e => { // todo: handle invalid auth here }); }
async Task ExecuteSignInCommand() { // TODO: Update with your Facebook Client Id await _authService.SignInAsync("YOUR-FACEBOOK-CLIENTID", new Uri("https://m.facebook.com/dialog/oauth"), new Uri("https://<your-service-name>.azurewebsites.net/.auth/login/facebook/callback"), tokenCallback : async t => { // Use Facebook token to get Azure auth token var response = await _tripLogService.GetAuthTokenAsync("facebook", t); // Save auth token in local settings Helpers.Settings.TripLogApiAuthToken = response.AuthenticationToken; // Navigate to Main await NavService.NavigateTo <MainViewModel>(); await NavService.RemoveLastView(); }, errorCallback : e => { // TODO: Handle invalid authentication here }); }
async Task ExecuteNewEntryCommand() { await NavService.NavigateTo <NewEntryViewModel>(); }
async Task ExecuteViewCommand(CateringEntry entry) { await NavService.NavigateTo <DetailViewModel, CateringEntry>(entry); }
private async Task AddAsset() { await NavService.NavigateTo <AssetDetailViewModel, AssetDto>(null); }
public async Task HandleFeedSelection(int feedId) { await NavService.NavigateTo <VprFeedArticlesViewModel, int>(feedId); }
async Task ExecuteSubmitCommand() { await NavService.NavigateTo <SubmitPageViewModel>(); }
// Momentaneamente commentato async Task ExecuteAnnunciPageCommand() { ObservableCollection <Ad> Annunci = await _annuncioService.GetLastAds(Citta, Oggetto); await NavService.NavigateTo <AnnunciPageViewModel, ObservableCollection <Ad> >(Annunci); }
async Task ExecuteViewCommand(PlugEVMeEntry entry) { await NavService.NavigateTo <DetailViewModel, PlugEVMeEntry>(entry); }
async Task ExecuteModificaCommandAsync() { await NavService.NavigateTo <ModificaDatiViewModel>(); }
async Task ExecuteViewGestioneAnnuncio(Ad annuncio) { await NavService.NavigateTo <GestioneAnnuncioViewModel, Ad>(annuncio); }
async Task ExecuteViewAnnuncio(Ad annuncio) { await NavService.NavigateTo <DettaglioAnnuncioViewModel, Ad>(annuncio); }
async Task ExecuteShowDetailsCommand(TripLogEntry entry) { await NavService.NavigateTo <EntryDetailsViewModel, TripLogEntry>(entry); }
async Task ExecuteUtenteCommand() { await NavService.NavigateTo <UtentePageViewModel>(); }
async Task ExecuteVediAnnunciUtenteCommand() { ObservableCollection <Ad> asd = await _annuncioService.GetUserAds(Utente.id, false); await NavService.NavigateTo <AnnunciPageViewModel, Utente>(Utente); }
async Task ExecuteAnnunciUtenteCommandAsync() { await NavService.NavigateTo <AnnunciUtenteViewModel>(); }
async Task ExecuteInfoUtenteCommand() { await NavService.NavigateTo <InfoUtenteViewModel, Utente>(Affittuario); }
private async Task ExecuteViewCommand(TripLogEntry entry) { await NavService.NavigateTo <DetailViewModel, TripLogEntry>(entry); }