public VM9340(INavigationService navigationService, IXLoggerFacade logger, IUserDialogs userDialogs) { _navigationService = navigationService; _logger = logger; _userDialogs = userDialogs; this._exitCmd = new DelegateCommand(async() => { await navigationService.GoBackAsync(); }); this._saveStreamCmd = new DelegateCommand <SignaturePad.Forms.SignaturePadView>(async(sigView) => { using (_userDialogs.Loading("Saving")) { await Task.Run(async() => { _logger.Log("Saving signature", Prism.Logging.Category.Info, Prism.Logging.Priority.Low); var rootFolder = FileSystem.Current.LocalStorage; var checkResult = await rootFolder.CheckExistsAsync("data"); IFolder folder = null; if (checkResult != ExistenceCheckResult.FolderExists) { folder = await rootFolder.CreateFolderAsync("data", CreationCollisionOption.OpenIfExists); } else { folder = await rootFolder.GetFolderAsync("data"); } var sigFile = await folder.CreateFileAsync("mysig.png", CreationCollisionOption.ReplaceExisting); var stream = await sigView.GetImageStreamAsync(SignaturePad.Forms.SignatureImageFormat.Png); using (var oStream = await sigFile.OpenAsync(PCLStorage.FileAccess.ReadAndWrite)) { await stream.CopyToAsync(oStream); await oStream.FlushAsync(); } _logger.Log("Saved signature", Prism.Logging.Category.Info, Prism.Logging.Priority.Low); }); } }); }
public GroupChatPageViewModel(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) { GroupWallet = null; _randomPendingID = new Random(); Message = string.Empty; Messages = new ObservableCollection <ChatMessage>(); LoadMoreCommand = new DelegateCommand <SfListView>(LoadMoreCommandExecuted); SendMessageCommand = new DelegateCommand(SendMessage); InteractMessageCommand = new DelegateCommand <ItemHoldingEventArgs>(InteractMessageCommandExecuted); PropertyChanged += ChatPageViewModel_PropertyChanged; }
public PomodoroPage(Acr.UserDialogs.IUserDialogs instance) { InitializeComponent(); this.BindingContext = new PomodoroPageViewModel(instance); }
public ConfigurationPage(Acr.UserDialogs.IUserDialogs instance) { InitializeComponent(); this.BindingContext = new ConfigurationPageViewModel(instance); }