public OnboardingViewModel(INavigationService navigationService) : base(navigationService) { Boardings = new ObservableCollection <Boarding> { new Boarding { ImagePath = "ChooseGradient.svg", Header = TextsTranslateManager.Translate("Choose"), Content = TextsTranslateManager.Translate("PickItem") }, new Boarding { ImagePath = "ConfirmGradient.svg", Header = TextsTranslateManager.Translate("OrderConfirmed"), Content = TextsTranslateManager.Translate("OrderConfirmedText") }, new Boarding { ImagePath = "DeliverGradient.svg", Header = TextsTranslateManager.Translate("Delivered"), Content = TextsTranslateManager.Translate("DeliveredText") } }; SkipCommand = new Command(this.Skip); NextCommand = new Command(this.Next); }
async void OnButtonClickedPayByCash(object sender, EventArgs args) { Toast.MakeText(Application.Context, TextsTranslateManager.Translate("OrderCreated"), ToastLength.Short).Show(); GC.Collect(); Navigation.PushAsync(new OrdersPage()); await PopupNavigation.Instance.PopAsync(); }
private void InitEntryPlaceHolder() { FirstNamePld = TextsTranslateManager.Translate("FirstNamePld"); LastNamePld = TextsTranslateManager.Translate("LastNamePld"); AddressPld = TextsTranslateManager.Translate("AddressPld"); StatePld = TextsTranslateManager.Translate("StatePld"); PostCodePld = TextsTranslateManager.Translate("PostCodePld"); EmailPld = TextsTranslateManager.Translate("EmailPld"); PhonePld = TextsTranslateManager.Translate("PhonePld"); CityPld = TextsTranslateManager.Translate("CityPld"); }
private void Connectivity_ConnectivityChanged(object sender, ConnectivityChangedEventArgs e) { if (e.NetworkAccess != NetworkAccess.Internet) { Xamarin.Forms.Device.InvokeOnMainThreadAsync(async() => { var container = ((WPSTORE.App)Application.Current).Container; var dialogService = (IDialogService)container.Resolve(typeof(IDialogService)); dialogService.ShowToast(TextsTranslateManager.Translate("ConnectionErrorToast")); }); } }
private void ValidateSelection(int index) { if (index <= Boardings.Count - 2) { IsSkipButtonVisible = true; NextButtonText = TextsTranslateManager.Translate("Next"); } else { NextButtonText = TextsTranslateManager.Translate("Done"); IsSkipButtonVisible = false; } }
public async void ScanCustomOverlayAsync() { var options = new MobileBarcodeScanningOptions { AutoRotate = false, DisableAutofocus = false, }; options.PossibleFormats.Add(BarcodeFormat.QR_CODE); options.PossibleFormats.Add(BarcodeFormat.CODE_128); options.PossibleFormats.Add(BarcodeFormat.CODE_93); options.PossibleFormats.Add(BarcodeFormat.CODE_39); options.PossibleFormats.Add(BarcodeFormat.EAN_13); options.PossibleFormats.Add(BarcodeFormat.EAN_8); var overlay = new ZXingDefaultOverlay { ShowFlashButton = true, BottomText = TextsTranslateManager.Translate("ScanTopText"), TopText = TextsTranslateManager.Translate("TurnOnOffFlash") }; overlay.BindingContext = overlay; var scanPage = new ZXingScannerPage(options, overlay) { Title = TextsTranslateManager.Translate("ScannerTitle"), }; scanPage.OnScanResult += (result) => { scanPage.IsScanning = false; Device.BeginInvokeOnMainThread(async() => { await Navigation.PopAsync(); await DisplayAlert("Scanned result", result.Text, "OK"); }); }; await Navigation.PushAsync(scanPage); overlay.FlashButtonClicked += (s, ed) => { scanPage.ToggleTorch(); }; }
public async Task SetBusyAsync(Func <Task> func, string loadingMessage = null) { if (loadingMessage == null) { loadingMessage = TextsTranslateManager.Translate("Loading"); } UserDialogs.Instance.ShowLoading(loadingMessage, MaskType.None); await Task.Delay(200); IsBusy = true; try { await func(); } finally { UserDialogs.Instance.HideLoading(); IsBusy = false; } }