Esempio n. 1
0
        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;
        }
Esempio n. 2
0
        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);
        }
Esempio n. 5
0
        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);
        }
Esempio n. 6
0
        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);
        }
Esempio n. 7
0
 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);
 }
Esempio n. 8
0
 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);
 }
Esempio n. 9
0
 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);
        }