public SettingsPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, IDeviceService deviceService, IFirebasePushNotification firebasePushNotification, IUserDialogs userDialogs, SyncServerConnection syncServerConnection, TronConnection tronConnection, WalletManager walletManager, TokenMessagesQueueService tokenMessagesQueueService, ConverseDatabase converseDatabase) : base(navigationService, pageDialogService, deviceService, firebasePushNotification, userDialogs, syncServerConnection, tronConnection, walletManager, tokenMessagesQueueService, converseDatabase) { Title = "Settings"; Icon = "baseline_settings_white_32"; }
public SyncServerConnectionEditor(SyncServerConnection connection = null) { InitializeComponent(); _syncServerConnection = connection ?? new SyncServerConnection(); DataContext = new SyncServerConnectionEditorViewModel(new SmoTasks(), _syncServerConnection.ConnectionString) { Connection = _syncServerConnection }; }
public RegisterPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, IDeviceService deviceService, IFirebasePushNotification firebasePushNotification, IUserDialogs userDialogs, SyncServerConnection syncServerConnection, TronConnection tronConnection, WalletManager walletManager, TokenMessagesQueueService tokenMessagesQueueService, ConverseDatabase converseDatabase) : base(navigationService, pageDialogService, deviceService, firebasePushNotification, userDialogs, syncServerConnection, tronConnection, walletManager, tokenMessagesQueueService, converseDatabase) { Title = "Register"; ContinueCommand = new DelegateCommand(ContinueCommandExecuted); SelectProfilePictureCommand = new DelegateCommand(SelectProfilePictureCommandExecuted); Wallet = _walletManager.CreateNewWalletAsync(); Wallet.ProfileImageUrl = "baseline_person_grayish_48"; }
public ChatsOverviewPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, IDeviceService deviceService, IUserDialogs userDialogs, IFirebasePushNotification firebasePushNotification, SyncServerConnection syncServer, TronConnection tronConnection, WalletManager walletManager, TokenMessagesQueueService tokenMessagesQueueService, ConverseDatabase converseDatabase) : base(navigationService, pageDialogService, deviceService, firebasePushNotification, userDialogs, syncServer, tronConnection, walletManager, tokenMessagesQueueService, converseDatabase) { Title = "Converse"; Icon = "logo_icon_white_32"; OpenChatCommand = new DelegateCommand <object>(OpenChatCommandExcecuted); UpdateChatEntriesCommand = new DelegateCommand(UpdateChatEntriesCommandExcecuted); DismissBandwidthWarningCommand = new DelegateCommand(DismissBandwidthWarningCommandExcecuted); MessagingCenter.Subscribe <TokenMessagesQueueService>(this, AppConstants.MessagingService.BandwidthError, (p) => CheckFreeUsage()); }
/// <summary> /// Method which discards changes in Connection, and loads Connection state from database. /// </summary> /// <param name="connection">Connection which will be reverted.</param> public void Revert(SyncServerConnection connection) { if (connection == null) { throw new ArgumentNullException("connection"); } if (connection.SyncServerConnectionId == Guid.Empty) { return; } Context.Refresh(RefreshMode.StoreWins, connection); }
public ChatPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, IDeviceService deviceService, IFirebasePushNotification firebasePushNotification, IUserDialogs userDialogs, SyncServerConnection syncServer, TokenMessagesQueueService tokenMessagesQueueService, TronConnection tronConnection, WalletManager walletManager, ConverseDatabase converseDatabase) : base(navigationService, pageDialogService, deviceService, firebasePushNotification, userDialogs, syncServer, tronConnection, walletManager, tokenMessagesQueueService, converseDatabase) { _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; }
/// <summary> /// Deleting <see cref="SyncServerConnection"/> from database. /// </summary> /// <param name="connection"><see cref="SyncServerConnection"/> which will be deleted.</param> public void Delete(SyncServerConnection connection) { if (connection == null) { throw new ArgumentNullException("connection"); } if (connection.SyncServerConnectionId == Guid.Empty || Context.SyncServerConnections.Where(c => c.SyncServerConnectionId == connection.SyncServerConnectionId). FirstOrDefault() == null) { return; } Context.DeleteObject(connection); Context.SaveChanges(); refreshCache(); }
public ViewModelBase(INavigationService navigationService, IPageDialogService pageDialogService, IDeviceService deviceService, IFirebasePushNotification firebasePushNotification, IUserDialogs userDialogs, SyncServerConnection syncServerConnection, TronConnection tronConnection, WalletManager walletManager, TokenMessagesQueueService tokenMessagesQueueService, ConverseDatabase converseDatabase) { _pageDialogService = pageDialogService; _deviceService = deviceService; _navigationService = navigationService; _fcm = firebasePushNotification; _userDialogs = userDialogs; _syncServer = syncServerConnection; _tronConnection = tronConnection; _walletManager = walletManager; _tokenMessagesQueue = tokenMessagesQueueService; _database = converseDatabase; IsBusy = false; IsNotBusy = true; CopyCommand = new DelegateCommand <string>((string content) => { Xamarin.Essentials.Clipboard.SetTextAsync(content); _userDialogs.Toast("Copied"); }); }
/// <summary> /// Methods for saving changes in database. /// </summary> /// <param name="connection">Connection which will be saved in database.</param> public void Save(SyncServerConnection connection) { if (connection == null) { throw new ArgumentNullException("connection"); } if (connection.SyncServerConnectionId == Guid.Empty || Context.SyncServerConnections.Where(c => c.SyncServerConnectionId == connection.SyncServerConnectionId). FirstOrDefault() == null) { if (connection.SyncServerConnectionId == Guid.Empty) { connection.SyncServerConnectionId = Guid.NewGuid(); } Context.AddToSyncServerConnections(connection); } Context.SaveChanges(); refreshCache(); }
public SplashScreenPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, IDeviceService deviceService, IFirebasePushNotification firebasePushNotification, IUserDialogs userDialogs, TronConnection tronConnection, ConverseDatabase database, TokenMessagesQueueService tokenMessagesQueueService, WalletManager walletManager, SyncServerConnection syncServerConnection) : base(navigationService, pageDialogService, deviceService, firebasePushNotification, userDialogs, syncServerConnection, tronConnection, walletManager, tokenMessagesQueueService, database) { }
public AddChatOptionPopupPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, IDeviceService deviceService, IFirebasePushNotification firebasePushNotification, IBarcodeScannerService barcodeScanner, IUserDialogs userDialogs, SyncServerConnection syncServerConnection, TronConnection tronConnection, WalletManager walletManager, TokenMessagesQueueService tokenMessagesQueueService, ConverseDatabase converseDatabase) : base(navigationService, pageDialogService, deviceService, firebasePushNotification, userDialogs, syncServerConnection, tronConnection, walletManager, tokenMessagesQueueService, converseDatabase) { _barcodeScanner = barcodeScanner; ScanCommand = new DelegateCommand(OnScanCommandExecuted); OpenChatCommand = new DelegateCommand(OpenChatCommandExecuted); }
public ConfirmRecoveryPhrasePageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, IDeviceService deviceService, IUserDialogs userDialogs, IFirebasePushNotification firebasePushNotification, WalletManager walletManager, SyncServerConnection syncServerConnection, TronConnection tronConnection, TokenMessagesQueueService tokenMessagesQueueService, ConverseDatabase converseDatabase) : base(navigationService, pageDialogService, deviceService, firebasePushNotification, userDialogs, syncServerConnection, tronConnection, walletManager, tokenMessagesQueueService, converseDatabase) { Title = "Recovery Phrase"; RecoveryPhraseConfirmation = new List <string>(new string[12]); for (var i = 0; i < RecoveryPhraseConfirmation.Count; i++) { RecoveryPhraseConfirmation[i] = string.Empty; } ContinueCommand = new DelegateCommand(Continue); }
public RegisterInfoPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, IUserDialogs userDialogs, IDeviceService deviceService, IFirebasePushNotification firebasePushNotification, SyncServerConnection syncServerConnection, TronConnection tronConnection, WalletManager walletManager, TokenMessagesQueueService tokenMessagesQueueService, ConverseDatabase converseDatabase) : base(navigationService, pageDialogService, deviceService, firebasePushNotification, userDialogs, syncServerConnection, tronConnection, walletManager, tokenMessagesQueueService, converseDatabase) { Title = "Register Info"; }
public QrCodePopupPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, IDeviceService deviceService, Plugin.FirebasePushNotification.Abstractions.IFirebasePushNotification firebasePushNotification, IUserDialogs userDialogs, SyncServerConnection syncServer, TronConnection tronConnection, WalletManager walletManager, TokenMessagesQueueService tokenMessagesQueueService, ConverseDatabase converseDatabase) : base(navigationService, pageDialogService, deviceService, firebasePushNotification, userDialogs, syncServer, tronConnection, walletManager, tokenMessagesQueueService, converseDatabase) { QrCodeContent = "none"; }
public MainPageViewModel(INavigationService navigationService, IPageDialogService pageDialogService, IFirebasePushNotification firebasePushNotification, IDeviceService deviceService, IBarcodeScannerService barcodeScannerService, IUserDialogs userDialogs, SyncServerConnection syncServer, TronConnection tronConnection, WalletManager walletManager, TokenMessagesQueueService tokenMessagesQueueService, ConverseDatabase converseDatabase) : base(navigationService, pageDialogService, deviceService, firebasePushNotification, userDialogs, syncServer, tronConnection, walletManager, tokenMessagesQueueService, converseDatabase) { Title = AppResources.MainPageTitle; this.barcodeScannerService = barcodeScannerService; OpenWelcomePageCommand = new Command(async() => await _navigationService.NavigateAsync("MainPage")); }