public DataOperationViewModel(IConnectorHolder connectorHolder) { _holder = connectorHolder; EncryptionMethods = EncryptionMethod.GetSupportedMethods(); SetDefaults(); ClearCommand = new RelayCommand(SetDefaults); RefreshCommand = new RelayCommandAsync(InitializeAsync, parameter => CanRefresh()); SendCommand = new RelayCommandAsync(SendDataOperationAsync, parameter => CanSend()); }
public MessagesViewModel(IConnectorHolder connectorHolder, IPasswordsHolder passwordsHolder) { _connectorHolder = connectorHolder; _passwordsHolder = passwordsHolder; EncryptionMethods = EncryptionMethod.GetSupportedMethods(); SetDefaults(); RefreshCommand = new RelayCommandAsync(InitializeAsync); SendCommand = new RelayCommandAsync(SendDataOperationAsync, parameter => CanSend()); _timer = new DispatcherTimer(); _timer.Tick += new EventHandler(TimerTick); _timer.Interval = new TimeSpan(0, 0, Properties.Settings.Default.MessageRefreshingInterval); _timer.Start(); }
public ChatRoomViewModel(IConnectorHolder connectorHolder, IPasswordsHolder passwordsHolder) { _connectorHolder = connectorHolder; _passwordsHolder = passwordsHolder; _chatRoomAccounts = !string.IsNullOrEmpty(Properties.Settings.Default.ChatRooms) ? new ObservableCollection <AccountInfo>(JsonSerializer.Deserialize <List <AccountInfo> >(Properties.Settings.Default.ChatRooms)) : new ObservableCollection <AccountInfo>(); EncryptionMethods = EncryptionMethod.GetSupportedMethods(); SetDefaults(); RefreshCommand = new RelayCommandAsync(InitializeAsync, parameter => !_isBusy); SendCommand = new RelayCommandAsync(SendDataOperationAsync, parameter => CanSend()); _timer = new DispatcherTimer(); _timer.Tick += new EventHandler(TimerTick); _timer.Interval = new TimeSpan(0, 0, Properties.Settings.Default.MessageRefreshingInterval); _timer.Start(); }