public static async Task<string> PickImageAsync(this Acr.UserDialogs.IUserDialogs dialogService, Image obj) { var result = await dialogService.ActionSheetAsync("Pick a photo", "Cancel", null, null, "From camera", "From gallery"); if (result == "From gallery") { if (await CheckPermissionStatusAsync(Permission.Storage)) { await CrossMedia.Current.Initialize(); if (!CrossMedia.Current.IsPickPhotoSupported) { await dialogService.AlertAsync("Premission not granted", "Photos Not Supported", "OK"); return null; } var file = await CrossMedia.Current.PickPhotoAsync( new PickMediaOptions { PhotoSize = PhotoSize.Medium, CompressionQuality = 80 }); if (file == null) return null; return "file://" + file.Path;//, file.GetStream()); } } else if (result == "From camera") { if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakePhotoSupported) { await dialogService.AlertAsync("No Camera", "No camera avaialble.", "OK"); return null; } if (await CheckPermissionStatusAsync(Permission.Camera)) { await CrossMedia.Current.Initialize(); var file = await CrossMedia.Current.TakePhotoAsync(new StoreCameraMediaOptions { DefaultCamera = CameraDevice.Rear, PhotoSize = PhotoSize.Small, Directory = "my_app", SaveToAlbum = true, }); if (file == null) return null; return "file://" + file.Path;//, file.GetStream()); } } return null; }
public HomePageViewModel(INavigationService navigationService , IPageDialogService pageDialogServie , Acr.UserDialogs.IUserDialogs userDialogs) { _navigationService = navigationService; _pageDialogService = pageDialogServie; _userDialogs = userDialogs; SaveUserInfoCmd = new DelegateCommand(SaveUser); ShowDatePickerCmd = new DelegateCommand(ShowDatePicker); }
public UserInfoConfirmationViewModel(Acr.UserDialogs.IUserDialogs userDialogs) { _userDialogs = userDialogs; }
public UpdateUserPopupPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, IDeviceService deviceService, Plugin.FirebasePushNotification.Abstractions.IFirebasePushNotification firebasePushNotification, Acr.UserDialogs.IUserDialogs userDialogs, Services.SyncServerConnection syncServerConnection, Services.TronConnection tronConnection, Tron.WalletManager walletManager, Services.TokenMessagesQueueService tokenMessagesQueueService, Database.ConverseDatabase converseDatabase) : base(navigationService, pageDialogService, deviceService, firebasePushNotification, userDialogs, syncServerConnection, tronConnection, walletManager, tokenMessagesQueueService, converseDatabase) { User = new UserInfo(); UpdateCommand = new DelegateCommand(UpdateCommandExecuted); SelectProfilePictureCommand = new DelegateCommand(SelectProfilePictureCommandExecuted); }
public LoginPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, IDeviceService deviceService, Plugin.FirebasePushNotification.Abstractions.IFirebasePushNotification firebasePushNotification, Acr.UserDialogs.IUserDialogs userDialogs, Services.SyncServerConnection syncServerConnection, Services.TronConnection tronConnection, Tron.WalletManager walletManager, Services.TokenMessagesQueueService tokenMessagesQueueService, Database.ConverseDatabase converseDatabase) : base(navigationService, pageDialogService, deviceService, firebasePushNotification, userDialogs, syncServerConnection, tronConnection, walletManager, tokenMessagesQueueService, converseDatabase) { Title = "Login"; PrivateKey = string.Empty; RecoveryPhrase = new List <string>(new string[12]); ContinueCommand = new DelegateCommand(ContinueCommandExecuted); }
public GroupPopupPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, IDeviceService deviceService, Plugin.FirebasePushNotification.Abstractions.IFirebasePushNotification firebasePushNotification, Acr.UserDialogs.IUserDialogs userDialogs, Services.SyncServerConnection syncServerConnection, Services.TronConnection tronConnection, Tron.WalletManager walletManager, Services.TokenMessagesQueueService tokenMessagesQueueService, Database.ConverseDatabase converseDatabase) : base(navigationService, pageDialogService, deviceService, firebasePushNotification, userDialogs, syncServerConnection, tronConnection, walletManager, tokenMessagesQueueService, converseDatabase) { AddressQrCodeContent = "none"; LeaveCommand = new DelegateCommand(LeaveCommandExecuted); JoinCommand = new DelegateCommand(JoinCommandExecuted); ShareCommand = new DelegateCommand(ShareCommandExecuted); ToggleEditModeCommand = new DelegateCommand(ToggleEditModeCommandExecuted); SelectProfilePictureCommand = new DelegateCommand(SelectProfilePictureCommandExecuted); SaveCommand = new DelegateCommand(SaveCommandExecuted); UserTappedCommand = new DelegateCommand <ItemTappedEventArgs>(UserTappedCommandExecuted); }
public ImagePopupPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, IDeviceService deviceService, Plugin.FirebasePushNotification.Abstractions.IFirebasePushNotification firebasePushNotification, Acr.UserDialogs.IUserDialogs userDialogs, Services.SyncServerConnection syncServerConnection, Services.TronConnection tronConnection, Tron.WalletManager walletManager, Services.TokenMessagesQueueService tokenMessagesQueueService, Database.ConverseDatabase converseDatabase) : base(navigationService, pageDialogService, deviceService, firebasePushNotification, userDialogs, syncServerConnection, tronConnection, walletManager, tokenMessagesQueueService, converseDatabase) { SaveCommand = new DelegateCommand <CachedImage>(SaveCommandExecuted); }
public ConfirmLoginPopupPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, IDeviceService deviceService, Plugin.FirebasePushNotification.Abstractions.IFirebasePushNotification firebasePushNotification, Acr.UserDialogs.IUserDialogs userDialogs, Services.SyncServerConnection syncServerConnection, Services.TronConnection tronConnection, Tron.WalletManager walletManager, Services.TokenMessagesQueueService tokenMessagesQueueService, Database.ConverseDatabase converseDatabase) : base(navigationService, pageDialogService, deviceService, firebasePushNotification, userDialogs, syncServerConnection, tronConnection, walletManager, tokenMessagesQueueService, converseDatabase) { User = new UserInfo { Name = string.Empty, ImageUrl = "baseline_person_grayish_48" }; ConfirmCommand = new DelegateCommand(ConfirmCommandExecuted); SelectProfilePictureCommand = new DelegateCommand(SelectProfilePictureCommandExecuted); }
public UserPopupPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, IDeviceService deviceService, Plugin.FirebasePushNotification.Abstractions.IFirebasePushNotification firebasePushNotification, Acr.UserDialogs.IUserDialogs userDialogs, Services.SyncServerConnection syncServerConnection, Services.TronConnection tronConnection, Tron.WalletManager walletManager, Services.TokenMessagesQueueService tokenMessagesQueueService, Database.ConverseDatabase converseDatabase) : base(navigationService, pageDialogService, deviceService, firebasePushNotification, userDialogs, syncServerConnection, tronConnection, walletManager, tokenMessagesQueueService, converseDatabase) { AddressQrCodeContent = "none"; }
public SelectUserPopupPageViewModel(INavigationService navigationService, IBarcodeScannerService barcodeScannerService, IPageDialogService pageDialogService, IDeviceService deviceService, Plugin.FirebasePushNotification.Abstractions.IFirebasePushNotification firebasePushNotification, Acr.UserDialogs.IUserDialogs userDialogs, Services.SyncServerConnection syncServerConnection, Services.TronConnection tronConnection, Tron.WalletManager walletManager, Services.TokenMessagesQueueService tokenMessagesQueueService, Database.ConverseDatabase converseDatabase) : base(navigationService, pageDialogService, deviceService, firebasePushNotification, userDialogs, syncServerConnection, tronConnection, walletManager, tokenMessagesQueueService, converseDatabase) { _barcodeScanner = barcodeScannerService; Users = new ObservableCollection <UserInfo>(); ScanCommand = new DelegateCommand(ScanCommandExecuted); SelectCommand = new DelegateCommand(SelectCommandExecuted); }